Eat Apples

Author: Accord Project

eat-apples@1.0.0 Clause ^1.0.0 16935ea8647aef4743a6188a97bcb4d94ec7695c6f6267b908d0627b634095a0

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.2.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.2.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
import org.accordproject.money@0.3.0.MonetaryAmount from https://models.accordproject.org/money@0.3.0.cto

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

transaction Outcome extends Response {
  o String notice
}

event Bill {
  o String billTo
  o MonetaryAmount 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": "1b4774f0-603f-11f1-9952-b99097577248"
}

Request Types

Type Sample JSON
org.accordproject.eatapples@0.2.0.Food
{
    "$class": "org.accordproject.eatapples@0.2.0.Food",
    "produce": "Do reprehenderit fugiat ut incididunt.",
    "price": {
        "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
        "doubleValue": 85.005,
        "currencyCode": "CUC"
    },
    "$timestamp": "2026-06-04T18:59:18.206+01:00"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-06-04T18:59:18.206+01:00"
}

Response Types

Type Sample JSON
org.accordproject.eatapples@0.2.0.Outcome
{
    "$class": "org.accordproject.eatapples@0.2.0.Outcome",
    "notice": "Sit anim non minim.",
    "$timestamp": "2026-06-04T18:59:18.207+01:00"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-06-04T18:59:18.207+01:00"
}

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.