Skip to content

ATS-MBR-MEM-003Correct or close a term without losing earlier knowledge: Capability Test Specification

Markdown

ATS-MBR-MEM-003

Correct or close a term without losing earlier knowledge: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaMembershipModuleMemberships, Applications and Membership BillingRevision2

Read atservices-membership 5994c270react-console baf6dae3

Coverage

  • Rule gap: FND-MBR-MEM-085
  • Transition gap: FND-MBR-MEM-085
  • Validation covered
  • Permission covered
  • Edge gap: FND-MBR-MEM-085
  • Failure gap: FND-MBR-MEM-085
  • Boundary covered
  • Concurrency covered
  • Invariant gap: FND-MBR-MEM-085
  • Interaction covered

Test Scenarios

14 scenarios proving CAP-MBR-MEM-003; 7 bound to an existing test.

01 Reject stale changes and closure of a cancelled termconcurrencyapinegativeproposed
Proves
BR-CAP-MBR-MEM-003-01
Preconditions
A term has been read by two staff callers, and another term has already been cancelled.
Steps
[ { "do": "Correct using the first caller, retry a correction at the older version, and attempt to terminate the cancelled term.", "expect": "The stale write identifies the current version; the cancelled term cannot be terminated.", "provenance": "proposed", "source": "services-membership:modules/memberships/services/operations/staff-operations.ts:lockTerm, correctTerm, terminateTerm" } ]
Expected
The stale write identifies the current version; the cancelled term cannot be terminated.
Data
Principal term records, applicable status reasons and the dependent records required by this scenario.
Source
services-membership:modules/memberships/services/operations/staff-operations.ts:lockTerm, correctTerm, terminateTerm
02 Reproduce term knowledge from before a correctioninvariantapitest
Proves
BR-CAP-MBR-MEM-003-02
Preconditions
A dated term has a recorded history and an identifiable moment before its amendment.
Steps
[ { "do": "Amend the start with a reason, inspect versions, and read using knowledge before and after the write.", "expect": "History retains the original start and actor; the earlier-known and later-known reads return their respective starts.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#keeps the old truth of a correction in the versions, recorded with the actor", "services-membership:modules/memberships/tests/integration/db/membership-functions.integration.spec.ts#answers the corrected start with a known_at after the correction", "services-membership:modules/memberships/tests/integration/db/membership-functions.integration.spec.ts#keeps answering what was known before the correction with a known_at before it" ] } ]
Expected
History retains the original start and actor; the earlier-known and later-known reads return their respective starts.
Data
Principal term records, applicable status reasons and the dependent records required by this scenario.
Bound to
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#keeps the old truth of a correction in the versions, recorded with the actor
03 Constrain affiliations after dates and package changevalidationapitest
Proves
BR-CAP-MBR-MEM-003-04
Preconditions
A term holds chapter affiliations and an alternative package permits fewer chapters.
Steps
[ { "do": "Move the term’s start later, then attempt to select the more restrictive package.", "expect": "Affiliations starting before the amended start move forward; the excessive chapter count prevents the package change.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/integration/services/affiliations.integration.spec.ts#moves a term’s affiliations with a corrected start", "services-membership:tests/acceptance/memberships/MBR-ACC-0198.acceptance.ts#MBR-ACC-0198: A member's chapters stay inside her term when it is shortened or ended, a package that allows fewer chapters cannot replace hers, and her chapter's officer sees her only while her chain reaches the chapter" ] } ]
Expected
Affiliations starting before the amended start move forward; the excessive chapter count prevents the package change.
Data
Principal term records, applicable status reasons and the dependent records required by this scenario.
Bound to
Source
services-membership:modules/memberships/tests/integration/services/affiliations.integration.spec.ts#moves a term’s affiliations with a corrected start
04 Distinguish early closure from recording a later droptransitionapitest
Proves
BR-CAP-MBR-MEM-003-06
Preconditions
One term is effective and another has already expired.
Steps
[ { "do": "Terminate the effective term from a chosen date and record the expired member’s drop later.", "expect": "The effective period contracts to the preceding day; the expired period retains its end and records the later drop date.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows", "services-membership:tests/e2e/s04-lapse-and-rejoin.e2e.spec.ts#drops the expired term with its reason and leaves its dates as they were" ] } ]
Expected
The effective period contracts to the preceding day; the expired period retains its end and records the later drop date.
Data
Principal term records, applicable status reasons and the dependent records required by this scenario.
Bound to
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows
05 Cancel future coverage and reuse its datestransitionapitest
Proves
BR-CAP-MBR-MEM-003-07
Preconditions
A future committed term has not yet begun.
Steps
[ { "do": "Close it before its start, inspect standing, and add replacement coverage for the same dates.", "expect": "The original period is cancelled; standing falls back and replacement coverage is accepted.", "provenance": "test", "source": [ "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.cancelled, not terminated, for a term that had not started", "services-membership:tests/acceptance/memberships/MBR-ACC-0164.acceptance.ts#MBR-ACC-0164: A prepaid future term is cancelled before it starts, the membership falls back to none, the dates become free again, and a cancelled term cannot be closed twice" ] } ]
Expected
The original period is cancelled; standing falls back and replacement coverage is accepted.
Data
Principal term records, applicable status reasons and the dependent records required by this scenario.
Bound to
Source
services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.cancelled, not terminated, for a term that had not started
06 Limit chapter coverage through an ended termboundaryapitest
Proves
BR-CAP-MBR-MEM-003-08
Preconditions
A member has a term with a chapter affiliation.
Steps
[ { "do": "Terminate the term and inspect both its last day and the chapter row.", "expect": "The term has the shortened end; the affiliation end is either empty or equal to that end, with coverage limited by the term.", "provenance": "test", "source": [ "services-membership:tests/acceptance/memberships/MBR-ACC-0198.acceptance.ts#MBR-ACC-0198: A member's chapters stay inside her term when it is shortened or ended, a package that allows fewer chapters cannot replace hers, and her chapter's officer sees her only while her chain reaches the chapter" ] } ]
Expected
The term has the shortened end; the affiliation end is either empty or equal to that end, with coverage limited by the term.
Data
Principal term records, applicable status reasons and the dependent records required by this scenario.
Bound to
Source
services-membership:tests/acceptance/memberships/MBR-ACC-0198.acceptance.ts#MBR-ACC-0198: A member's chapters stay inside her term when it is shortened or ended, a package that allows fewer chapters cannot replace hers, and her chapter's officer sees her only while her chain reaches the chapter
07 Adjust granted mirrors when their source contractsinteractionapitest
Proves
BR-CAP-MBR-MEM-003-09
Preconditions
A package-granted term mirrors a source period.
Steps
[ { "do": "Shorten, extend, terminate and cancel source periods, inspecting the corresponding granted periods.", "expect": "A mirror shortens, remains at its shortened end after extension, or closes with the source as appropriate.", "provenance": "test", "source": [ "services-membership:tests/acceptance/memberships/MBR-ACC-0182.acceptance.ts#MBR-ACC-0182: Granted terms follow their source down but never up: shortened with a correction, terminated or cancelled with it, while the granted membership is not suspended with the primary" ] } ]
Expected
A mirror shortens, remains at its shortened end after extension, or closes with the source as appropriate.
Data
Principal term records, applicable status reasons and the dependent records required by this scenario.
Bound to
Source
services-membership:tests/acceptance/memberships/MBR-ACC-0182.acceptance.ts#MBR-ACC-0182: Granted terms follow their source down but never up: shortened with a correction, terminated or cancelled with it, while the granted membership is not suspended with the primary
08 Contract linked periods when staff correct the sourceinteractionapiproposed
Proves
BR-CAP-MBR-MEM-003-09 BR-CAP-MBR-MEM-006-07
Preconditions
An organizational holding and a granting holding have dependent periods.
Steps
[ { "do": "Shorten each source period, then read its linked periods.", "expect": "Dependent periods retain their source links and reflect the permitted contracted coverage.", "provenance": "proposed", "source": [ "services-membership:tests/acceptance/memberships/MBR-ACC-0182.acceptance.ts#MBR-ACC-0182: Granted terms follow their source down but never up: shortened with a correction, terminated or cancelled with it, while the granted membership is not suspended with the primary", "services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#re-mirrors the children when the parent’s end is corrected: a child never outlasts the parent" ] } ]
Expected
Dependent periods retain their source links and reflect the permitted contracted coverage.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:tests/acceptance/memberships/MBR-ACC-0182.acceptance.ts#MBR-ACC-0182: Granted terms follow their source down but never up: shortened with a correction, terminated or cancelled with it, while the granted membership is not suspended with the primary,services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#re-mirrors the children when the parent’s end is corrected: a child never outlasts the parent
09 Keep chapters valid after a period correctioninteractionapiproposed
Proves
BR-CAP-MBR-MEM-003-04 BR-CAP-MBR-MEM-007-03
Preconditions
A current period has two chapter connections.
Steps
[ { "do": "Move the first day later, then attempt a package change that permits only one chapter.", "expect": "The saved connections start inside the amended period; the invalid package change leaves the saved correction intact.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/affiliations.integration.spec.ts#moves a term’s affiliations with a corrected start", "services-membership:modules/memberships/tests/unit/unit-rules.spec.ts#refuses fewer affiliations of a type than its minimum from the day the operation takes effect" ] } ]
Expected
The saved connections start inside the amended period; the invalid package change leaves the saved correction intact.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/affiliations.integration.spec.ts#moves a term’s affiliations with a corrected start,services-membership:modules/memberships/tests/unit/unit-rules.spec.ts#refuses fewer affiliations of a type than its minimum from the day the operation takes effect
10 Make a planned billing action stale after correctioninteractionapinegativeproposed
Proves
BR-CAP-MBR-MEM-003-06 BR-CAP-MBR-MEM-013-07
Preconditions
A renewal action is planned from a current term.
Steps
[ { "do": "Correct the term, then execute the planned action.", "expect": "The action is stale and creates no renewal order for the corrected version.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows", "services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#refuses as stale an action whose term changed after planning" ] } ]
Expected
The action is stale and creates no renewal order for the corrected version.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows,services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#refuses as stale an action whose term changed after planning
11 Resolve expiry attention through staff closureinteractionapiproposed
Proves
BR-CAP-MBR-MEM-003-06 BR-CAP-MBR-MEM-014-07
Preconditions
Publication is enabled and a started period has an expiry item.
Steps
[ { "do": "Terminate the period and inspect its last day and attention outcome after commit.", "expect": "The period is closed and its existing item is resolved as terminated.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows", "services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction" ] } ]
Expected
The period is closed and its existing item is resolved as terminated.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows,services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction
12 Preserve the pre-correction answer for earlier knowledgeinteractionapiproposed
Proves
BR-CAP-MBR-MEM-003-02 BR-CAP-MBR-MEM-018-08
Preconditions
A committed term has recorded history.
Steps
[ { "do": "Correct its start, then read the same date with recording instants before and after the correction.", "expect": "The earlier-known answer retains the first start; the later-known answer reflects the correction.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#keeps the old truth of a correction in the versions, recorded with the actor", "services-membership:modules/history/tests/integration/membership-as-of.integration.spec.ts#answers the term as it was known before the correction, with a known_at before it" ] } ]
Expected
The earlier-known answer retains the first start; the later-known answer reflects the correction.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#keeps the old truth of a correction in the versions, recorded with the actor,services-membership:modules/history/tests/integration/membership-as-of.integration.spec.ts#answers the term as it was known before the correction, with a known_at before it
13 Publish the last covered day of staff terminationinteractionapiproposed
Proves
BR-CAP-MBR-MEM-003-06 BR-CAP-MBR-MEM-020-03
Preconditions
A person holds a started period.
Steps
[ { "do": "Terminate it from a selected day and inspect the committed termination event; repeat the operation in a transaction that rolls back.", "expect": "The committed event identifies the shortened last day; the rolled-back attempt publishes no event.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights" ] } ]
Expected
The committed event identifies the shortened last day; the rolled-back attempt publishes no event.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#terminates a term from the effective date, with the reason, and the status follows,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states one membership.term.terminated for a staff termination, with the person’s contact_id and the last day of rights
14 Keep correction and termination behind separate staff grantspermissionapinegativetest
Proves
BR-CAP-MBR-MEM-003-01
Preconditions
A current term and a future term have known versions; staff and a read-only colleague share their identifiers.
Steps
[ { "do": "Correct the current term as staff and the colleague; attempt future-term closure as the colleague before closing it as staff.", "expect": "The colleague’s requests are refused; the saved correction retains its version and dates, and only staff closes the future term.", "provenance": "test", "source": "services-membership:tests/acceptance/memberships/MBR-ACC-0172.acceptance.ts" } ]
Expected
The colleague’s requests are refused; the saved correction retains its version and dates, and only staff closes the future term.
Data
Suite-owned workspaces, annual membership fixtures, signed staff and restricted contexts.
Bound to
Source
services-membership:tests/acceptance/memberships/MBR-ACC-0172.acceptance.ts

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.