Eat Apples

Author: Accord Project

eat-apples@1.0.1 Clause ^2.0.0 d43c09d7bbfb395a63223455dc64788c879df7288d9bead18ac8d4ce67932e60

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,
  "contractId": "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.Contract from https://models.accordproject.org/accordproject/contract@0.2.0.cto
import org.accordproject.runtime@0.2.0.{Request,Response,Obligation} 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 extends Obligation {
  o String billTo
  o MonetaryAmount amount
}

@template
asset TemplateModel extends Contract {
  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": "4b55b660-97d6-11f1-9df3-81e11c024ca9"
}

Request Types

Type Sample JSON
org.accordproject.eatapples@0.2.0.Food
{
    "$class": "org.accordproject.eatapples@0.2.0.Food",
    "produce": "Consequat.",
    "price": {
        "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
        "doubleValue": 111.474,
        "currencyCode": "BRL"
    },
    "$timestamp": "2026-08-14T11:50:06.789Z"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-08-14T11:50:06.789Z"
}

Response Types

Type Sample JSON
org.accordproject.eatapples@0.2.0.Outcome
{
    "$class": "org.accordproject.eatapples@0.2.0.Outcome",
    "notice": "Cupidatat officia ea.",
    "$timestamp": "2026-08-14T11:50:06.790Z"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-08-14T11:50:06.790Z"
}

Events Types

Type Sample JSON
org.accordproject.eatapples@0.2.0.Bill
// sample generation failed: No concrete extending type for "concerto@1.0.0.Participant".

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.