Skip to content

ATS-ACC-PRD-002Create a product with a permanent identity: Capability Test Specification

Markdown

ATS-ACC-PRD-002

Create a product with a permanent identity: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaAccountingModuleProductsRevision3

Read atservices-accounting f47cb263react-console baf6dae3

Coverage

  • Rule gap: FND-ACC-PRD-051
  • Transition covered
  • Validation covered
  • Permission covered
  • Edge covered
  • Failure covered
  • Boundary covered
  • Concurrency gap: FND-ACC-PRD-051
  • Invariant covered
  • Interaction covered

Test Scenarios

15 scenarios proving CAP-ACC-PRD-002; 13 bound to an existing test.

01 Creation validates readable identitiesvalidationunitnegativetest
Proves
BR-CAP-ACC-PRD-002-01
Preconditions
An existing unit can own a new product.
Steps
Try invalid punctuation, a reserved identity, a leading digit, excess length and a valid identity.
Expected
Invalid identities fail without writes and the valid identity succeeds.
Data
An existing unit can own a new product.
Bound to
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses an id that is not a configuration id, with the configuration-id sentence, and writes nothing
services-accounting:modules/products/tests/e2e/products.e2e.spec.js#answers 400 naming id for an id that is not a configuration id
Source
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses an id that is not a configuration id, with the configuration-id sentence, and writes nothing
02 Name-derived collisions need an explicit choiceedgeunitnegativetest
Proves
BR-CAP-ACC-PRD-002-02
Preconditions
A product already owns the identity derived from Gala Ticket.
Steps
Create another without an identity, then with a distinct identity, and try a numeric-only name.
Expected
The collision and unconvertible name fail; an explicit distinct identity succeeds.
Data
A product already owns the identity derived from Gala Ticket.
Bound to
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a second product whose name suggests a taken id, as other configuration does, naming the id
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#creates the second product of that name once the client names an id of its own
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#generates the id from the name when the client gives none, as every configuration id is
Source
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a second product whose name suggests a taken id, as other configuration does, naming the id
03 Identity uniqueness spans kindsinvariantapinegativetest
Proves
BR-CAP-ACC-PRD-002-03 INV-DOM-ACC-PRD-001-01
Preconditions
A donation has identity gala.
Steps
Create a different kind using gala.
Expected
The second create fails and only the original remains.
Data
A donation has identity gala.
Bound to
services-accounting:modules/products/tests/e2e/products.e2e.spec.js#answers 400 to the same id under another type: a product id is unique across every type
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses the same id under another type: a product id is unique across every type
services-accounting:modules/products/tests/integration/db/products.table.integration.spec.js#refuses a second product under the same id, of another type: the id is unique across every type
Source
services-accounting:modules/products/tests/e2e/products.e2e.spec.js#answers 400 to the same id under another type: a product id is unique across every type
04 Creation checks kind, unit and namevalidationapinegativetest
Proves
BR-CAP-ACC-PRD-002-04
Preconditions
The register and one unit are available.
Steps
Try an unknown kind, inactive kind, foreign workspace unit and blank name.
Expected
Each invalid creation fails and persists nothing.
Data
The register and one unit are available.
Bound to
services-accounting:modules/products/tests/e2e/products-shared-base.e2e.spec.js#refuses a type registered inactive (an Events type), 400 with its sentence
Source
services-accounting:modules/products/tests/e2e/products-shared-base.e2e.spec.js#refuses a type registered inactive (an Events type), 400 with its sentence
05 Stored pricing follows the kindinvariantunitnegativetest
Proves
BR-CAP-ACC-PRD-002-05 INV-DOM-ACC-PRD-001-04
Preconditions
A unit is available for product creation.
Steps
Create a donation and attempt a direct row write with a mismatched model.
Expected
The donation has variable pricing and the inconsistent database row fails.
Data
A unit is available for product creation.
Bound to
services-accounting:modules/products/tests/e2e/products.e2e.spec.js#creates a Donation Product with no prices and the variable pricing model
Source
services-accounting:modules/products/tests/integration/db/products.table.integration.spec.js#refuses a pricing model other than its type’s
06 Direct writes cannot move a productinvariantunitnegativetest
Proves
BR-CAP-ACC-PRD-002-06 INV-DOM-ACC-PRD-001-03
Preconditions
An existing product has fixed identity, kind and unit.
Steps
Attempt direct database changes to those three properties.
Expected
The write-once protection rejects each change.
Data
An existing product has fixed identity, kind and unit.
Bound to
Source
services-accounting:modules/products/tests/integration/db/products.table.integration.spec.js#refuses a change of business_unit_id (RHF01)
07 Availability boundaries must increaseboundaryunitnegativetest
Proves
BR-CAP-ACC-PRD-002-08
Preconditions
An existing unit can own the product.
Steps
Try windows ending before or at their opening instant.
Expected
Both requests fail validation.
Data
An existing unit can own the product.
Bound to
Source
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a sale window that ends before it starts
08 Fees reject negative moneyvalidationunitnegativetest
Proves
BR-CAP-ACC-PRD-002-09
Preconditions
An existing unit can own the product.
Steps
Write negative cancellation and restocking amounts separately.
Expected
Both writes fail.
Data
An existing unit can own the product.
Bound to
Source
services-accounting:modules/products/tests/integration/db/products.table.integration.spec.js#refuses a negative cancellation fee
09 Kinds constrain selling configurationvalidationunitnegativetest
Proves
BR-CAP-ACC-PRD-002-10 INV-DOM-ACC-PRD-001-12
Preconditions
A unit and CRM task type support feature fixtures.
Steps
Try each fee and feature on Legacy Products, then discounts, bundles and other features on donations.
Expected
Legacy feature writes fail; donations reject discounts and components while permitting their other supported settings.
Data
A unit and CRM task type support feature fixtures.
Bound to
Source
services-accounting:modules/products/tests/integration/services/persistence/products.features.integration.spec.js#refuses a cancellation fee on a Legacy Product
10 Creation refusal leaves no owned rowsfailureunitnegativetest
Proves
BR-CAP-ACC-PRD-002-11
Preconditions
An existing unit can own the product.
Steps
Submit a create with an invalid second price.
Expected
No product, price or component survives.
Data
An existing unit can own the product.
Bound to
Source
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#leaves nothing behind after a refusal
11 Older identities permit reads and referencesedgeunitnegativetest
Proves
BR-CAP-ACC-PRD-002-12
Preconditions
An older product retains its generated identity.
Steps
Read it, reference it from a new bundle and attempt replacement.
Expected
Reading and bundling succeed, but replacement fails without changes.
Data
An older product retains its generated identity.
Bound to
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a replacement, 409, saying why, and leaves the product unchanged
Source
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a replacement, 409, saying why, and leaves the product unchanged
12 Custom field values are absentvalidationapinegativetest
Proves
BR-CAP-ACC-PRD-002-13 INV-DOM-ACC-PRD-001-14
Preconditions
A unit supports a product fixture.
Steps
Create with custom field values and read an ordinary product.
Expected
Creation rejects the unsupported property and reads contain no such values.
Data
A unit supports a product fixture.
Bound to
services-accounting:modules/products/tests/e2e/products-shared-base.e2e.spec.js#refuses a body that names custom fields, 400 naming the property
Source
services-accounting:modules/products/tests/e2e/products-shared-base.e2e.spec.js#refuses a body that names custom fields, 400 naming the property
13 Product creation needs create authoritypermissionapinegativetest
Proves
BR-CAP-ACC-PRD-002-14
Preconditions
Read-only, product-manager and accounting-only identities are available.
Steps
Attempt product creation under each identity.
Expected
Only the product manager succeeds.
Data
Read-only, product-manager and accounting-only identities are available.
Bound to
Source
services-accounting:modules/products/tests/e2e/products-security.e2e.spec.js#is refused creating a product
14 Creation chooses the initial availability statetransitionapinegativeproposed
Proves
BR-CAP-ACC-PRD-002-07
Preconditions
Valid fixed-priced products use distinct identities.
Steps
Create one without status, one inactive, and one requesting retirement.
Expected
The first two reads show their requested initial states; retirement input is refused.
Data
Valid fixed-priced products use distinct identities.
Source
services-accounting:modules/products/aws/api/products.schemas.ts:productShape
15 Invalid pricing or bundling prevents a complete product replacementinteractionapinegativeproposed
Proves
BR-CAP-ACC-PRD-002-11 BR-CAP-ACC-PRD-004-06 BR-CAP-ACC-PRD-008-01 BR-CAP-ACC-PRD-011-02
Preconditions
A valid product has a standard price and same-unit sellable component.
Steps
Create it with both collections, then replace it with an invalid price and with a foreign-unit component.
Expected
The valid creation reads back as one aggregate; neither refused replacement changes it.
Data
A valid product has a standard price and same-unit sellable component.
Source
services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#leaves nothing behind after a refusal; services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#leaves the old prices and components when a rule refuses the replacement; services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses an Accounting Product without a standard price in the base currency; services-accounting:modules/products/tests/integration/services/persistence/products.integration.spec.js#refuses a component of another business unit, naming both units

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.