Eat Apples

Author: Accord Project

eat-apples@0.12.0 Clause ^0.22.0 e0dd758948f3326489dc675638693f2cba4d485d7ae9f4fff45a4561071e00b2

This is a clause enforcing healthy eating habits in employees.

Download Archive Download Compiled Archive Open in Template Studio Open in VSCode Web

Eat Apples!

This is a clause enforcing healthy eating habits in employees.

Template Text

Eating healthy clause between "Dan" (the Employee) and "ACME" (the Company). The canteen only sells apple products. Apples, apple juice, apple flapjacks, toffee apples. Employee gets fired if caught eating anything without apples in it. THE EMPLOYEE, IF ALLERGIC TO APPLES, SHALL ALWAYS BE HUNGRY. Apple products at the canteen are subject to a 4.5% tax.

Eating healthy clause between "Dan" (the Employee) and "ACME" (the Company). The canteen only sells apple products. Apples, apple juice, apple flapjacks, toffee apples. Employee gets fired if caught eating anything without apples in it. THE EMPLOYEE, IF ALLERGIC TO APPLES, SHALL ALWAYS BE HUNGRY. Apple products at the canteen are subject to a 4.5% tax.
Eating healthy clause between {{employee}} (the Employee) and {{company}} (the Company). The canteen only sells apple products. Apples, apple juice, apple flapjacks, toffee apples. Employee gets fired if caught eating anything without apples in it. THE EMPLOYEE, IF ALLERGIC TO APPLES, SHALL ALWAYS BE HUNGRY. Apple products at the canteen are subject to a {{tax}}% tax.
{
    "$class": "org.accordproject.canteen.CanteenClause",
    "employee": "Dan",
    "company": "ACME",
    "tax": 4.5,
    "clauseId": "43f03a86-9108-4f2e-ac12-c2e8dd313f54",
    "$identifier": "43f03a86-9108-4f2e-ac12-c2e8dd313f54"
}

Template Model

namespace org.accordproject.canteen

import org.accordproject.contract.* from https://models.accordproject.org/accordproject/contract.cto
import org.accordproject.runtime.* from https://models.accordproject.org/accordproject/runtime.cto

transaction Food {
  o String produce
  o Double price
}

transaction Outcome {
  o String notice
}

event Bill {
  o String billTo
  o Double amount
}

asset CanteenClause extends Clause {
  o String employee
  o String company
  o Double tax
}

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
org.accordproject.runtime.State
{
    "$class": "org.accordproject.runtime.State",
    "$identifier": "78e67fc0-a77b-11eb-9770-7ddd576a12c2"
}

Request Types

Type Sample JSON
org.accordproject.canteen.Food
{
    "$class": "org.accordproject.canteen.Food",
    "produce": "Minim velit ea.",
    "price": 151.189,
    "$timestamp": "2021-04-27T13:10:31.612-04:00"
}

Response Types

Type Sample JSON
org.accordproject.canteen.Outcome
{
    "$class": "org.accordproject.canteen.Outcome",
    "notice": "Est dolore consectetur ea.",
    "$timestamp": "2021-04-27T13:10:31.612-04:00"
}

Events Types

Type Sample JSON
concerto.Event
{
    "abstract": "this is an abstract type"
}

Technical Integration

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.