Learn · Module detail
writing program terms
Write programme terms as executable rules: who qualifies, what event changes value, how rewards are used, when balances expire, how corrections work, and how changes are communicated.
## The mechanism
Define the qualifying event, value change, owner, correction path, and member explanation. Keep eligibility, liability, fulfilment, consent, and reversal as separate rules. The operating control must be testable from the ledger.
## Worked example
Illustrative arithmetic: a member spends 250 dollars at 2 points per dollar and receives 500 points. A returned purchase of 50 dollars reverses 100 points, leaving 400 points.
## Do it
State the rule in one sentence. Map the event that starts it, the event that changes value, the exception path, and the review action. Test ordinary, cancelled, duplicated, and disputed cases before release.
## Common mistakes
- Measuring activity instead of the target behaviour. Name the counterfactual. - Treating face value as operator cost. Price fulfilment and correction. - Hiding exclusions or expiry. Put the boundary beside the decision. - Automating an undefined rule. Resolve ownership before implementation.