Skip to content

ATS-COM-FUL-007Complete the financial work requested by a post-sale document: Acceptance Test Set

Markdown

ATS-COM-FUL-007

Complete the financial work requested by a post-sale document: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-FUL-007

KindAcceptance test setProduct areaCommerceModuleFulfillment, Shipping and InventoryRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

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

01 Repeated document requests share one adjustmentapitest
Proves
BR-CAP-COM-FUL-007-01
Preconditions
A cancellation document needs financial execution.
Steps
Ask twice for financial execution of the same cancellation.
Expected
Both requests identify the same adjustment and pending plan.
Data
Fixtures for repeated document requests share one adjustment.
Bound to
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#creates the adjustment once (the second request answers the first) with its steps pending
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/adjustments/adjustment-worker.integration.spec.js#creates the adjustment once (the second request answers the first) with its steps pending
02 Planning preserves financial-step orderunittest
Proves
BR-CAP-COM-FUL-007-02 BR-CAP-COM-FUL-007-03
Preconditions
Documents vary payment, fees and amendment replacement invoices.
Steps
Build the adjustment plan for each fixture.
Expected
Steps retain their fixed order and keys, unpaid work uses only the memo and amendments apply freed funds to the replacement invoice first.
Data
Fixtures for planning preserves financial-step order.
Bound to
services-commerce:modules/fulfillment/tests/unit/adjustments/adjustment-planning.spec.js#plans the memo, the fee, the credit from the freed money, its application to the fee and the refund of the remainder, in that order, each under its key
services-commerce:modules/fulfillment/tests/unit/adjustments/adjustment-planning.spec.js#plans the memo alone for a line never paid, the fee invoice beside it when the terms charge one, and nothing without an invoice
services-commerce:modules/fulfillment/tests/unit/adjustments/adjustment-planning.spec.js#applies the freed money to an amendment’s new invoice before the remainder (11 §7.1, P7): a credit and its application by invoice id, then the credit of what is left
services-commerce:modules/fulfillment/tests/unit/adjustments/adjustment-planning.spec.js#spells every key commerce:{document_kind}:{document_id}:{step}
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#plans the five steps of 04 §6 in order with their keys: the memo, the fee, the credit from the freed money, its application, the refund of the remainder
Source
services-commerce:modules/fulfillment/tests/unit/adjustments/adjustment-planning.spec.js#plans the memo, the fee, the credit from the freed money, its application to the fee and the refund of the remainder, in that order, each under its key
03 Interrupted financial commands retain their retry keysapitest
Proves
BR-CAP-COM-FUL-007-04 BR-CAP-COM-FUL-007-05
Preconditions
An adjustment command throws and later gives a temporary refusal.
Steps
Execute, interrupt, resume and exercise retryable refusal.
Expected
Recovery resends the same command key and temporary refusal leaves pending work without an exception.
Data
Fixtures for interrupted financial commands retain their retry keys.
Bound to
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#leaves the step submitted when the command throws, and the resume re-sends the same key
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#leaves a retryable refusal pending for the next run, with the attempt counted and no exception
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#stops at the refund: the four steps before it succeeded, the refund failed, the adjustment failed with adjustment_failed raised
Source
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#leaves the step submitted when the command throws, and the resume re-sends the same key
04 Processor-pending refunds wait for the final eventapitest
Proves
BR-CAP-COM-FUL-007-06
Preconditions
A refund remains pending at its processor.
Steps
Resume repeatedly, then exercise successful and failed refund events.
Expected
Pending processing consumes no failure attempts; the final event completes or fails the work appropriately.
Data
Fixtures for processor-pending refunds wait for the final event.
Bound to
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#is held pending at the processor, never failed, however many times it is asked again, with no exception
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#fails for Finance, with its exception, when the refund then fails at the processor
services-commerce:modules/fulfillment/tests/integration/services/facts/financial-facts-handler.integration.spec.js#holds the refund pending at the processor, not failed, and counts no failed attempt (COMM-M1 R7-2)
services-commerce:modules/fulfillment/tests/unit/adjustments/adjustment-pending-at-processor.spec.js#is true when the books are done and only the refund is pending at the processor
Source
services-commerce:modules/fulfillment/tests/integration/services/adjustments/adjustment-worker.integration.spec.js#is held pending at the processor, never failed, however many times it is asked again, with no exception
05 Staff can retry failure or record external settlementapinegativetest
Proves
BR-CAP-COM-FUL-007-08 BR-CAP-COM-FUL-007-09 BR-CAP-COM-FUL-007-10
Preconditions
Two adjustments have failed and a reader identity is available.
Steps
List with and without scope, retry one, resolve another, repeat and try reader actions.
Expected
Unscoped reads and unauthorized actions fail; retry sends only failed work and external resolution closes its finding without repetition.
Data
Fixtures for staff can retry failure or record external settlement.
Bound to
services-commerce:modules/operations/tests/e2e/operations.e2e.spec.js#lists the order’s adjustments and the failed ones, answers one with its steps, and refuses a query naming neither an order nor a state
services-commerce:modules/operations/tests/e2e/operations.e2e.spec.js#retries the failed adjustment on its route: the refund alone re-sent, completed; a reader is refused
services-commerce:modules/operations/tests/e2e/operations.e2e.spec.js#resolves the other failed adjustment offline on its route, with its exception, and refuses a repeat
services-commerce:modules/operations/tests/integration/services/interventions/operations-interventions.integration.spec.js#retries the failed adjustment: resumed from the refund alone, completed, its exception resolved; a completed one is refused
services-commerce:modules/operations/tests/integration/services/interventions/operations-interventions.integration.spec.js#resolves the other failed adjustment offline, with its exception; a resolved one is refused
Source
services-commerce:modules/operations/tests/e2e/operations.e2e.spec.js#lists the order’s adjustments and the failed ones, answers one with its steps, and refuses a query naming neither an order nor a state
06 Accounting commands preserve their required request shapesunittest
Proves
BR-CAP-COM-FUL-007-11
Preconditions
Fixtures represent every financial step.
Steps
Send commands against successful, refusal and server-error answers.
Expected
Requests retain the expected keys and quantities, refusals are classified and interrupted work remains recoverable.
Data
Fixtures for accounting commands preserve their required request shapes.
Bound to
services-commerce:modules/fulfillment/tests/unit/adjustments/accounting-adjustment-commands.spec.js#sends the credit memo to POST /credit_memos/{tenantId} with the key twice, the lines as money, and answers the memo’s id
services-commerce:modules/fulfillment/tests/unit/adjustments/accounting-adjustment-commands.spec.js#sends every memo line’s quantity as Accounting’s contract has it, a decimal string (0230: a number was refused 400)
services-commerce:modules/fulfillment/tests/unit/adjustments/accounting-adjustment-commands.spec.js#sends the fee invoice issued at once under the commerce source, the credit from the payment, its application and the refund executed, each to its route
services-commerce:modules/fulfillment/tests/unit/adjustments/accounting-adjustment-commands.spec.js#answers a refusal as failed with Accounting’s code, retryable for the refusals a later attempt may change and permanent for a decline
services-commerce:modules/fulfillment/tests/unit/adjustments/accounting-adjustment-commands.spec.js#throws when Accounting answers a server error or a document without an id, so the step stays submitted for the resume
Source
services-commerce:modules/fulfillment/tests/unit/adjustments/accounting-adjustment-commands.spec.js#sends the credit memo to POST /credit_memos/{tenantId} with the key twice, the lines as money, and answers the memo’s id

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.