ATS-MBR-MEM-002Extend an existing membership through a staff term: Acceptance Test Set
MarkdownExtend an existing membership through a staff term: Acceptance Test Set
Coverage
Test Scenarios
6 scenarios proving CAP-MBR-MEM-002; 5 bound to an existing test.
01 Refuse direct additions to organizational child membershipsapinegativeproposed
- Proves
BR-CAP-MBR-MEM-002-01 - Preconditions
- A corporate principal membership has flow-down and assigned children.
- Steps
- Attempt to add a staff term directly to each organizational child membership.
- Expected
- Each request is rejected as a direct child write, and no additional term is saved.
- Data
- Corporate, flow-down and assigned membership fixtures with their source parent.
- Source
- services-membership:modules/memberships/services/operations/staff-operations.ts:refuseChild
02 Compute the next period when dates are omittedapitest
- Proves
BR-CAP-MBR-MEM-002-02 - Preconditions
- An existing membership has a dated effective term and a package that continues from its end.
- Steps
- Add another term under the continuing package without supplying start or end dates.
- Expected
- The new period begins immediately after the earlier end and follows the package’s duration.
- Data
- An annual continuing package and a membership with a known term end.
- Bound to
- 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
03 Classify additions by their actual gapsunittest
- Proves
BR-CAP-MBR-MEM-002-03 - Preconditions
- Classification inputs include a first term, a contiguous term, a gap inside the window, a gap outside it and a package without a window.
- Steps
- Classify each supplied period relative to its predecessor.
- Expected
- The results are enrolment, renewal, reinstatement, rejoin and rejoin, in that order.
- Data
- Local dates and reinstatement settings for each classification boundary.
- Bound to
- Source
- services-membership:modules/memberships/tests/unit/term-events.spec.ts#is an enrolment for the first effective term
04 Retain original joining history across a long interruptionapitest
- Proves
BR-CAP-MBR-MEM-002-04 - Preconditions
- Sam has an expired, dropped term and a program with a 60-day continuity allowance.
- Steps
- Record his return after a 437-day gap and inspect the resulting membership.
- Expected
- The original join date remains recorded and continuity contains two episodes.
- Data
- Sam’s original period, drop reason and returning period.
- Bound to
- Source
- services-membership:tests/e2e/s04-lapse-and-rejoin.e2e.spec.ts#keeps the original join date and restarts continuity at the rejoin (a gap of 437 days is more than 60)
05 Keep the earlier type until a future renewal beginsapitest
- Proves
BR-CAP-MBR-MEM-002-05 - Preconditions
- Maria has a Student period followed by an Alumni renewal beginning on 1 July 2027.
- Steps
- Inspect the original term and read membership on 30 June and 1 July 2027.
- Expected
- The original Student term is unchanged; the date-specific types are Student and Alumni respectively.
- Data
- Student and Alumni types and their annual packages.
- Bound to
- Source
- services-membership:tests/e2e/s01-early-renewal-type-change.e2e.spec.ts#leaves the Student term untouched and current today, with the renewal recorded as renewed
06 Reject a caller without authority to add termsapinegativetest
- Proves
BR-CAP-MBR-MEM-002-08 - Preconditions
- The caller can read memberships but lacks permission to create terms.
- Steps
- Submit a further-term request using the restricted caller.
- Expected
- The API returns a forbidden response.
- Data
- A readable membership and a caller without term-creation authority.
- Bound to
- Source
- services-membership:tests/e2e/s01-early-renewal-type-change.e2e.spec.ts#refuses a term from a caller without membership.terms.create