Skip to content

ATS-COM-FUL-006Handle financial reversals after delivery: Capability Test Specification

Markdown

ATS-COM-FUL-006

Handle financial reversals after delivery: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCommerceModuleFulfillment, Shipping and InventoryRevision2

Read atservices-commerce c8b66a98react-console baf6dae3

Coverage

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

Test Scenarios

6 scenarios proving CAP-COM-FUL-006; 6 bound to an existing test.

01 Frozen reversal settings select distinct responsesruleapitest
Proves
BR-CAP-COM-FUL-006-01 BR-CAP-COM-FUL-006-02 BR-CAP-COM-FUL-006-03 BR-CAP-COM-FUL-006-04
Preconditions
Delivered fixtures use review, notify, suspend, cancellation and none, alongside pending work.
Steps
Apply one reversal affecting all fixtures.
Expected
Three enforcement instructions are queued, required reviews are raised and none or pending work is untouched.
Data
Fixtures for frozen reversal settings select distinct responses.
Bound to
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#creates four enforcements: three dispatched (suspend, cancel_line, notify), one for a person (review); the none policy and the pending obligation get nothing
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#writes the suspend enforcement dispatched, with its enforce obligation authorized, queued and nudged, keyed on the fact
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#leaves the review enforcement pending with an enforcement_review exception and no obligation, and the cancel_line one dispatched with a review for the request
services-commerce:modules/fulfillment/tests/e2e/enforcement.e2e.spec.js#suspends the membership in the participant with the enforcement id stored, the original obligation still completed, the enforcement completed
Source
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#creates four enforcements: three dispatched (suspend, cancel_line, notify), one for a person (review); the none policy and the pending obligation get nothing
02 An unexplained reversal creates one order findingedgeapitest
Proves
BR-CAP-COM-FUL-006-06
Preconditions
A delivered order has no cancellation document.
Steps
Apply its financial reversal.
Expected
The order receives a single informational refund-without-cancellation exception.
Data
Fixtures for an unexplained reversal creates one order finding.
Bound to
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#raises refund_without_cancellation once per delivered order, and the enforcement_created line on each history
Source
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#raises refund_without_cancellation once per delivered order, and the enforcement_created line on each history
03 Replayed reversal events do not repeat enforcementinvariantapitest
Proves
BR-CAP-COM-FUL-006-07 INV-DOM-COM-FUL-001-10
Preconditions
The reversal has already been applied.
Steps
Replay the already applied financial event.
Expected
No additional enforcement, instruction or exception is created.
Data
Fixtures for replayed reversal events do not repeat enforcement.
Bound to
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#creates nothing when the same fact is enforced again (idempotent on the event id)
services-commerce:modules/fulfillment/tests/e2e/enforcement.e2e.spec.js#enforces nothing twice when the batch is redelivered
services-commerce:modules/fulfillment/tests/integration/db/register-tables.table.integration.spec.js#hold an enforcement once per obligation and cause (enforcements_cause_uq) and an adjustment once per document (financial_adjustments_document_uq)
Source
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#creates nothing when the same fact is enforced again (idempotent on the event id)
04 Restoration follows application supporttransitionapitest
Proves
BR-CAP-COM-FUL-006-08 BR-CAP-COM-FUL-006-09
Preconditions
Enforced deliveries include products with and without restoration support.
Steps
Apply restored-funds events and replay them.
Expected
Supported restorations dispatch once, unsupported work remains with staff and states follow the defined lifecycle.
Data
Fixtures for restoration follows application support.
Bound to
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#dispatches a restore for the suspended and the notified deliveries (the unlimited product declares one) and leaves the capacity product’s with staff
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#restores the suspended delivery through the participant and closes the suspension as restored
services-commerce:modules/fulfillment/tests/integration/services/persistence/enforcements.queries.integration.spec.js#moves an enforcement along its lifecycle (pending -> dispatched -> completed -> restored) and refuses a move it does not allow
Source
services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#dispatches a restore for the suspended and the notified deliveries (the unlimited product declares one) and leaves the capacity product’s with staff
05 Review resolution requires authority and cannot repeatpermissionapinegativetest
Proves
BR-CAP-COM-FUL-006-10
Preconditions
An enforcement awaits review.
Steps
Resolve using reader authority, administrator authority and then the administrator again.
Expected
Only the first authorized resolution succeeds and closes the review finding.
Data
Fixtures for review resolution requires authority and cannot repeat.
Bound to
services-commerce:modules/fulfillment/tests/e2e/enforcement.e2e.spec.js#resolves the seat’s review on its route with the reason and the resolution, refusing a reader and a repeat
services-commerce:modules/operations/tests/integration/services/interventions/operations-interventions.integration.spec.js#resolves the reviewed enforcement with its review exception, naming who; a resolved one is refused
Source
services-commerce:modules/fulfillment/tests/e2e/enforcement.e2e.spec.js#resolves the seat’s review on its route with the reason and the resolution, refusing a reader and a repeat
06 Reversal enforcement completes beside the original delivery and remains reviewableinteractionapitest
Proves
BR-CAP-COM-FUL-004-04 BR-CAP-COM-FUL-006-02 BR-CAP-COM-FUL-006-03 BR-CAP-COM-FUL-008-01
Preconditions
A delivered membership uses suspension on reversal and a delivered seat uses staff review.
Steps
Reverse their payments, dispatch the acting instruction, and inspect the review queue.
Expected
The membership is suspended beside its unchanged delivery result; the seat remains a staff review.
Data
An isolated workspace with the products, records, authority and quantities described in the preconditions.
Bound to
services-commerce:modules/fulfillment/tests/e2e/enforcement.e2e.spec.js#suspends the membership in the participant with the enforcement id stored, the original obligation still completed, the enforcement completed
Source
services-commerce:modules/fulfillment/tests/e2e/obligation-register.e2e.spec.js#completes the obligation and answers it as it stands; the repeat answers the same,services-commerce:modules/fulfillment/tests/integration/services/enforcement/enforcement-handler.integration.spec.js#creates four enforcements: three dispatched (suspend, cancel_line, notify), one for a person (review); the none policy and the pending obligation get nothing,services-commerce:modules/operations/tests/e2e/operations.e2e.spec.js#lists the finding the reconciler raised about the unbilled order, filtered by kind, state and order, and never another tenant’s

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.