Skip to content

ATS-MBR-MEM-006Derive package grants and organizational child memberships: Capability Test Specification

Markdown

ATS-MBR-MEM-006

Derive package grants and organizational child memberships: 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-088
  • Transition gap: FND-MBR-MEM-088
  • Validation gap: FND-MBR-MEM-088
  • Permission gap: FND-MBR-MEM-088
  • Edge covered
  • Failure gap: FND-MBR-MEM-088
  • Boundary covered
  • Concurrency covered
  • Invariant gap: FND-MBR-MEM-088
  • Interaction covered

Test Scenarios

19 scenarios proving CAP-MBR-MEM-006; 6 bound to an existing test.

01 Commit package grants with the source terminteractionapitest
Proves
BR-CAP-MBR-MEM-006-01
Preconditions
A selected package grants a section membership to the same owner.
Steps
[ { "do": "Create the source membership and inspect its additional program membership after commit.", "expect": "The additional membership and source-linked term exist after the same commit.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#creates the granted membership and term of a package grant in the same transaction" ] } ]
Expected
The additional membership and source-linked term exist after the same commit.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Bound to
Source
services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#creates the granted membership and term of a package grant in the same transaction
02 Compute grant periods for enrolment and renewalruleunittest
Proves
BR-CAP-MBR-MEM-006-02
Preconditions
Grant inputs include same-as-primary, own-rule and renewal cases.
Steps
[ { "do": "Plan initial and renewed grants using each supported date rule.", "expect": "Mirroring retains source dates; own rules respect the source start; renewal plans the next target period.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans a granted term with the primary term’s dates for a grant same as primary", "services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans a granted term by the grant’s own rule, never starting before the primary term", "services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans the next granted term on a renewal of the granting package" ] } ]
Expected
Mirroring retains source dates; own rules respect the source start; renewal plans the next target period.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Bound to
Source
services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans a granted term with the primary term’s dates for a grant same as primary
03 Skip an overlapping target-program periodedgeunittest
Proves
BR-CAP-MBR-MEM-006-03
Preconditions
An effective target-program term overlaps a planned grant period.
Steps
[ { "do": "Plan the grant against the already-held effective target period.", "expect": "No duplicate period is planned, and the skipped result identifies the overlapping term.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#skips a grant the member already holds for those dates, naming the term" ] } ]
Expected
No duplicate period is planned, and the skipped result identifies the overlapping term.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Bound to
Source
services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#skips a grant the member already holds for those dates, naming the term
04 Select organizational contacts through qualifying rolesruleapitest
Proves
BR-CAP-MBR-MEM-006-04
Preconditions
An organization has contacts with qualifying and nonqualifying roles.
Steps
[ { "do": "Create the corporate period and inspect which contacts receive mirrored memberships.", "expect": "Qualifying contacts receive mirrored coverage; contacts with unrelated roles receive none.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#flows down to the contacts holding a flow-down role, mirroring the parent’s dates with the flow-down type", "services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#gives nothing to a contact whose role is not a flow-down role" ] } ]
Expected
Qualifying contacts receive mirrored coverage; contacts with unrelated roles receive none.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Bound to
Source
services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#flows down to the contacts holding a flow-down role, mirroring the parent’s dates with the flow-down type
05 Limit cascading to ten descendant levelsboundaryapitest
Proves
BR-CAP-MBR-MEM-006-05
Preconditions
An eleven-level hierarchy contains eligible contacts at the tenth and eleventh depths.
Steps
[ { "do": "Derive corporate coverage and inspect contacts at each depth.", "expect": "Depth-ten contacts receive coverage and depth-eleven contacts do not.", "provenance": "test", "source": [ "services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#cascades to the contacts of child organizations down to depth 10 and no further", "services-membership:tests/acceptance/affiliations/MBR-ACC-0274.acceptance.ts#MBR-ACC-0274: Acme's corporate membership reaches its CEO, its engineers and the people of its subsidiaries ten levels down, each with a mirrored employee term, and follows the parent through correction, termination, suspension and restore" ] } ]
Expected
Depth-ten contacts receive coverage and depth-eleven contacts do not.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Bound to
Source
services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#cascades to the contacts of child organizations down to depth 10 and no further
06 Select assigned seats within the package capboundaryapiproposed
Proves
BR-CAP-MBR-MEM-006-06
Preconditions
A decided organizational application names more contacts than the package’s seat allowance.
Steps
[ { "do": "Recalculate the organization’s children from the decided application contacts.", "expect": "Only contacts selected before the seat cap can receive assigned coverage; contacts already flowed down retain that coverage.", "provenance": "proposed", "source": "services-membership:modules/memberships/services/flowdown/organization-children.ts:wantedPeople" } ]
Expected
Only contacts selected before the seat cap can receive assigned coverage; contacts already flowed down retain that coverage.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Source
services-membership:modules/memberships/services/flowdown/organization-children.ts:wantedPeople
07 Update child periods after a parental correctioninteractionapitest
Proves
BR-CAP-MBR-MEM-006-07
Preconditions
An organizational parent has mirrored child periods.
Steps
[ { "do": "Correct the parent’s end to an earlier date and inspect dependent periods.", "expect": "Child mirrors follow the corrected end.", "provenance": "test", "source": [ "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
Child mirrors follow the corrected end.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Bound to
Source
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
08 Withdraw coverage after eligibility endstransitionapiproposed
Proves
BR-CAP-MBR-MEM-006-08
Preconditions
An engineer’s qualifying CRM role has ended but the change has not yet been handled.
Steps
[ { "do": "Deliver the role-change event and inspect the engineer’s term; separately exercise withdrawal before a child starts.", "expect": "Started coverage closes on the handling day; not-yet-started coverage is cancelled.", "provenance": "proposed", "source": "services-membership:modules/memberships/services/flowdown/organization-children.ts:syncOrganizationChildren" } ]
Expected
Started coverage closes on the handling day; not-yet-started coverage is cancelled.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Source
services-membership:modules/memberships/services/flowdown/organization-children.ts:syncOrganizationChildren
09 Converge after repeated CRM deliveriesconcurrencyapiproposed
Proves
BR-CAP-MBR-MEM-006-09
Preconditions
Current CRM relationships and existing child memberships differ after a role change.
Steps
[ { "do": "Deliver a change again and in reordered batches, then inspect child periods and event counts.", "expect": "Recomputation follows current CRM state without creating duplicate withdrawal events.", "provenance": "proposed", "source": "services-membership:modules/memberships/services/flowdown/crm-change-events.ts:handleCrmChangeEvents" } ]
Expected
Recomputation follows current CRM state without creating duplicate withdrawal events.
Data
Package grants or organizational parents, CRM relationships and controlled dates appropriate to this derivation.
Source
services-membership:modules/memberships/services/flowdown/crm-change-events.ts:handleCrmChangeEvents
10 Keep enrolment and package grants in one commitinteractionapiproposed
Proves
BR-CAP-MBR-MEM-001-09 BR-CAP-MBR-MEM-006-01
Preconditions
A new person selects a granting package.
Steps
[ { "do": "Create the source membership, then inspect the source and granted holdings after commit; repeat with a refused creation.", "expect": "The successful save contains source and grant periods; the refused save contains neither.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#creates a membership with its committed term, its enrolment and its cache", "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#creates the granted membership and term of a package grant in the same transaction" ] } ]
Expected
The successful save contains source and grant periods; the refused save contains neither.
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#creates a membership with its committed term, its enrolment and its cache,services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#creates the granted membership and term of a package grant in the same transaction
11 Renew the source and its package grant togetherinteractionapiproposed
Proves
BR-CAP-MBR-MEM-002-02 BR-CAP-MBR-MEM-006-02
Preconditions
A person has a source term and its mirrored grant.
Steps
[ { "do": "Add an undated source renewal and inspect the granted holding.", "expect": "The renewed source has a source-linked granted period calculated for that renewal.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#adds a renewal continuing the latest term when no dates are given", "services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans a granted term with the primary term’s dates for a grant same as primary" ] } ]
Expected
The renewed source has a source-linked granted period calculated for that renewal.
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#adds a renewal continuing the latest term when no dates are given,services-membership:modules/memberships/tests/unit/grant-plan.spec.ts#plans a granted term with the primary term’s dates for a grant same as primary
12 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
13 Propagate suspension to organizational childreninteractionapiproposed
Proves
BR-CAP-MBR-MEM-004-04 BR-CAP-MBR-MEM-006-04
Preconditions
An organization has qualifying people with derived holdings.
Steps
[ { "do": "Suspend the organization, inspect each child, then restore and inspect again.", "expect": "Each linked child follows the parent suspension and restoration while retaining its term dates.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/services/operations/staff-operations.ts:suspendChildren", "services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#flows down to the contacts holding a flow-down role, mirroring the parent’s dates with the flow-down type" ] } ]
Expected
Each linked child follows the parent suspension and restoration while retaining its term dates.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/services/operations/staff-operations.ts:suspendChildren,services-membership:modules/memberships/tests/integration/services/organization-children.integration.spec.ts#flows down to the contacts holding a flow-down role, mirroring the parent’s dates with the flow-down type
14 Keep child chapter coverage inside mirrored periodsinteractionapiproposed
Proves
BR-CAP-MBR-MEM-006-07 BR-CAP-MBR-MEM-007-03
Preconditions
A child mirrors an organizational period and has allowed chapter connections.
Steps
[ { "do": "Shorten the parental period, then inspect the child period and its dated chapter answer.", "expect": "Child coverage contracts with its source and no chapter answer extends beyond the contracted child period.", "provenance": "proposed", "source": [ "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", "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
Child coverage contracts with its source and no chapter answer extends beyond the contracted child period.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
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,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
15 Use decided application contacts for assigned coverageinteractionapiproposed
Proves
BR-CAP-MBR-MEM-006-06 BR-CAP-MBR-MEM-012-05 BR-CAP-MBR-MEM-012-06
Preconditions
A corporate application carries selected people and a package with an assigned-seat cap.
Steps
[ { "do": "Record the application approval, fulfil its purchase, and derive children from the selected people.", "expect": "The decided application supplies the assignment candidates and the resulting assigned holdings respect the selected cap.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/services/flowdown/organization-children.ts:wantedPeople", "services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#records an approval, places the dues order through the port (package and chapter dues), and acknowledges it" ] } ]
Expected
The decided application supplies the assignment candidates and the resulting assigned holdings respect the selected cap.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
services-membership:modules/memberships/services/flowdown/organization-children.ts:wantedPeople,services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#records an approval, places the dues order through the port (package and chapter dues), and acknowledges it
16 Close dependent coverage through a billing dropinteractionapiproposed
Proves
BR-CAP-MBR-MEM-006-07 BR-CAP-MBR-MEM-013-08 BR-CAP-MBR-MEM-013-09
Preconditions
A lapsed organizational period has linked child periods and a planned drop.
Steps
[ { "do": "Execute the billing drop and inspect the source and linked child periods.", "expect": "The drop records its configured reason and closes the applicable linked coverage with the source.", "provenance": "proposed", "source": [ "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", "services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#executes on the jobs engine: one order per renewing candidate (Jo’s with both dues chapters), a notice and reminder each, one drop per lapsed term" ] } ]
Expected
The drop records its configured reason and closes the applicable linked coverage with the source.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
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,services-membership:modules/billing/tests/integration/billing-runs.integration.spec.ts#executes on the jobs engine: one order per renewing candidate (Jo’s with both dues chapters), a notice and reminder each, one drop per lapsed term
17 Keep fan-out and alert resolution in the source saveinteractionapiproposed
Proves
BR-CAP-MBR-MEM-006-07 BR-CAP-MBR-MEM-014-07
Preconditions
Publication is enabled for an expiring organizational membership with children.
Steps
[ { "do": "Renew the organization and inspect renewed source coverage, derived periods and the original alert.", "expect": "The committed source renewal supplies the linked periods and resolves the original alert; a refused save leaves the prior state.", "provenance": "proposed", "source": [ "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", "services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction" ] } ]
Expected
The committed source renewal supplies the linked periods and resolves the original alert; a refused save leaves the prior state.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
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,services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves the item renewed in the staff renewal’s transaction
18 Retain child history before a parental correctioninteractionapiproposed
Proves
BR-CAP-MBR-MEM-006-07 BR-CAP-MBR-MEM-018-08
Preconditions
A mirrored child period and its source have committed versions.
Steps
[ { "do": "Correct the parent end, then reconstruct the child before and after the recording instant.", "expect": "Earlier knowledge retains the old child end and later knowledge shows the contracted end.", "provenance": "proposed", "source": [ "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", "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
Earlier knowledge retains the old child end and later knowledge shows the contracted end.
Data
An isolated workspace with the specified membership, package, chapter and partner-port fixtures.
Source
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,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
19 State commitment for a package grant with its sourceinteractionapiproposed
Proves
BR-CAP-MBR-MEM-006-01 BR-CAP-MBR-MEM-020-01
Preconditions
A new person selects a granting package.
Steps
[ { "do": "Create the source period and inspect the committed events for both source and granted periods.", "expect": "Both committed periods have their corresponding commitment events; a rolled-back save retains neither event.", "provenance": "proposed", "source": [ "services-membership:modules/memberships/tests/integration/services/staff-operations.integration.spec.ts#creates the granted membership and term of a package grant in the same transaction", "services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term" ] } ]
Expected
Both committed periods have their corresponding commitment events; a rolled-back save retains neither 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#creates the granted membership and term of a package grant in the same transaction,services-membership:modules/events/tests/integration/business-events.integration.spec.ts#states membership.term.committed and the term’s affiliation for a staff creation, naming the person, the program and the term

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.