Perishable Goods
This clause specifies penalties if the transport conditions (temperature and humidity) for a package are breached.
This clause specifies penalties if the transport conditions (temperature and humidity) for a package are breached.
This clause specifies penalties if the transport conditions (temperature and humidity) for a package are breached.
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
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
On receipt of the shipment {{shipment}} the importer {{importer}} pays the grower {{grower}} {{unitPrice}} per {{unit}}. The shipment must contain between {{minUnits}} and {{maxUnits}} {{unit}} of {{product}}.
Shipping containers used must be temperature and humidity controlled, and sensor readings must be logged at least {{sensorReadingFrequency}} per {{duration}}.
Shipments that arrive after {{dueDate}} 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 {{minTemperature}} and {{maxTemperature}}.
Humidity readings for the shipment must be between {{minHumidity}} and {{maxHumidity}}.
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 {{penaltyFactor}}.
Formula for Breach Penalty Calculation:
penalty = number of shipment units x difference between sensor reading and agreed range x breach penalty factor
{
"$class": "org.accordproject.perishablegoods.PerishableGoodsContract",
"grower": "resource:org.accordproject.party.Party#PETER",
"importer": "resource:org.accordproject.party.Party#DAN",
"shipment": "resource:org.accordproject.perishablegoods.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,
"contractId": "0367382d-7f38-49df-b2cd-c8c10b76a5a7",
"$identifier": "0367382d-7f38-49df-b2cd-c8c10b76a5a7"
}
namespace org.accordproject.perishablegoods
import org.accordproject.contract.* from https://models.accordproject.org/accordproject/contract.cto
import org.accordproject.party.* from https://models.accordproject.org/accordproject/party.cto
import org.accordproject.runtime.* from https://models.accordproject.org/accordproject/runtime.cto
import org.accordproject.obligation.* from https://models.accordproject.org/accordproject/obligation.cto
import org.accordproject.time.* from https://models.accordproject.org/time@0.2.0.cto
import org.accordproject.address.PostalAddress from https://models.accordproject.org/address.cto
import org.accordproject.organization.Organization from https://models.accordproject.org/organization.cto
import org.accordproject.money.MonetaryAmount from https://models.accordproject.org/money@0.2.0.cto
import org.accordproject.value.* from https://models.accordproject.org/value.cto
/**
* Defines a contract between a Grower and an Importer to ship using
* a Shipper, paying a set unit price. The unit price is multiplied by
* a penality factor proportional to the deviation from the min and max
* negociated temperatures for the shipment.
*/
asset PerishableGoodsContract extends Contract {
--> Party grower
--> Party importer
--> Shipment shipment
o DateTime dueDate
o MonetaryAmount unitPrice
o UnitOfMass unit
o Integer minUnits
o Integer maxUnits
o String product
o Integer sensorReadingFrequency
o TemporalUnit duration
o Double minTemperature
o Double maxTemperature
o Double minHumidity
o Double maxHumidity
o Double penaltyFactor
}
/**
* The status of a shipment
*/
enum ShipmentStatus {
o CREATED
o IN_TRANSIT
o ARRIVED
}
/**
* An abstract transaction that is related to a Shipment
*/
abstract transaction ShipmentTransaction extends Request {
--> Shipment shipment
}
/**
* An temperature reading for a shipment. E.g. received from a
* device within a temperature controlled shipping container
*/
transaction SensorReading extends ShipmentTransaction {
o Double centigrade
o Double humidity
}
/**
* A notification that a shipment has been received by the
* importer and that funds should be transferred from the importer
* to the grower to pay for the shipment.
*/
transaction ShipmentReceived extends ShipmentTransaction {
o Integer unitCount
}
/**
* The calculation of a price
*/
transaction PriceCalculation extends ShipmentTransaction {
o MonetaryAmount totalPrice
o MonetaryAmount penalty
o Boolean late
}
/**
* A shipment being tracked as an asset on the ledger
*/
asset Shipment identified by shipmentId {
o String shipmentId
o ShipmentStatus status
--> Party grower
--> Party importer
o SensorReading[] sensorReadings optional
o String smartClause optional
}
/**
* An abstract participant type in this business network
*/
abstract participant Business extends Organization {
o MonetaryAmount accountBalance
}
/**
* A Grower is a type of participant in the network
*/
participant Grower extends Business {
}
/**
* A Shipper is a type of participant in the network
*/
participant Shipper extends Business {
}
/**
* An Importer is a type of participant in the network
*/
participant Importer extends Business {
}
/**
* JUST FOR INITIALIZING A DEMO
*/
transaction SetupDemo {
}
Find the full logic for this template on on GitHub.
Type | Sample JSON |
---|---|
org.accordproject.runtime.State |
|
Type | Sample JSON |
---|---|
org.accordproject.perishablegoods.ShipmentReceived |
|
Type | Sample JSON |
---|---|
org.accordproject.perishablegoods.PriceCalculation |
|
Type | Sample JSON |
---|---|
org.accordproject.obligation.PaymentObligation |
|
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.