Skip to content

ATS-COM-CAT-011Maintain dated pricing periods: Capability Test Specification

Markdown

ATS-COM-CAT-011

Maintain dated pricing periods: Capability Test Specification

Markdown
  • DocumentProposed
  • Product intentProposed

KindAcceptance test setProduct areaCommerceModuleCatalog and Selling ConfigurationRevision2

Read atservices-commerce c8b66a98react-console baf6dae3

Coverage

  • Rule gap: FND-COM-CAT-065
  • Transition covered
  • Validation covered
  • Permission covered
  • Edge gap: FND-COM-CAT-065
  • Failure gap: FND-COM-CAT-065
  • Boundary covered
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

15 scenarios proving CAP-COM-CAT-011; 8 bound to an existing test.

01 Implemented schedules reject ownership fieldsvalidationapinegativetest
Proves
BR-CAP-COM-CAT-011-01 INV-DOM-COM-CAT-004-07
Preconditions
A schedule creation payload is otherwise valid
Steps
Supply an event owner
Expected
Schema validation refuses the owner
Data
none
Bound to
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
02 Period boundaries are exclusive at the end and gap-freeboundaryapinegativetest
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
Data
none
Bound to
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
03 Historical period changes are refusedinvariantapinegativetest
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
Data
A recorded first sale
Bound to
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
04 Current-end edits coordinate the next periodtransitionapinegativetest
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
Data
A recorded first sale
Bound to
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
05 Period identity cannot cross schedulesvalidationapinegativetest
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
Data
none
Bound to
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
06 Referenced schedules remain usable until products movetransitionapinegativetest
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
Data
Purchasing settings
Bound to
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
07 Schedule replacement reconciles periods at the read versionconcurrencyapinegativetest
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
Data
none
Bound to
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
08 Schedule inspection requires no write permissionpermissionapinegativetest
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
Data
Read-exclusively persona
Bound to
Source
services-commerce:modules/pricing/tests/e2e/pricing-configuration-security.e2e.spec.js#lists and reads the audiences and the schedules
09 Schedule protection refuses the protected writeinvariantapinegativeproposed
Proves
BR-CAP-COM-CAT-011-11
Preconditions
Separate otherwise editable records use full protection and deletion-only protection.
Steps
Replace and delete the fully protected record, then replace and delete the deletion-only protected record; reread both.
Expected
The full-protection requests refuse; the deletion-only replacement succeeds and removal refuses; refused writes preserve the stored record.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/pricing/services/persistence/pricing-schedules.ts
10 A product reference retains its selected scheduleinteractionapiproposed
Proves
BR-CAP-COM-CAT-011-07 BR-CAP-COM-CAT-012-04
Preconditions
A product follows Annual and another schedule is inactive.
Steps
Attempt to disable Annual and select the inactive schedule; move the product to a valid alternative and disable Annual.
Expected
Referenced and inactive choices refuse; the unreferenced schedule can be disabled.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.integration.spec.js#refuses with schedule_in_use, the count in the sentence, and the count and the first five product ids in the details,services-commerce:modules/pricing/tests/e2e/product-purchasing-settings.e2e.spec.js#refuses an unknown organization role id with 400 naming it, and stores nothing (COM-ACC-0799)
11 A moved boundary changes the next quote without rewriting an earlier saleinteractionapiproposed
Proves
BR-CAP-COM-CAT-011-02 BR-CAP-COM-CAT-011-05 BR-CAP-COM-CAT-013-03 BR-CAP-COM-CAT-013-14
Preconditions
Early Bird has a placed sale and Regular starts at its end.
Steps
Read the sale, extend Early Bird with Regular’s start moved together, quote on both sides of the new boundary and reread the sale.
Expected
New quotes select the period at their instant; the earlier amount and first-sale stamp stay unchanged.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
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,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/unit/engine/step-3-base-price.spec.js#inherits the audience’s always cell when the period has none, never another period’s cell,services-commerce:modules/pricing/tests/integration/services/placement/audience-settlement.integration.spec.js#refuses the placement for a lapsed member, one audience_lapsed problem per line with the portal sentence, stamping nothing
12 Pricing period is exercised across every declared movetransitionapinegativeproposed
Proves
BR-CAP-COM-CAT-011-02 BR-CAP-COM-CAT-011-03 BR-CAP-COM-CAT-011-04 BR-CAP-COM-CAT-011-05 BR-CAP-COM-CAT-011-07 BR-CAP-COM-CAT-011-08
Preconditions
Independent run-owned records start in each declared origin state; guarded variants omit one required condition at a time.
Steps
For each transition case, establish the origin, apply its trigger with the guard satisfied, read the resulting state and side effects, then repeat on a separate record with a required guard absent.
Expected
Every allowed case reaches its stated destination and retains its declared side effects; failed guards preserve the originating record except for the separately documented partial offer action.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
rhythm-v2-docs:specs/commerce/catalog/design/state-models/STATE-COM-CAT-005-pricing-period.md#STATE-COM-CAT-005,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/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,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/db/pricing-periods.table.ts,services-commerce:modules/pricing/db/pricing-periods.table.ts,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/db/pricing-periods.table.ts
13 Invalid open intervals refuse at commitinvariantapinegativeproposed
Proves
INV-DOM-COM-CAT-004-04 BR-CAP-COM-CAT-011-03
Preconditions
A three-period schedule has contiguous boundaries.
Steps
Commit an overlap, a second open end and an open start on a later period in separate transactions.
Expected
Each commit refuses its invalid interval layout and the prior schedule remains unchanged.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/pricing/tests/integration/db/member-pricing-tables.table.integration.spec.js#refuses an overlap, a second open end and an open start that is not first,rhythm-v2-docs:specs/commerce/catalog/design/objects/DOM-COM-CAT-004-price.md#DOM-COM-CAT-004
14 Moving a sold-in current end preserves the first saleinvariantapinegativeproposed
Proves
INV-DOM-COM-CAT-004-05
Preconditions
Early Bird is current and has a first-sale stamp; Regular follows it.
Steps
Move Early Bird’s end one week later with Regular’s start matching it; then attempt to rename the used period, change its start or rewrite the first-sale stamp.
Expected
The coordinated end move commits and the protected name, start and first-sale changes refuse.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/pricing/tests/integration/db/member-pricing-tables.table.integration.spec.js#lets a sold-in current period end a week later, the next period starting where it ends,rhythm-v2-docs:specs/commerce/catalog/design/objects/DOM-COM-CAT-004-price.md#DOM-COM-CAT-004
15 A referenced schedule stays selectable until the product movesinvariantapinegativeproposed
Proves
INV-DOM-COM-CAT-004-06 BR-CAP-COM-CAT-011-07
Preconditions
Six products retain Annual and another schedule is inactive.
Steps
Attempt to disable and remove Annual, inspect the retaining count and first five products, then attempt to select the inactive schedule.
Expected
References prevent disabling or removal and the inactive selection refuses without changing the product’s settings.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/pricing/tests/integration/services/persistence/pricing-schedules.integration.spec.js#refuses with schedule_in_use, the count in the sentence, and the count and the first five product ids in the details,rhythm-v2-docs:specs/commerce/catalog/design/objects/DOM-COM-CAT-004-price.md#DOM-COM-CAT-004

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.