Interest rules and base rate rows — endpoints and rules
Saving and deleting an interest rule, handling the default flag, and saving base rate rows through the master model.
Four endpoints sit under the rule function right: saverule, ruledelete, savebaserate, deletebaserate. Base rate rows are written by the masterdata/baserate master model, not by the settlement model.
Rules
- Saving an interest rule: the name is required (
error_rule_name); withis_defaultthe default flag of every other rule is cleared. - Deletion only if no invoice refers to it (
invoice.interest_rule_id); otherwiseerror_rule_usedwith the count. - Saving a base rate row: date, rate > 0 (
error_base_rate), three-letter currency (error_base_rate_currency); deletion through the master model.
Data model
Table names carry the installation's own prefix in the database.
| Table | Role | Relation |
|---|---|---|
interest_rule | interest rule (name, source, manual rate, margin, recovery fee, default) | invoice.interest_rule_id |
base_rate | central bank base rate row (valid from, rate, currency) | masterdata/baserate model |
Permissions
- Layer 1: core
modify. - Layer 2:
rule(legacy permission table only,interest_v1.sql). - Content scope: these endpoints check no content scope.