Skip to content

0014. Business rules are configurable

  • Status: Accepted
  • Date: 2026-10-27

Shops differ in how they price and charge, even within one country: whether modifiers are charged per item or once per order line, whether service charge is calculated before or after tax, whether menu prices include tax. Hard-coding one practice forces every other shop to work around OpenKedai or fork it.

Where a business rule has more than one reasonable practice, OpenKedai makes it a setting instead of hard-coding one. Each setting has a sensible default: the most common practice, taken from the country pack where it is country-specific (see ADR 0006), and can be overridden per outlet, sales channel or item as fits the rule.

Legal requirements are not settings: where the law fixes a rule (for example, service charge is not subject to SST in Malaysia), the rule is enforced, and the country pack only describes it.

  • packages/core takes options (for example serviceChargeBase, modifier per) rather than assuming one behaviour; defaults keep simple setups simple.
  • Every option needs tests for each of its values, and the back office needs a place to set it.
  • More options mean more combinations to test. Add an option when a real practice needs it, and keep the default path the well-trodden one.

For AI tools: llms.txt ·llms-full.txtopenkedai.com