---
id: ATS-COM-CAT-011
scope: CAP-COM-CAT-011
product_area: commerce
module: catalog
revision: 1
status: proposed
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-COM-CAT-011-01
    title: Implemented schedules reject ownership fields
    level: api
    proves:
      - BR-CAP-COM-CAT-011-01
    preconditions: A schedule creation payload is otherwise valid
    steps: Supply an event owner
    expected: Schema validation refuses the owner
    negative: true
    data_needs: none
    bound_to:
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#answers
        400 to an event owner (a schedule has none, COMM-M1 D2), to a property
        outside the contract and to a tenant_id other than the path’s
      - >-
        services-commerce:modules/pricing/tests/integration/db/member-pricing-tables.table.integration.spec.js#holds
        no owner column (COMM-M1 D2), and refuses a blank zone, which the
        text-normalization trigger makes null, by the NOT NULL
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#answers
      400 to an event owner (a schedule has none, COMM-M1 D2), to a property
      outside the contract and to a tenant_id other than the path’s
  - id: ATS-COM-CAT-011-02
    title: Period boundaries are exclusive at the end and gap-free
    level: api
    proves:
      - BR-CAP-COM-CAT-011-02
      - BR-CAP-COM-CAT-011-03
    preconditions: Adjacent periods share a boundary
    steps: Resolve that instant and submit one-millisecond gaps and overlaps
    expected: The later period owns the instant and invalid adjacency fails
    negative: true
    data_needs: none
    bound_to:
      - >-
        services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.queries.integration.spec.js#finds
        the period containing an instant: the open start, a boundary belonging
        to the period it starts, the open end
      - >-
        services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.integration.spec.js#accepts
        periods whose boundary is the same millisecond, and refuses a gap or an
        overlap of one millisecond
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#answers
        400 with the problem code periods_not_contiguous to periods with a gap,
        creating nothing
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.queries.integration.spec.js#finds
      the period containing an instant: the open start, a boundary belonging to
      the period it starts, the open end
  - id: ATS-COM-CAT-011-03
    title: Historical period changes are refused
    level: api
    proves:
      - BR-CAP-COM-CAT-011-04
    preconditions: An elapsed period and a used period exist
    steps: Rename them and delete the used period or its schedule
    expected: Immutability refusals preserve their history
    negative: true
    data_needs: A recorded first sale
    bound_to:
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#accepts
        an elapsed period sent back as read, and refuses it a new name, 409
        period_immutable
      - >-
        services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.integration.spec.js#refuses
        the sold-in period left out (its delete), and the whole schedule’s
        delete, 409 period_immutable
      - >-
        services-commerce:modules/pricing/tests/integration/db/member-pricing-tables.table.integration.spec.js#records
        the first sale once, never cleared or moved, after which the period
        keeps its name and is never deleted, nor its schedule
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#accepts
      an elapsed period sent back as read, and refuses it a new name, 409
      period_immutable
  - id: ATS-COM-CAT-011-04
    title: Current-end edits coordinate the next period
    level: api
    proves:
      - BR-CAP-COM-CAT-011-05
      - AS-JNY-COM-CAT-002-03
    preconditions: Early Bird is current and already used
    steps: 'Extend its end, end it now, backdate the end and change its start'
    expected: >-
      Permitted end edits move Regular’s start; backdating and start changes
      fail
    negative: true
    data_needs: A recorded first sale
    bound_to:
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#extends
        the sold-in Early Bird by a week, Regular starting where it now ends,
        its first sale untouched
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#ends
        Early Bird now, Regular starting then, and locks it fully once the end
        has passed
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#refuses
        an end in the past, 409 period_immutable, the periods as they were
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#refuses
        a sold-in period a new start, a new name, or both beside a moved end,
        409 period_immutable
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#extends
      the sold-in Early Bird by a week, Regular starting where it now ends, its
      first sale untouched
  - id: ATS-COM-CAT-011-05
    title: Period identity cannot cross schedules
    level: api
    proves:
      - BR-CAP-COM-CAT-011-06
    preconditions: Schedule A already owns an Early Bird period
    steps: Create schedule B reusing that identity
    expected: The refusal identifies the occupied period
    negative: true
    data_needs: none
    bound_to:
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#answers
        400 with the problem code period_id_taken, naming the id, to a second
        schedule taking a period id, creating nothing
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#answers
      400 with the problem code period_id_taken, naming the id, to a second
      schedule taking a period id, creating nothing
  - id: ATS-COM-CAT-011-06
    title: Referenced schedules remain usable until products move
    level: api
    proves:
      - BR-CAP-COM-CAT-011-07
    preconditions: A product follows Annual and another schedule is inactive
    steps: >-
      Deactivate or delete Annual and select the inactive schedule, then move
      the product away
    expected: Referenced and inactive choices fail; unreferenced deactivation succeeds
    negative: true
    data_needs: Purchasing settings
    bound_to:
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#refuses
        switching a schedule off while products follow it, 409 schedule_in_use
        with the count and product ids, until they move; reactivation works;
        another workspace’s products do not count
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#refuses
        the delete of a schedule a product follows, 409 schedule_in_use, and
        deletes it with its periods once nothing does
      - >-
        services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.integration.spec.js#refuses
        a product choosing a switched-off schedule, 400 schedule_inactive, and
        leaves its settings as they were
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/e2e/pricing-schedules.e2e.spec.js#refuses
      switching a schedule off while products follow it, 409 schedule_in_use
      with the count and product ids, until they move; reactivation works;
      another workspace’s products do not count
  - id: ATS-COM-CAT-011-07
    title: Schedule replacement reconciles periods at the read version
    level: api
    proves:
      - BR-CAP-COM-CAT-011-08
    preconditions: Three periods exist in a schedule
    steps: 'Keep, change, add and omit periods, then repeat from an old version'
    expected: Allowed reconciliation succeeds and the stale request fails
    negative: true
    data_needs: none
    bound_to:
      - >-
        services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.integration.spec.js#answers
        the replaced record at version 2: the kept period at version 1, the
        changed one at version 2, the new one inserted, the one left out gone
      - >-
        services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.integration.spec.js#refuses
        a stale version, 409, and a schedule the tenant does not have, 404
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.integration.spec.js#answers
      the replaced record at version 2: the kept period at version 1, the
      changed one at version 2, the new one inserted, the one left out gone
  - id: ATS-COM-CAT-011-08
    title: Schedule inspection requires no write permission
    level: api
    proves:
      - BR-CAP-COM-CAT-011-10
    preconditions: A schedule reader has no administrator grants
    steps: Read schedules and attempt changes
    expected: Reads succeed and writes fail permission checks
    negative: true
    data_needs: Read-exclusively persona
    bound_to:
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-configuration-security.e2e.spec.js#lists
        and reads the audiences and the schedules
      - >-
        services-commerce:modules/pricing/tests/e2e/pricing-configuration-security.e2e.spec.js#is
        refused the creates, replacements and deletes, 403 permission_missing,
        each leaving the record as it was
    provenance: test
    source: >-
      services-commerce:modules/pricing/tests/e2e/pricing-configuration-security.e2e.spec.js#lists
      and reads the audiences and the schedules
evidence:
  - 'Pinned service inputs: test sources in scenario bindings'
  - 'Pinned console inputs: console sources in scenario bindings'
---

# Maintain dated pricing periods: Acceptance Test Set

## Coverage

| Rule | Proof Scenario or Gap |
|---|---|
| `BR-CAP-COM-CAT-011-01` | `ATS-COM-CAT-011-01` |
| `BR-CAP-COM-CAT-011-02` | `ATS-COM-CAT-011-02` |
| `BR-CAP-COM-CAT-011-03` | `ATS-COM-CAT-011-02` |
| `BR-CAP-COM-CAT-011-04` | `ATS-COM-CAT-011-03` |
| `BR-CAP-COM-CAT-011-05` | `ATS-COM-CAT-011-04` |
| `BR-CAP-COM-CAT-011-06` | `ATS-COM-CAT-011-05` |
| `BR-CAP-COM-CAT-011-07` | `ATS-COM-CAT-011-06` |
| `BR-CAP-COM-CAT-011-08` | `ATS-COM-CAT-011-07` |
| `BR-CAP-COM-CAT-011-10` | `ATS-COM-CAT-011-08` |
| `BR-CAP-COM-CAT-011-11` | no scenario: `FND-COM-CAT-026` |
