Skip to content

CAP-MBR-MEM-020Tell other applications when membership changes

Markdown

CAP-MBR-MEM-020

Tell other applications when membership changes

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationPartially observed

KindCapabilityProduct areaMembershipModuleMemberships, Applications and Membership BillingRevision1

Read atservices-membership 5994c270react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Committees can end a person's appointments when their membership ends.Any application can follow membership without reading Membership's records.
Surfaces
job
Constraints
An event's content is at most 8 KB.

Controls

34 controls apply, from the corpus control catalogue.

TC-AVL-002 TC-AVL-003 TC-AVL-004 TC-AZ-001 TC-AZ-003 TC-AZ-004 TC-CHG-001 TC-CHG-002 TC-CHG-003 TC-CHG-004 TC-CRY-001 TC-CRY-002 TC-CRY-003 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-007 TC-IAM-006 TC-LOG-002 TC-LOG-003 TC-LOG-005 TC-MON-001 TC-MON-002 TC-MON-004 TC-PI-001 TC-PI-002 TC-PI-004 TC-PRV-001 TC-PRV-002 TC-SEC-001 TC-SEC-004 TC-TEN-001 TC-TEN-002 TC-TEN-003

Business Rules

11 rules, 8 to be proved before approval. A rule's product intent is derived from its origin: 0 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Proposed
Membership states nine business events (a term committed, restated, terminated or cancelled; an affiliation started or ended; a membership suspended or restored; a unit moved in the tree), each in the transaction of the write it describes, so an operation that rolls back states nothing and none is stated outside a transaction.
invariantservice, databasetest
services-membership:modules/events/tests/integration/business-events.integration.spec.ts#leaves no event when the operation that stated it rolls back
02must prove
Proposed
Every membership event names the membership, its program, whether a person or an organization holds it (the person only for a person's), its origin and parent, and the person, operation and source of the change.
policyservicetest
services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#names an organization’s membership by its organization and no contact_id, whoever its primary contact is
03must prove
Proposed
A termination gives the last day of rights, the first day without and the reason; a lapse found by the nightly sweep is stated once as a termination ending on the term's own last day.
calculationservicetest
services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.terminated once when the midnight sweep finds a term lapsed, with the term’s last day
04must prove
Proposed
A cancellation says whether it removed the membership along with the term.
policyservicetest
05must prove
Proposed
Each event's content is strict and versioned: an undeclared field, a date that is not a local date, an overlong id or a termination without its last day is refused.
validationservice, databasetest
06must prove
Proposed
Events are delivered at least once and in no guaranteed order, each with its own stable identifier; Committees is handed terminations alone, and other events are settled without calling it.
policyservicetest
services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#gives Committees the business event’s own id, so a redelivery names the same event
07must prove
Proposed
A delivery a receiver fails is retried, and after five failed attempts it is set aside for operators with an alarm.
lifecycleservicetest
services-membership:modules/events/tests/integration/change-events-dispatch.integration.spec.ts#reports a failure on the queue’s last receive too, which moves the message to the dead-letter queue
08
Proposed
When an environment names no Committees receiver, events are kept as Membership's record but delivered to no one.
policyservicetest
services-membership:modules/events/tests/unit/change-event-registry.spec.ts#registers no handler without the ARN, so the stream’s events are deleted as they are claimed
09
Proposed
Bulk imports, the trimming of affiliations to a corrected term, and the void of a never-committed term state no event.
policyservicedocumented
services-membership:docs/migrations/events/README.md#What could not be done as specified, and why
10must prove
Proposed
The product should move a merged-away contact's or organization's memberships to the surviving record when CRM merges two records.
no proof recorded yet
policyserviceunknown
11
Proposed
Membership reads CRM's people, Accounting's products and prices and Platform's workspaces, users and number seeds directly from their owners' tables.
policydatabaseobserved

Scenarios

IdGivenWhenThenProvenance
01Dana's term is terminated by staff with a last day of 30 September 2026.The dispatcher and consumer run.Committees receives exactly one termination naming Dana and 30 September, attributed to the termination.test
services-membership:tests/e2e/business-events.e2e.spec.ts#states exactly one membership.term.terminated, with Dana’s contact_id and the last day of rights

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.