Fork me on GitHub

Template fragile-goods@0.0.4

This clause specifies penalties for shocks caused to a fragile package in transport.

Download Archive

Model Dependencies

Sample

6.1.7 Liquidated Damages for Delayed Delivery. 
In the event the EXW delivery date of the Equipment is delayed beyond the delivery schedule as indicated in Annex A, solely through the fault of the Seller, and unless the parties mutually agreed to an extension thereto, the Buyer is entitled to claim liquidated damages in an amount equivalent to 200.00 USD. 
Prior to implementing the provisions of Article 16.4 pursuant to this section, Buyer agrees that it shall discuss with Seller alternate remedies in good faith.. . . . 

7.1 The Equipment to be shipped to the Buyer shall be packed and shipped in accordance with the Specifications and if not specified therein.... 
Additionally the Equipment should have proper devices on it to record any shock during transportation as any instance of acceleration outside the bounds of -0.5g and 0.5g. 
Each shock shall reduce the Contract Price by 5.00 USD. Packing containing fragile materials should be so marked in bold stout letters. . . . .

ANNEX A
Equipment Description, Contract Price and Delivery Schedule

Contract Price is 1000.00 USD per unit of Equipment.
Delivery Schedule: no later than 10 seconds after initiation.

                

README

Fragile Goods

This is a smart legal clause that conforms to the Accord Protocol Template Specification, the protocol is managed by the open-source community of the Accord Project. The clause can be parsed and executed by the Cicero engine.

Description

This clause specifies penalties for shocks caused to a fragile package in transport.

This clause contains:

Running this clause

On your own machine

  1. Download the Cicero template library

  2. Unzip the library with your favourite tool

  3. Then from the command-line, change the current directory to the folder containing this README.md file.

cd fragile-goods
  1. With the Cicero command-line tool:
cicero execute --template ./ --sample ./sample.txt --request ./request.json --state ./state.json

Note, all of the command-line flags (like --template) are optional.

Alternatively you can use the simpler command below if you want to use all of the default files.

cicero execute

You should see the following output in your terminal:

mattmbp:fragile-goods matt$ cicero execute
18:25:06 - info: Logging initialized. 2018-05-15T22:25:06.285Z
18:25:06 - info: Using current directory as template folder
18:25:06 - info: Loading a default sample.txt file.
18:25:06 - info: Loading a single default request.json file.
18:25:06 - info: Loading a default state.json file.
18:25:06 - info: {"clause":"fragile-goods@0.0.4-8f725043d1fe2e64c5bcdefdb5693d65ba37fba60f743ac0f2f8d5e5595fe901","request":{"$class":"io.clause.demo.fragileGoods.DeliveryUpdate","startTime":"January 1, 2018 16:34:00","finishTime":"January 1, 2018 16:34:11","status":"ARRIVED","accelerometerReadings":[0.2,0.6,-0.3,-0.7,0.1]},"response":{"$class":"io.clause.demo.fragileGoods.PayOut","amount":790,"transactionId":"0fd66669-addc-4c0c-8c30-6103fd2293aa","timestamp":"2018-05-15T22:25:06.988Z"},"state":{"$class":"org.accordproject.common.ContractState","stateId":"org.accordproject.common.ContractState#1"},"emit":[]}

Sample Payload Data

Request, as in request.json

{
    "$class": "io.clause.demo.fragileGoods.DeliveryUpdate",
    "startTime":"January 1, 2018 16:34:00",
    "finishTime":"January 1, 2018 16:34:11",
    "status":"ARRIVED",
    "accelerometerReadings":[0.2,0.6,-0.3,-0.7,0.1]    
}

For the request above, you should see the following response:

{
    "$class":"io.clause.demo.fragileGoods.PayOut",
    "amount":790,
    "transactionId":"609813f8-e5b4-49f9-86ab-265a4428ee0f",
    "timestamp":"2018-02-18T10:53:15.589Z"
}

Testing this clause

This clause comes with an automated test that ensures that it executes correctly under different conditions. To test the clause, complete the following steps.

You need npm and node to test a clause. You can download both from here.

This clause was tested with Node v8.9.3 and NPM v5.6.0

From the fragile-goods directory.

  1. Install all of the dependencies.
npm install
  1. Run the tests
npm test

If successful, you should see the following output

mattmbp:fragile-goods matt$ npm test

> fragile-goods@0.0.3 test /Users/matt/dev/accordproject/cicero-template-library/fragile-goods
> mocha

10:54:35 - info: Logging initialized. 2018-02-18T10:54:35.125Z


  Logic
    #FragileGoodsDemo
      ✓ should execute a completed delivery contract with all deductions
      ✓ should execute an inflight delivery contract
      ✓ should execute a completed on-time delivery contract with breaches
      ✓ should execute a completed delivery contact with no deductions


  4 passing (468ms)