Demand Forecast

Author: Accord Project

demandforecast@0.13.1 Clause ^0.20.10 d738298bf8d488005c72892a002fe288f85004d58d61935835ee7f3ba04b95a3

A sample demandforecast clause.

Download Archive Open in Template Studio

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",
    "clauseId": "290d579b-8a64-498d-ab99-4145ae3969aa",
    "purchaser": "PETER",
    "supplier": "DAN",
    "effectiveDate": "2018-04-02T00:00:00.000-04:00",
    "minimumPercentage": 85
}

Template Model

namespace org.accordproject.demandforecast

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

asset DemandForecastClause extends AccordClause {
  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.cicero.contract.AccordContractState
{
    "$class": "org.accordproject.cicero.contract.AccordContractState",
    "stateId": "d38928c0-7b6b-11ea-b280-c173749a9e96"
}

Request Types

Type Sample JSON
org.accordproject.demandforecast.ForecastRequest
{
    "$class": "org.accordproject.demandforecast.ForecastRequest",
    "supplyForecast": 177.722,
    "transactionId": "d38901b0-7b6b-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:42:42.891-04:00"
}

Response Types

Type Sample JSON
org.accordproject.demandforecast.BindingResponse
{
    "$class": "org.accordproject.demandforecast.BindingResponse",
    "requiredPurchase": 143.338,
    "year": 17968,
    "quarter": 31909,
    "transactionId": "d38901b1-7b6b-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:42:42.891-04:00"
}

Events Types

Type Sample JSON
org.accordproject.base.Event
{
    "abstract": "this is an abstract type"
}

Technical Integration

Please refer to the Cicero documentation for details and examples of how to integrate a call to a Cicero template into your application.

View the Latest code for this template on GitHub.