Eat Apples

Author: Accord Project

eat-apples@0.14.0 Clause ^0.26.0 ddac151bfb2f57ca84dbd3a149b50f031360b47c7082288cf2cfe4e7821b7f0a

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": "b300e590-5150-11f1-abe1-4375007ed584"
}

Request Types

Type Sample JSON
org.accordproject.eatapples@0.2.0.Food
{
    "$class": "org.accordproject.eatapples@0.2.0.Food",
    "produce": "Aliqua.",
    "price": {
        "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
        "doubleValue": 165.483,
        "currencyCode": "KHR"
    },
    "$timestamp": "2026-05-16T18:57:26.760+01:00"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-05-16T18:57:26.760+01:00"
}

Response Types

Type Sample JSON
org.accordproject.eatapples@0.2.0.Outcome
{
    "$class": "org.accordproject.eatapples@0.2.0.Outcome",
    "notice": "Cupidatat.",
    "$timestamp": "2026-05-16T18:57:26.760+01:00"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-05-16T18:57:26.760+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.