Skip to content

CAP-COM-ORD-016Authorize returns and settle received goods

Markdown

CAP-COM-ORD-016

Authorize returns and settle received goods

Markdown
  • DocumentDraft
  • Product intentProposed
  • 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
An eligible return supplies an authorization number and deadline.Return settlement follows the selected trigger and applicable fees.
Surfaces
consoleportalapi
Intent sources
services-commerce:docs/migrations/post-purchase/README.md#D-P7-32

Controls

28 controls apply, from the corpus control catalogue.

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-PI-001 TC-PI-003 TC-PI-005 TC-VEN-001 TC-VEN-002 TC-VEN-003 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
commerce.returns.readapitenant
commerce.returns.createapitenant
commerce.returns.updateapitenant
commerce.returns.approveapitenant
commerce.returns.overrideservicetenant
commerce.return-policies.readapitenant
commerce.return-policies.createapitenant
commerce.return-policies.deleteapitenant
commerce.return-policies.updateapitenant
commerce.return-policies.bulkapitenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Proposed
Returns require an accepted order and available line quantity, refusing placed orders, excess quantities, unauthorized parties and another workspace’s records.
validationapi, servicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#refuses a placed order 409 order_not_returnable, more units than the line has (rejected), another member 403, a reader 403, another tenant 404
02must prove
Proposed
Return policy resolves from product, store, workspace and built-in defaults, with frozen promises able to improve the chosen terms; the built-in policy uses thirty days, outside-window review and refund on receipt without a fee.
calculationservicetest
services-commerce:modules/orders/tests/unit/returns/return-policy.spec.js#picks the most specific configured policy, else the built-in default, and loosens it by the frozen terms
03must prove
Proposed
An eligible in-window request immediately receives a numbered return authorization with its permitted lines, deadline and return instructions.
lifecycleservicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#authorizes at once under the built-in policy: the RMA numbered with its deadline, the lines authorized, the customer told to send it back
04must prove
Proposed
A late customer return waits for an approver to authorize or reject it with a reason.
policyservicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#holds the member’s request for approval; the approver authorizes it and the RMA is issued
05must prove
Proposed
Final-sale items require an administrator override to become returnable.
policyservicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#rejects the member with final_sale; the administrator’s override authorizes it
06must prove
Proposed
Settlement follows the chosen authorization, receipt or inspection trigger, with receipt-based returns closing after all goods and money are processed and partial receipts remaining open.
lifecycleservicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#takes the warehouse’s receipt: the goods back on the line, the memo and the refund run, the document completed and the RMA closed
07must prove
Proposed
Restocking fees use a separate fee invoice paid from freed money, with the remainder refunded; staff can choose credit while a customer cannot select the financial action.
calculationservicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#charges the policy’s 10% restocking fee as an invoice paid from the freed money, and refunds the rest
08must prove
Proposed
A customer-paid purchased return label uses the configured label fee product and reduces only the refund remaining after other fees; customer deductions do not apply to organization-paid or unpurchased labels.
calculationservicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#invoices the label on the return label fee product, pays it from the freed money and refunds the rest
09must prove
Proposed
Only one return policy occupies each product or store scope or the workspace default, malformed default scope references are refused and portal callers cannot read policy administration.
validationapi, servicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#lists, reads and deletes the policy; refuses a member the policies, a second policy at the scope 400, a tenant default with a scope id 400
10must prove
Proposed
Withdrawing an authorized return closes its authorization and informs receiving, while another active return on the same line blocks a duplicate request.
lifecycleservicetest
services-commerce:modules/orders/tests/e2e/returns.e2e.spec.js#lets the member withdraw an authorized return: the RMA closed and the streams told; a line already under a return refused meanwhile
11must prove
Proposed
A frozen promise that the organization pays the return label prevents a later policy from charging that label to the customer.
invariantservicetest
services-commerce:modules/orders/tests/unit/returns/return-policy.spec.js#keeps a label the frozen terms promised at the tenant’s cost from being charged to the customer later
12
Proposed
Return-policy administration supports creation and deletion without an edit operation.
policyapiobserved

Scenarios

IdGivenWhenThenProvenance
01Two purchased mugs arrive damaged.The customer requests their return and receiving reports and inspects the goods.The authorization, receipt, inspection and settlement remain connected, with a stock disposition for the returned goods.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.