Milestone: M1 · Card: docs/backlog/03-post-signature-domain.md
Blocked-by: #2
Scope
src/objects/obligation.object.ts, payment-plan.object.ts; the five summary roll-up fields on
clm_contract; state-machine guards for both children in contract.hook.ts.
Spec — DESIGN.md §03
Both controlled_by_parent, masterDetail clm_contract cascade, nameField: 'display_name'
(mirror stamped by mirror.hook.ts: obligation = title; payment plan = #<seq> · <planned_date>; a localized
form such as 第<seq>期 belongs to the zh-CN bundle, not the stored mirror).
clm_obligation icon list-checks; clm_payment_plan icon banknote. Amounts currency scale 2 min 0.
Roll-ups on clm_contract (Field.summary): version_count count of versions · open_deviation_count
count of deviations where status == 'open' · overdue_obligation_count count where status == 'overdue' ·
planned_amount sum of planned_amount · actual_amount sum of actual_amount. Read the
summaryOperations shape in @objectstack/spec/data before authoring; filtered roll-ups use the
filter predicate form the schema documents.
State machines: obligation pending→in_progress/done/waived/overdue; overdue→done/waived; in_progress→done/waived; payment plan planned→due→partial/paid/overdue; overdue→partial/paid.
overdue is entered only by the daily jobs (card 09) — a user write to overdue is refused.
Acceptance
- Gates green;
pnpm validate reports 11 objects.
- Creating two versions on a contract reads back
version_count == 2 through REST.
Out of scope
The jobs that flip overdue (09), dashboards (10).
Milestone: M1 · Card:
docs/backlog/03-post-signature-domain.mdBlocked-by: #2
Scope
src/objects/obligation.object.ts,payment-plan.object.ts; the fivesummaryroll-up fields onclm_contract; state-machine guards for both children incontract.hook.ts.Spec — DESIGN.md §03
Both
controlled_by_parent, masterDetailclm_contractcascade,nameField: 'display_name'(mirror stamped by
mirror.hook.ts: obligation =title; payment plan =#<seq> · <planned_date>; a localizedform such as
第<seq>期belongs to thezh-CNbundle, not the stored mirror).clm_obligationiconlist-checks;clm_payment_planiconbanknote. Amounts currency scale 2 min 0.Roll-ups on
clm_contract(Field.summary):version_countcount of versions ·open_deviation_countcount of deviations where
status == 'open'·overdue_obligation_countcount wherestatus == 'overdue'·planned_amountsum ofplanned_amount·actual_amountsum ofactual_amount. Read thesummaryOperationsshape in@objectstack/spec/databefore authoring; filtered roll-ups use thefilterpredicate form the schema documents.State machines: obligation
pending→in_progress/done/waived/overdue; overdue→done/waived; in_progress→done/waived; payment planplanned→due→partial/paid/overdue; overdue→partial/paid.overdueis entered only by the daily jobs (card 09) — a user write tooverdueis refused.Acceptance
pnpm validatereports 11 objects.version_count == 2through REST.Out of scope
The jobs that flip
overdue(09), dashboards (10).