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.5 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.5 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 {{shipmentId}} the importer {{importer}} pays the grower {{grower}} {{unitPrice}} {{currencyCode}} 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@0.1.0.TemplateModel",
"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+01: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,
"$identifier": "46467b65-22e0-40cc-900a-0f75dcc366f4",
"clauseId": "46467b65-22e0-40cc-900a-0f75dcc366f4"
}
namespace org.accordproject.perishablegoods@0.1.0
import org.accordproject.contract@0.2.0.Clause from https://models.accordproject.org/accordproject/contract@0.2.0.cto
import org.accordproject.runtime@0.2.0.{Request,Response} from https://models.accordproject.org/accordproject/runtime@0.2.0.cto
/**
* Units of mass
*/
enum UnitOfMass {
o KG
o TONNE
o LB
}
/**
* A sensor reading (temperature and humidity)
*/
concept SensorReading {
o Double centigrade
o Double humidity
}
/**
* Request: shipment received with unit count and embedded sensor readings
*/
transaction ShipmentReceived extends Request {
o String shipmentId
o Integer unitCount
o SensorReading[] sensorReadings
}
/**
* Response: price calculation result
*/
transaction PriceCalculation extends Response {
o Double totalPrice
o Double penalty
o String currencyCode
o Boolean late
}
/**
* Event emitted when payment is due
*/
event PerishableGoodsPaymentEvent {
o Double totalPrice
o String currencyCode
o String description
}
/**
* State for the perishable goods contract
*/
concept PerishableGoodsState identified {
o Boolean payoutMade default=false
o Double totalPaid default=0.0
}
/**
* The template model
*/
@template
asset TemplateModel extends Clause {
o String grower
o String importer
o String shipmentId
o DateTime dueDate
o Double unitPrice
o String currencyCode
o UnitOfMass unit
o Integer minUnits
o Integer maxUnits
o String product
o Integer sensorReadingFrequency
o String duration
o Double minTemperature
o Double maxTemperature
o Double minHumidity
o Double maxHumidity
o Double penaltyFactor
}
Find the full logic for this template on on GitHub.
| Type | Sample JSON |
|---|---|
| org.accordproject.runtime@0.2.0.State | |
| Type | Sample JSON |
|---|---|
| org.accordproject.perishablegoods@0.1.0.ShipmentReceived | |
| org.accordproject.runtime@0.2.0.Request | |
| Type | Sample JSON |
|---|---|
| org.accordproject.perishablegoods@0.1.0.PriceCalculation | |
| org.accordproject.runtime@0.2.0.Response | |
| Type | Sample JSON |
|---|
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.