Skip to content

ATS-COM-FUL-006Handle financial reversals after delivery: Acceptance Test Set

Markdown

ATS-COM-FUL-006

Handle financial reversals after delivery: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-FUL-006

KindAcceptance test setProduct areaCommerceModuleFulfillment, Shipping and InventoryRevision1

Read atservices-commerce c8b66a98

Test Scenarios

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

01 Frozen reversal settings select distinct responsesapitest
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 findingapitest
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 enforcementapitest
Proves
BR-CAP-COM-FUL-006-07
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 supportapitest
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 repeatapinegativetest
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

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.