Skip to content

CAP-COM-ORD-008Clear an unaccepted order and return its resources

Markdown

CAP-COM-ORD-008

Clear an unaccepted order and return its resources

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Window-expiry processing releases an unpaid order’s stock and redemption uses.Voiding a partly paid order returns its captured payments through their original treatment.
Surfaces
consoleapijob
Intent sources
services-commerce:docs/milestones/plans/COMM-M2-plan.md#A2services-commerce:docs/milestones/plans/COMM-M2-plan.md#A8services-commerce:docs/milestones/plans/COMM-M2-plan.md#2. Scope

Controls

32 controls apply, from the corpus control catalogue.

TC-IAM-006 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-AZ-006 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-TEN-004 TC-CRY-001 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-AVL-004 TC-MON-001 TC-MON-002 TC-MON-004 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-004 TC-PI-005 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
commerce.orders.voidapitenant

Business Rules

10 rules, 10 to be proved before approval. A rule's product intent is derived from its origin: 10 confirmed by a product decision, the rest inheriting this capability's confirmed.

IdRuleKindEnforced atProvenance
01must prove
Confirmed
A console void requires the void permission and a reason of no more than 500 characters; portal buyers cannot use it.
permissionapi, servicetest
services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#refuses a reader without commerce.orders.void, 403 permission_missing, and a portal member the route
02must prove
Confirmed
Only orders still placed can be voided, with accepted, payment-uncertain and already voided orders refused.
validationservicetest
services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#refuses a second void, 409 order_not_voidable, and a read answers the order voided
03must prove
Confirmed
Voiding releases the applications’ resource claims and reservation records, cancels pending delivery obligations and records the release in order history.
lifecycleservice, databasetest
services-commerce:modules/checkout/tests/e2e/order-void.e2e.spec.js#released the participant’s claim, the ledger and the obligations
04must prove
Confirmed
Voiding releases the order’s redeemed promotion and code uses.
lifecycleservice, databasetest
05must prove
Confirmed
After the void commits, Commerce requests deletion of the pro forma and records Accounting’s response, retaining the void even if deletion does not succeed.
policyservicetest
services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#deletes the pro forma in Accounting and records it on the history
06must prove
Confirmed
A partial-payment void refunds captured card or bank payments before crediting the invoice, returns store credit through the credit process and escalates unreadable payment legs.
calculationservicetest
services-commerce:modules/orders/tests/unit/orders/void-refund.spec.js#refunds the paid part of a part-paid order before the memo of its line is cut
07must prove
Confirmed
Void replay and adjustment replay send no duplicate refunds, and a later independent void request is refused.
invariantservicetest
services-commerce:modules/orders/tests/e2e/billing-and-tender.e2e.spec.js#refunds nothing twice: a second void is 409, a re-run of the plan sends nothing and a replayed request answers the same plan
08must prove
Confirmed
The minute sweep voids expired placed pay-now orders in bounded window order within their workspaces, recording a system reason and leaving terms, accepted and voided orders alone.
lifecycleservice, databasetest
services-commerce:modules/orders/tests/integration/services/orders/tender-window-sweeper.integration.spec.js#voided each in its own tenant: the reason tender_window_expired, the reservation released, the obligation cancelled, the history told by the system
09must prove
Confirmed
A configured tender window is measured from the exact placement instant, including when it crosses midnight.
calculationservicetest
services-commerce:modules/orders/tests/unit/placement/tender-window.spec.js#ends a thirty-minute window across midnight UTC on the next day
10must prove
Confirmed
After the pay-now window expires, Order 360 removes Take Payment but retains Void Order for an unpaid order.
policyconsoletest
react-console:components/console/order/__tests__/order-360-live-cards.test.tsx#shows neither once the tender window has passed, except Void Order

Scenarios

IdGivenWhenThenProvenance
01A duplicate phone order reserves mugs and the only use of a code.An administrator voids it with an explanation.Its resources and code use become available, and Accounting is asked to delete the provisional invoice.unknown

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.