Demand Forecast

Author: Accord Project

demandforecast@0.15.0 Clause ^0.22.0 c6a46c51da60fec61b87d5f5e8e68ea9f40a9d9e6c54c114c3f2396daad1bcc7

A sample demandforecast clause.

Download Archive Download Compiled Archive Open in Template Studio Open in VSCode Web

Demand Forecast

A sample demand forecast clause.

Template Text

On or before the 04/02/2018, and thereafter on or before the last day of each calendar quarter, the Purchaser "PETER" shall send the Supplier "DAN" a Supply Forecast. The Supply Forecast will be a binding commitment on the Purchaser’s behalf to purchase during the first quarter included in each Supply Forecast at least 85% of the quantity of the listed Product.

On or before the 04/02/2018, and thereafter on or before the last day of each calendar quarter, the Purchaser "PETER" shall send the Supplier "DAN" a Supply Forecast. The Supply Forecast will be a binding commitment on the Purchaser’s behalf to purchase during the first quarter included in each Supply Forecast at least 85% of the quantity of the listed Product.
On or before the {{effectiveDate}}, and thereafter on or before the last day of each calendar quarter, the Purchaser {{purchaser}} shall send the Supplier {{supplier}} a Supply Forecast. The Supply Forecast will be a binding commitment on the Purchaser’s behalf to purchase during the first quarter included in each Supply Forecast at least {{minimumPercentage}}% of the quantity of the listed Product.
{
    "$class": "org.accordproject.demandforecast.DemandForecastClause",
    "purchaser": "PETER",
    "supplier": "DAN",
    "effectiveDate": "2018-04-02T00:00:00.000-04:00",
    "minimumPercentage": 85,
    "clauseId": "d6af74ee-da2f-4a15-b019-bca30ba87872",
    "$identifier": "d6af74ee-da2f-4a15-b019-bca30ba87872"
}

Template Model

namespace org.accordproject.demandforecast

import org.accordproject.contract.* from https://models.accordproject.org/accordproject/contract.cto
import org.accordproject.runtime.* from https://models.accordproject.org/accordproject/runtime.cto

asset DemandForecastClause extends Clause {
  o String purchaser
  o String supplier 
  o DateTime effectiveDate
  o Double minimumPercentage
}

/**
 * Defines the output data required by the template
 */
transaction ForecastRequest extends Request {
/**
 * How much is the forecast?
 */
  o Double supplyForecast
}

transaction BindingResponse extends Response {
/**
 * Amount must purchase.
 */
  o Double requiredPurchase
/**
 * Which year?
 */
  o Integer year
/**
 * Which quarter in this year?
 */
  o Integer quarter
}

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
org.accordproject.runtime.State
{
    "$class": "org.accordproject.runtime.State",
    "$identifier": "718ca1f0-a77b-11eb-9770-7ddd576a12c2"
}

Request Types

Type Sample JSON
org.accordproject.demandforecast.ForecastRequest
{
    "$class": "org.accordproject.demandforecast.ForecastRequest",
    "supplyForecast": 4.043,
    "$timestamp": "2021-04-27T13:10:19.278-04:00"
}

Response Types

Type Sample JSON
org.accordproject.demandforecast.BindingResponse
{
    "$class": "org.accordproject.demandforecast.BindingResponse",
    "requiredPurchase": 255.418,
    "year": 55763,
    "quarter": 40135,
    "$timestamp": "2021-04-27T13:10:19.279-04:00"
}

Events Types

Type Sample JSON
concerto.Event
{
    "abstract": "this is an abstract type"
}

Technical Integration

Please refer to the Accord Project documentation for how to use a template or integrate it within your application.

View the Latest code for this template on GitHub.