Fork me on GitHub

Template perishable-goods@0.3.0

Clause Ergo ^0.4.6 7469ea4cee058804c152f841914144ed8d5093ad7c0a0443783994f93486a466

This clause specifies penalties if the transport conditions (temperature and humidity) for a package are breached.

Download Archive

Perishable Goods

This clause specifies penalties if the transport conditions (temperature and humidity) for a package are breached.

Sample

On receipt of the shipment "SHIP_001" the importer "DAN" pays the grower "PETER" 1.50 USD per KG. The shipment must contain between 3000 and 3500 KG of "Grade I, Size 4, Zutano Mexican Avocados".

Shipping containers used must be temperature and humidity controlled, and sensor readings must be logged at least 1 per hours.

Shipments that arrive after 07/02/2018 are to be considered spoiled and must be arranged to be returned to or disposed of by grower at cost to grower.

Temperature readings for the shipment must be between 2 and 13.

Humidity readings for the shipment must be between 70 and 90.

Shipments that have a temperature or humidity reading outside the agreed range have a price penalty applied calculated using the Formula for Breach Penalty Calculation below. The breach penalty factor to be used is 0.2.

Formula for Breach Penalty Calculation:
   penalty = number of shipment units x difference between sensor reading and agreed range x breach penalty factor

                

Model Dependencies

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 on GitHub.

Sample Instance

{
    "$class": "org.accordproject.perishablegoods.PerishableGoodsClause",
    "clauseId": "722776eb-78b3-471d-adb4-28573296bac8",
    "grower": "PETER",
    "importer": "DAN",
    "shipment": "SHIP_001",
    "dueDate": "2018-07-02",
    "unitPrice": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 1.5,
        "currencyCode": "USD"
    },
    "unit": "KG",
    "minUnits": 3000,
    "maxUnits": 3500,
    "product": "Grade I, Size 4, Zutano Mexican Avocados",
    "sensorReadingFrequency": 1,
    "duration": "hours",
    "minTemperature": 2,
    "maxTemperature": 13,
    "minHumidity": 70,
    "maxHumidity": 90,
    "penaltyFactor": 0.2
}

State Types

Type Sample JSON
org.accordproject.cicero.contract.AccordContractState
{
    "$class": "org.accordproject.cicero.contract.AccordContractState",
    "stateId": "b3cdc330-85ed-11e8-bfc4-b186147bdb41"
}

Request Types

Type Sample JSON
org.accordproject.perishablegoods.ShipmentReceived
{
    "$class": "org.accordproject.perishablegoods.ShipmentReceived",
    "unitCount": 57629,
    "shipment": "resource:org.accordproject.perishablegoods.Shipment#4815",
    "transactionId": "b3cd9c20-85ed-11e8-bfc4-b186147bdb41",
    "timestamp": "2018-07-12T16:07:40.514Z"
}

Response Types

Type Sample JSON
org.accordproject.perishablegoods.PriceCalculation
{
    "$class": "org.accordproject.perishablegoods.PriceCalculation",
    "totalPrice": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 134.196,
        "currencyCode": "CLP"
    },
    "penalty": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 223.358,
        "currencyCode": "HTG"
    },
    "late": false,
    "shipment": "resource:org.accordproject.perishablegoods.Shipment#7730",
    "transactionId": "b3cd9c21-85ed-11e8-bfc4-b186147bdb41",
    "timestamp": "2018-07-12T16:07:40.514Z"
}

Events Types

Type Sample JSON
org.hyperledger.composer.system.Event
{
    "abstract": "this is an abstract type"
}