Eat Apples

Author: Accord Project

eat-apples@0.13.0 Clause ^0.26.0 8a415f254f2a693ba78bfecf70acb5b3f6ee9b81327b520792f8d2aedb662beb

This is a clause enforcing healthy eating habits in employees.

Download Archive Download Compiled Archive Open in Template Playground 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.eatapples@0.1.0.TemplateModel",
  "employee": "Dan",
  "company": "ACME",
  "tax": 4.5,
  "clauseId": "0956261f-a7be-468d-b2dd-809c22fbc9c2",
  "$identifier": "0956261f-a7be-468d-b2dd-809c22fbc9c2"
}

Template Model

namespace org.accordproject.eatapples@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

transaction Food extends Request {
  o String produce
  o Double price
}

transaction Outcome extends Response {
  o String notice
}

event Bill {
  o String billTo
  o Double amount
}

@template
asset TemplateModel 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@0.2.0.State
{
    "$class": "org.accordproject.runtime@0.2.0.State",
    "$identifier": "78d21ad0-50a4-11f1-a498-6b6dff021a96"
}

Request Types

Type Sample JSON
org.accordproject.eatapples@0.1.0.Food
{
    "$class": "org.accordproject.eatapples@0.1.0.Food",
    "produce": "Eu nisi magna qui cillum.",
    "price": 102.654,
    "$timestamp": "2026-05-15T21:24:35.709Z"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-05-15T21:24:35.709Z"
}

Response Types

Type Sample JSON
org.accordproject.eatapples@0.1.0.Outcome
{
    "$class": "org.accordproject.eatapples@0.1.0.Outcome",
    "notice": "Consequat culpa eu nostrud.",
    "$timestamp": "2026-05-15T21:24:35.709Z"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-05-15T21:24:35.709Z"
}

Events Types

Type Sample JSON

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.