Perishable Goods

perishable-goods@0.12.1 Contract ^0.13.0 077fca03048db6c16adb4b28571921d52295aeecd6e45f63426b4835a4eca061

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

Download Archive Open in Template Studio Open in VSCode Web

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.PerishableGoodsContract",
    "contractId": "b9642db0-96d3-4df6-8b45-e0bdfe79de27",
    "grower": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "PETER"
    },
    "importer": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "DAN"
    },
    "shipment": "SHIP_001",
    "dueDate": "2018-07-02T00:00:00.000-04:00",
    "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": "2f15d941-b399-11e9-a415-2f2abeed0243"
}

Request Types

Type Sample JSON
org.accordproject.perishablegoods.ShipmentReceived
{
    "$class": "org.accordproject.perishablegoods.ShipmentReceived",
    "unitCount": 60035,
    "shipment": "resource:org.accordproject.perishablegoods.Shipment#8513",
    "transactionId": "2f15b230-b399-11e9-a415-2f2abeed0243",
    "timestamp": "2019-07-31T09:43:31.283-04:00"
}

Response Types

Type Sample JSON
org.accordproject.perishablegoods.PriceCalculation
{
    "$class": "org.accordproject.perishablegoods.PriceCalculation",
    "totalPrice": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 90.459,
        "currencyCode": "AUD"
    },
    "penalty": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 209.664,
        "currencyCode": "AMD"
    },
    "late": true,
    "shipment": "resource:org.accordproject.perishablegoods.Shipment#4444",
    "transactionId": "2f15d940-b399-11e9-a415-2f2abeed0243",
    "timestamp": "2019-07-31T09:43:31.284-04:00"
}

Events Types

Type Sample JSON
org.accordproject.cicero.runtime.PaymentObligation
{
    "$class": "org.accordproject.cicero.runtime.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 128.041,
        "currencyCode": "MUR"
    },
    "description": "Duis amet ut commodo Lorem.",
    "contract": "resource:org.accordproject.perishablegoods.PerishableGoodsContract#0111",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#2577",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#3327",
    "deadline": "2019-07-31T09:43:31.285-04:00",
    "eventId": "2f160050-b399-11e9-a415-2f2abeed0243",
    "timestamp": "2019-07-31T09:43:31.285-04:00"
}