Skip to content

DOM-MBR-STR-005Term Lifecycle

Markdown

DOM-MBR-STR-005

Term Lifecycle

Markdown
  • DocumentDraft
  • ImplementationObserved

Planning

Specified by
CON-MBR-STR-005

Design

Owned by
SVC-MBR-STR-terms

KindDomain objectProduct areaMembershipModuleOrganizational Structure, Membership Configuration and TermsRevision1

Read atservices-membership 5994c270react-console baf6dae3

Relationships

ToCardinalityOwnershipCrosses a serviceOn archive or delete
DOM-MBR-STR-004A package or grant rule can determine many term periodsPackages own term rules, which the calculation functions consume.yes
DOM-MBR-STR-003Each program and type supplies grace, benefit and continuity inputs for its holdingsPrograms and types own the allowances; the domain's hooks provide their current values to the engine.yes

Invariants

InvariantProtectsEnforced atProvenance
INV-DOM-MBR-STR-005-01
Pure date, status, continuity, cache and sweep decisions use only their supplied inputs without a clock, database access or input mutation; facade hooks can obtain inputs from the domain.
servicetest
services-membership:modules/terms/tests/unit/term-rules.spec.ts#term rules: what 2.0 decides › gives the same result twice for the same frozen inputs (1.0 turned the fixed dates into Moments in place, so a second call read other inputs)
INV-DOM-MBR-STR-005-02
The term engine's module does not import another module from this repository.
servicetest
services-membership:modules/terms/tests/unit/isolation.spec.ts#term engine isolation › imports nothing of the repository outside modules/terms
INV-DOM-MBR-STR-005-03
Committed, superseded and terminated terms cover their effective dates; pending and cancelled terms neither cover dates nor start grace.
servicetest
services-membership:modules/terms/tests/unit/status.spec.ts#holding status: the effective states of §1 › never lets a pending term cover a date
INV-DOM-MBR-STR-005-04
Status follows suspension, coverage with or without benefits, grace, lapse, future, pending and none in that order.
servicetest
services-membership:modules/terms/tests/unit/status.spec.ts#holding status: the precedence of §2 › puts suspended over grace
INV-DOM-MBR-STR-005-05
Engine column declarations constrain five stored term states, ordered start and end dates and eight cached holding statuses.
databasetest
services-membership:modules/terms/tests/unit/columns.spec.ts#term columns (§3.2) › order the dates: an end, when there is one, on or after the start
INV-DOM-MBR-STR-005-06
An absent previous sweep or one older than yesterday requires full recomputation instead of boundary-only work.
servicetest
services-membership:modules/terms/tests/unit/sweep.spec.ts#the sweep’s catch-up rule › catches up after a missed night
INV-DOM-MBR-STR-005-07
Suspended holdings and holdings with an effective covering term produce no expiry or lapse detections.
serviceobserved
INV-DOM-MBR-STR-005-08
The helper checks availability and matching reason use. Staff cancellation before the start allows an active termination reason as a fallback; Commerce cancellation merely resolves an optional reason, without checking availability or use.
serviceobserved
INV-DOM-MBR-STR-005-09
Grace and continuity calculations reject negative or fractional day allowances.
servicetest
services-membership:modules/terms/tests/unit/status.spec.ts#holding status: the effective states of §1 › refuses a negative number of grace days

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.