Skip to content

ATS-COM-CAT-011Maintain dated pricing periods: Acceptance Test Set

Markdown

ATS-COM-CAT-011

Maintain dated pricing periods: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-CAT-011

KindAcceptance test setProduct areaCommerceModuleCatalog and Selling ConfigurationRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

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

01 Implemented schedules reject ownership fieldsapinegativetest
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
Data
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
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-freeapinegativetest
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
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
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 refusedapinegativetest
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
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
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 periodapinegativetest
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
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
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 schedulesapinegativetest
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
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
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 moveapinegativetest
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
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
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 versionapinegativetest
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
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
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 permissionapinegativetest
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
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
Source
services-commerce:modules/pricing/tests/e2e/pricing-configuration-security.e2e.spec.js#lists and reads the audiences and the schedules

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.