---
id: ATS-MBR-MEM-009
scope: CAP-MBR-MEM-009
product_area: membership
module: memberships
revision: 2
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-MBR-MEM-009-01
    title: Preparing a checkout writes nothing and carries no amount
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-01
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: Advise and prepare a cart with a package and a dues line.
        expect: >-
          Both answer the plan without writing; no field anywhere holds an
          amount.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/unit/purchase-plan.spec.ts#carries
            no amount anywhere
          - >-
            services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#advises
            ok and writes nothing
    expected: Both answer the plan without writing; no field anywhere holds an amount.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-010
      - TST-MBR-MEM-241
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/unit/purchase-plan.spec.ts#carries
      no amount anywhere
    category: invariant
    binding_evidence:
      - suite: TST-MBR-MEM-010
        source: >-
          services-membership:modules/commerce-participant/tests/unit/purchase-plan.spec.ts#carries
          no amount anywhere
      - suite: TST-MBR-MEM-241
        source: >-
          services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#advises ok
          and writes nothing
  - id: ATS-MBR-MEM-009-02
    title: 'A package line must be the package itself, active and consistent'
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-02
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Prepare a line whose product is another product, and one whose package
          is retired.
        expect: Both are refused naming the problem.
        provenance: proposed
        source: >-
          services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#refuses
          a package line whose product is not the package: the package is its
          product (D-1)
    expected: Both are refused naming the problem.
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to: []
    provenance: proposed
    source: >-
      services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#refuses
      a package line whose product is not the package: the package is its
      product (D-1)
    category: validation
    binding_gap: FND-MBR-MEM-103
  - id: ATS-MBR-MEM-009-03
    title: >-
      The member's state decides the operation, and a wrong one is refused
      naming the right one
    level: unit
    proves:
      - BR-CAP-MBR-MEM-009-03
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Ask to enrol an existing member, renew a lapsed one, reinstate a
          current one and rejoin inside the window.
        expect: >-
          Each is refused naming renew, rejoin, renew and reinstate
          respectively.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            an owner already holding the membership, naming renew
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a renewal of a lapsed membership, naming rejoin (07 §2)
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a reinstatement of a current membership, naming renew
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a rejoin inside the reinstatement window, naming reinstate
          - >-
            services-membership:tests/acceptance/commerce/MBR-ACC-0332.acceptance.ts#MBR-ACC-0332
    expected: 'Each is refused naming renew, rejoin, renew and reinstate respectively.'
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-008
      - TST-MBR-MEM-096
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
      an owner already holding the membership, naming renew
    category: validation
    binding_evidence:
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          an owner already holding the membership, naming renew
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          a renewal of a lapsed membership, naming rejoin (07 §2)
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          a reinstatement of a current membership, naming renew
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          a rejoin inside the reinstatement window, naming reinstate
      - suite: TST-MBR-MEM-096
        source: >-
          services-membership:tests/acceptance/commerce/MBR-ACC-0332.acceptance.ts#MBR-ACC-0332
  - id: ATS-MBR-MEM-009-04
    title: 'Renewal windows, do-not-renew and past effective dates refuse'
    level: unit
    proves:
      - BR-CAP-MBR-MEM-009-04
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Renew before the window, renew a do-not-renew member, renew on a
          chosen date, enrol from a past date.
        expect: Each is refused.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a renewal before the package’s renewal window opens
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a membership marked do not renew
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            an on_date renewal
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            an effective date in the past
    expected: Each is refused.
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-008
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
      a renewal before the package’s renewal window opens
    category: boundary
    binding_evidence:
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          a renewal before the package’s renewal window opens
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          a membership marked do not renew
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          an on_date renewal
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          an effective date in the past
  - id: ATS-MBR-MEM-009-05
    title: 'Suspended, fenced and pending memberships cannot be bought for'
    level: unit
    proves:
      - BR-CAP-MBR-MEM-009-05
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Prepare for a suspended member, a fenced member, one with a pending
          renewal and one with a pending first term.
        expect: >-
          Refused, then unavailable with fence, renewal_in_progress and
          term_pending.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a suspended membership
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers
            a fenced membership unavailable: fence
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers
            a renewal while one is pending unavailable: renewal_in_progress
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers
            an enrolment while a first term is pending unavailable: term_pending
    expected: >-
      Refused, then unavailable with fence, renewal_in_progress and
      term_pending.
    negative: true
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-008
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
      a suspended membership
    category: edge
    binding_evidence:
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          a suspended membership
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers
          a fenced membership unavailable: fence
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers
          a renewal while one is pending unavailable: renewal_in_progress
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#answers
          an enrolment while a first term is pending unavailable: term_pending
  - id: ATS-MBR-MEM-009-06
    title: Mid-term changes need an amendment; an upgrade at term end is a renewal
    level: unit
    proves:
      - BR-CAP-MBR-MEM-009-06
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Ask for an immediate upgrade, a transfer, a change of chapter, and an
          upgrade at term end.
        expect: >-
          The first three are refused requires_amendment; the last is planned as
          a renewal into the other type.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            an immediate upgrade as requires_amendment, naming prepare_change
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a transfer as requires_amendment
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a change of affiliation as requires_amendment
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#takes
            an upgrade at term end as a renewal into the other type
    expected: >-
      The first three are refused requires_amendment; the last is planned as a
      renewal into the other type.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-008
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
      an immediate upgrade as requires_amendment, naming prepare_change
    category: interaction
    binding_evidence:
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          an immediate upgrade as requires_amendment, naming prepare_change
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          a transfer as requires_amendment
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
          a change of affiliation as requires_amendment
      - suite: TST-MBR-MEM-008
        source: >-
          services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#takes
          an upgrade at term end as a renewal into the other type
  - id: ATS-MBR-MEM-009-07
    title: >-
      The plan names the period, the chapters with their dues products, the
      grants and the claim
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-07
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Prepare a join with a chapter whose dues line is missing, then
          present.
        expect: >-
          Without the dues line the package line is refused; with it the plan
          lists the period, the chapter and its dues product, the grants and one
          claim.
        provenance: proposed
        source: >-
          services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#plans
          a join: kind, service period from the package rule, the dues chapter,
          audience new, a sql claim, no amount
    expected: >-
      Without the dues line the package line is refused; with it the plan lists
      the period, the chapter and its dues product, the grants and one claim.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to: []
    provenance: proposed
    source: >-
      services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#plans
      a join: kind, service period from the package rule, the dues chapter,
      audience new, a sql claim, no amount
    category: rule
    binding_gap: FND-MBR-MEM-103
  - id: ATS-MBR-MEM-009-08
    title: Each line names its price audience and proration
    level: unit
    proves:
      - BR-CAP-MBR-MEM-009-08
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Map enrolment, renewal, reinstatement and rejoin against price lists
          with and without their rows.
        expect: >-
          New, renewing, the package's choice and rejoining, falling back to
          new; first terms prorated on the original price; renewals never.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prices
            an enrolment as new
          - >-
            services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prices
            a renewal as renewing
          - >-
            services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#falls
            back to new when the grid has no row for the operation’s audience
            (D-5: a blank rejoining inherits new)
          - >-
            services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prorates
            a first term by the package’s enrolment proration, on the original
            price, for new members
          - >-
            services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#never
            prorates a renewal: the proration is null, as contracts 0.3.0 says
            "none"
    expected: >-
      New, renewing, the package's choice and rejoining, falling back to new;
      first terms prorated on the original price; renewals never.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-009
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prices
      an enrolment as new
    category: rule
    binding_evidence:
      - suite: TST-MBR-MEM-009
        source: >-
          services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prices
          an enrolment as new
      - suite: TST-MBR-MEM-009
        source: >-
          services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prices
          a renewal as renewing
      - suite: TST-MBR-MEM-009
        source: >-
          services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#falls
          back to new when the grid has no row for the operation’s audience
          (D-5: a blank rejoining inherits new)
      - suite: TST-MBR-MEM-009
        source: >-
          services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#prorates
          a first term by the package’s enrolment proration, on the original
          price, for new members
      - suite: TST-MBR-MEM-009
        source: >-
          services-membership:modules/commerce-participant/tests/unit/pricing-policy.spec.ts#never
          prorates a renewal: the proration is null, as contracts 0.3.0 says
          "none"
  - id: ATS-MBR-MEM-009-09
    title: Each line says through whom it is sold
    level: unit
    proves:
      - BR-CAP-MBR-MEM-009-09
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: >-
          Prepare a package line and dues lines of a chapter with and without
          its own ordering profile.
        expect: >-
          The program's profile for the package; the chapter's own, locked, or
          the program's for its dues.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#names
            the program and its profile for a package line
          - >-
            services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#names
            the chapter’s own profile for its dues, locked
          - >-
            services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#inherits
            the program’s profile for a chapter without one, naming the program
            as where it came from
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#answers
            each item’s selling context: the program’s for the package, the
            chapter’s (inheriting the program’s profile) for its dues
    expected: >-
      The program's profile for the package; the chapter's own, locked, or the
      program's for its dues.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-012
      - TST-MBR-MEM-007
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#names
      the program and its profile for a package line
    category: rule
    binding_evidence:
      - suite: TST-MBR-MEM-012
        source: >-
          services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#names
          the program and its profile for a package line
      - suite: TST-MBR-MEM-012
        source: >-
          services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#names
          the chapter’s own profile for its dues, locked
      - suite: TST-MBR-MEM-012
        source: >-
          services-membership:modules/commerce-participant/tests/unit/selling-context.spec.ts#inherits
          the program’s profile for a chapter without one, naming the program as
          where it came from
      - suite: TST-MBR-MEM-007
        source: >-
          services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#answers
          each item’s selling context: the program’s for the package, the
          chapter’s (inheriting the program’s profile) for its dues
  - id: ATS-MBR-MEM-009-10
    title: >-
      Placement reserves one pending term and only one of two racing checkouts
      wins
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-10
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: Place two orders for the same person's first membership at once.
        expect: >-
          One reserves a pending, unnumbered membership and term; the other is
          refused term_pending.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#claims
            under the capability role: a pending, unnumbered membership with its
            pending term and claim
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#lets
            one of two concurrent checkouts for the same person win and refuses
            the other with term_pending
          - >-
            services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#lets one
            of two concurrent placements claim the person’s term and refuses the
            other term_pending
    expected: >-
      One reserves a pending, unnumbered membership and term; the other is
      refused term_pending.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-007
      - TST-MBR-MEM-241
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#claims
      under the capability role: a pending, unnumbered membership with its
      pending term and claim
    category: concurrency
    binding_evidence:
      - suite: TST-MBR-MEM-007
        source: >-
          services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#claims
          under the capability role: a pending, unnumbered membership with its
          pending term and claim
      - suite: TST-MBR-MEM-007
        source: >-
          services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#lets
          one of two concurrent checkouts for the same person win and refuses
          the other with term_pending
      - suite: TST-MBR-MEM-241
        source: >-
          services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#lets one
          of two concurrent placements claim the person’s term and refuses the
          other term_pending
  - id: ATS-MBR-MEM-009-11
    title: >-
      A reviewed package waits for approval unless the approved application is
      named
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-11
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: Prepare a reviewed package with and without its approved application.
        expect: Without it the line answers requires_approval; with it the line is ok.
        provenance: test
        source:
          - >-
            services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers
            requires_approval for the package the process reviews when no
            decided application is named
          - >-
            services-membership:tests/acceptance/commerce/MBR-ACC-0341.acceptance.ts#MBR-ACC-0341
    expected: Without it the line answers requires_approval; with it the line is ok.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-002
      - TST-MBR-MEM-105
    provenance: test
    source: >-
      services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers
      requires_approval for the package the process reviews when no decided
      application is named
    category: interaction
    binding_evidence:
      - suite: TST-MBR-MEM-002
        source: >-
          services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers
          requires_approval for the package the process reviews when no decided
          application is named
      - suite: TST-MBR-MEM-105
        source: >-
          services-membership:tests/acceptance/commerce/MBR-ACC-0341.acceptance.ts#MBR-ACC-0341
  - id: ATS-MBR-MEM-009-12
    title: Fulfilment commits once per authorization
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-12
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: 'Fulfil a placed join, then deliver the same authorization again.'
        expect: >-
          The term is committed and numbered with its chapter and dues product,
          enrolled; the redelivery answers the same records and writes nothing.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils:
            committed with its authorization, numbered, its chapter written with
            the dues product, enrolled
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#answers
            a redelivered authorization with the same records and writes nothing
            again
          - >-
            services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#answers
            a redelivered authorization after a lost acknowledgement with the
            same records (A17)
    expected: >-
      The term is committed and numbered with its chapter and dues product,
      enrolled; the redelivery answers the same records and writes nothing.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-007
      - TST-MBR-MEM-241
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils:
      committed with its authorization, numbered, its chapter written with the
      dues product, enrolled
    category: transition
    binding_evidence:
      - suite: TST-MBR-MEM-007
        source: >-
          services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils:
          committed with its authorization, numbered, its chapter written with
          the dues product, enrolled
      - suite: TST-MBR-MEM-007
        source: >-
          services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#answers
          a redelivered authorization with the same records and writes nothing
          again
      - suite: TST-MBR-MEM-241
        source: >-
          services-membership:tests/e2e/commerce-purchase.e2e.spec.ts#answers a
          redelivered authorization after a lost acknowledgement with the same
          records (A17)
  - id: ATS-MBR-MEM-009-13
    title: A dues line waits for its package line
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-13
    preconditions: >-
      The well-known FAA workspace fixtures, or a workspace the test builds from
      them.
    steps:
      - do: 'Fulfil the dues line before the package line, then after.'
        expect: >-
          Before, it asks for redelivery; after, its order line is stamped on
          the chapter's affiliation.
        provenance: test
        source:
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#stamps
            the dues line on the affiliation once the package line is fulfilled,
            and asks for a redelivery before
    expected: >-
      Before, it asks for redelivery; after, its order line is stamped on the
      chapter's affiliation.
    negative: false
    data_needs: 'FAA programs, packages, units and members from the integration seed.'
    bound_to:
      - TST-MBR-MEM-007
    provenance: test
    source: >-
      services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#stamps
      the dues line on the affiliation once the package line is fulfilled, and
      asks for a redelivery before
    category: transition
    binding_evidence:
      - suite: TST-MBR-MEM-007
        source: >-
          services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#stamps
          the dues line on the affiliation once the package line is fulfilled,
          and asks for a redelivery before
  - id: ATS-MBR-MEM-009-14
    title: Release a first purchase without deleting earlier membership
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-10
      - BR-CAP-MBR-MEM-010-07
    interacts_with:
      - CAP-MBR-MEM-010
    workflows: []
    relies_on:
      - ATS-MBR-MEM-009-10
      - ATS-MBR-MEM-010-07
    preconditions: One person has a pending first purchase and another has a pending renewal.
    steps:
      - do: >-
          Void each unfulfilled order and inspect its claims, periods and
          holdings.
        expect: >-
          Both reservations release; only the empty holding created for the
          first purchase disappears.
        provenance: proposed
        source: &ref_0
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#claims
            under the capability role: a pending, unnumbered membership with its
            pending term and claim
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#releases
            a voided order: the pending term and the membership the claim
            created are deleted
    expected: >-
      Both reservations release; only the empty holding created for the first
      purchase disappears.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_0
  - id: ATS-MBR-MEM-009-15
    title: Apply the configured review process to checkout
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-11
      - BR-CAP-MBR-MEM-011-01
    interacts_with:
      - CAP-MBR-MEM-011
    workflows:
      - WF-MBR-MEM-011
    relies_on:
      - ATS-MBR-MEM-009-11
      - ATS-MBR-MEM-011-01
    preconditions: An active application process reviews the selected package.
    steps:
      - do: >-
          Prepare checkout before approval, then record a matching approval and
          prepare with its application.
        expect: >-
          The first preparation needs approval; the approved application permits
          preparation of the same offer.
        provenance: proposed
        source: &ref_1
          - >-
            services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers
            requires_approval for the package the process reviews when no
            decided application is named
          - >-
            services-membership:tests/acceptance/commerce/MBR-ACC-0346.acceptance.ts#MBR-ACC-0346
    expected: >-
      The first preparation needs approval; the approved application permits
      preparation of the same offer.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_1
  - id: ATS-MBR-MEM-009-16
    title: Keep an approved purchase pending until fulfilment
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-11
      - BR-CAP-MBR-MEM-012-05
      - BR-CAP-MBR-MEM-012-06
    interacts_with:
      - CAP-MBR-MEM-012
    workflows:
      - WF-MBR-MEM-016
    relies_on:
      - ATS-MBR-MEM-009-11
      - ATS-MBR-MEM-012-05
    preconditions: A typed application selects a package and dues-bearing chapter.
    steps:
      - do: >-
          Deliver approval, inspect the placed purchase, redeliver approval,
          then fulfil the authorization.
        expect: >-
          The decision creates one pending purchase; only fulfilment commits
          coverage, and decision replay creates no second order.
        provenance: proposed
        source: &ref_2
          - >-
            services-membership:modules/applications/tests/integration/decision-handler.integration.spec.ts#answers
            requires_approval for the package the process reviews when no
            decided application is named
          - >-
            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 decision creates one pending purchase; only fulfilment commits
      coverage, and decision replay creates no second order.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_2
  - id: ATS-MBR-MEM-009-17
    title: Reserve renewal coverage through billing order placement
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-05
      - BR-CAP-MBR-MEM-013-08
      - BR-CAP-MBR-MEM-013-09
    interacts_with:
      - CAP-MBR-MEM-013
    workflows: []
    relies_on:
      - ATS-MBR-MEM-009-05
      - ATS-MBR-MEM-013-08
    preconditions: A renewing candidate has a planned billing order action.
    steps:
      - do: >-
          Execute the action through the Commerce test port, then prepare a
          competing renewal.
        expect: >-
          The billing order owns a pending renewal and the competing checkout is
          refused for the pending period.
        provenance: proposed
        source: &ref_3
          - >-
            services-membership:modules/commerce-participant/tests/unit/eligibility.spec.ts#refuses
            a suspended membership
          - >-
            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 billing order owns a pending renewal and the competing checkout is
      refused for the pending period.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_3
  - id: ATS-MBR-MEM-009-18
    title: Resolve expiry attention at purchase fulfilment
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-12
      - BR-CAP-MBR-MEM-014-07
    interacts_with:
      - CAP-MBR-MEM-014
    workflows:
      - WF-MBR-MEM-012
    relies_on:
      - ATS-MBR-MEM-009-12
      - ATS-MBR-MEM-014-07
    preconditions: >-
      Publication is enabled and an expiring member has a placed renewal
      purchase.
    steps:
      - do: >-
          Inspect attention before fulfilment, then fulfil the renewal and
          inspect the committed item.
        expect: >-
          The pending purchase has not committed renewal rights; completed
          renewal resolves the existing item.
        provenance: proposed
        source: &ref_4
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils:
            committed with its authorization, numbered, its chapter written with
            the dues product, enrolled
          - >-
            services-membership:modules/memberships/tests/integration/services/expiring-memberships.integration.spec.ts#resolves
            the item renewed in the staff renewal’s transaction
    expected: >-
      The pending purchase has not committed renewal rights; completed renewal
      resolves the existing item.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_4
  - id: ATS-MBR-MEM-009-19
    title: Prepare officer orders with the member as recipient
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-07
      - BR-CAP-MBR-MEM-016-06
    interacts_with:
      - CAP-MBR-MEM-016
    workflows:
      - WF-MBR-MEM-021
    relies_on:
      - ATS-MBR-MEM-009-07
      - ATS-MBR-MEM-016-06
    preconditions: An officer reaches a member and the selected renewal chapter.
    steps:
      - do: >-
          Request an officer renewal and inspect the prepared and placed
          checkout through the recording Commerce port.
        expect: >-
          The order acts as the officer, names the member as recipient and
          includes the required dues components.
        provenance: proposed
        source: &ref_5
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#plans
            a join: kind, service period from the package rule, the dues
            chapter, audience new, a sql claim, no amount
          - >-
            services-membership:tests/acceptance/security/MBR-ACC-0465.acceptance.ts#MBR-ACC-0465
    expected: >-
      The order acts as the officer, names the member as recipient and includes
      the required dues components.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_5
  - id: ATS-MBR-MEM-009-20
    title: Publish purchase commitment once per authorization
    category: interaction
    level: api
    proves:
      - BR-CAP-MBR-MEM-009-12
      - BR-CAP-MBR-MEM-020-04
    interacts_with:
      - CAP-MBR-MEM-020
    workflows:
      - WF-MBR-MEM-012
    relies_on:
      - ATS-MBR-MEM-009-12
      - ATS-MBR-MEM-020-04
    preconditions: A package purchase is reserved and awaiting fulfilment.
    steps:
      - do: >-
          Fulfil the authorization, redeliver it, and inspect committed period
          events.
        expect: >-
          The same committed records are returned and only one commitment event
          is stored.
        provenance: proposed
        source: &ref_6
          - >-
            services-membership:modules/commerce-participant/tests/integration/participant.integration.spec.ts#fulfils:
            committed with its authorization, numbered, its chapter written with
            the dues product, enrolled
          - >-
            services-membership:modules/memberships/tests/unit/membership-business-events.spec.ts#says
            whether a cancellation removed the membership
    expected: >-
      The same committed records are returned and only one commitment event is
      stored.
    negative: false
    data_needs: >-
      An isolated workspace with the specified membership, package, chapter and
      partner-port fixtures.
    bound_to: []
    provenance: proposed
    source: *ref_6
evidence:
  - >-
    services-membership at 5994c270e8a37a30f848e99ba5b5ee6b87c08893: the
    capability sources and the bound test files.
  - >-
    rhythm-v2-docs:specs/membership/memberships/design/: domain objects, state
    models and workflows reviewed for coverage.
coverage:
  rule: 'gap: FND-MBR-MEM-091'
  transition: 'gap: FND-MBR-MEM-091'
  validation: covered
  permission: 'gap: FND-MBR-MEM-091'
  edge: covered
  failure: 'gap: FND-MBR-MEM-091'
  boundary: covered
  concurrency: covered
  invariant: 'gap: FND-MBR-MEM-091'
  interaction: covered
coverage_notes:
  transition: >-
    The scenarios do not enumerate every applicable object transition; the
    finding preserves the remaining transition matrix.
  permission: >-
    The finding records named permissions without a complete positive and
    negative proof.
  invariant: >-
    Existing invariant examples do not cover every applicable domain-object
    constraint.
  interaction: >-
    Every related capability and each cross-capability workflow has an explicit
    composite scenario. Unbound composites remain proposed.
---

# Sell membership through the Commerce checkout: Capability Test Specification

## Coverage

| Rule | Scenario or Finding |
|---|---|
| `BR-CAP-MBR-MEM-009-01` | `ATS-MBR-MEM-009-01` |
| `BR-CAP-MBR-MEM-009-02` | `ATS-MBR-MEM-009-02` |
| `BR-CAP-MBR-MEM-009-03` | `ATS-MBR-MEM-009-03` |
| `BR-CAP-MBR-MEM-009-04` | `ATS-MBR-MEM-009-04` |
| `BR-CAP-MBR-MEM-009-05` | `ATS-MBR-MEM-009-05`, `ATS-MBR-MEM-009-17` |
| `BR-CAP-MBR-MEM-009-06` | `ATS-MBR-MEM-009-06` |
| `BR-CAP-MBR-MEM-009-07` | `ATS-MBR-MEM-009-07`, `ATS-MBR-MEM-009-19` |
| `BR-CAP-MBR-MEM-009-08` | `ATS-MBR-MEM-009-08` |
| `BR-CAP-MBR-MEM-009-09` | `ATS-MBR-MEM-009-09` |
| `BR-CAP-MBR-MEM-009-10` | `ATS-MBR-MEM-009-10`, `ATS-MBR-MEM-009-14` |
| `BR-CAP-MBR-MEM-009-11` | `ATS-MBR-MEM-009-11`, `ATS-MBR-MEM-009-15`, `ATS-MBR-MEM-009-16` |
| `BR-CAP-MBR-MEM-009-12` | `ATS-MBR-MEM-009-12`, `ATS-MBR-MEM-009-18`, `ATS-MBR-MEM-009-20` |
| `BR-CAP-MBR-MEM-009-13` | `ATS-MBR-MEM-009-13` |
| `BR-CAP-MBR-MEM-009-14` | no scenario: `FND-MBR-MEM-030` |
| `BR-CAP-MBR-MEM-009-15` | no scenario: `FND-MBR-MEM-031` |

## Interactions With Related Capabilities

The interaction cases test how a shared holding, period, chapter connection or recorded change affects related work. Each case names its related capabilities and workflows in frontmatter. A composite case remains proposed until executable assertions establish every part of its expected outcome.
