Skip to content

ATS-COM-ORD-018Receive inventory and retain its cost: Acceptance Test Set

Markdown

ATS-COM-ORD-018

Receive inventory and retain its cost: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-ORD-018

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

15 scenarios proving CAP-COM-ORD-018; 14 bound to an existing test.

01 Receipt replay retains the first delivery recordapitest
Proves
BR-CAP-COM-ORD-018-01
Preconditions
A keyed receipt is accepted against an issued purchase order.
Steps
Submit the same receipt key again.
Expected
The response identifies the existing receipt without duplicate stock or cost writes.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#answers the retried receipt as found under its key, writing nothing twice
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#answers the retried first receipt as the same receipt, lists the receipts by order and reads one with its lines
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#answers the retried receipt as found under its key, writing nothing twice
02 Receipt validation prevents excess or unexplained costapinegativetest
Proves
BR-CAP-COM-ORD-018-02
Preconditions
The open line has forty units left and a separate order is already received.
Steps
Attempt excess quantity, another receipt on the completed order and changed cost without and with a reason.
Expected
Invalid receipt cases write nothing and only the explained cost variance proceeds.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#refuses a receipt beyond what the line has open (over_receipt) and a receipt against a received order, writing nothing
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#refuses a receipt line whose cost differs from the order line’s without a reason, and takes one with a reason
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#refuses a receipt beyond what the line has open (over_receipt) and a receipt against a received order, writing nothing
03 Receiving commits quantity and capitalization togetherapitest
Proves
BR-CAP-COM-ORD-018-03
Preconditions
Two backorders wait for a sixty-unit delivery at ten dollars per unit.
Steps
Record the delivery and inspect stock, layers, posting facts and claims.
Expected
The fixture creates sixty units at cost, a six-hundred-dollar capitalization fact and ordered backorder fill with fifty-eight units available.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#writes, in the receipt’s transaction, the receipt movement naming the line, the layer of 60 @ 1000 and the capitalize_receipt fact of 60000
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#fills the two backorders at the first receipt, oldest first, converting them to committed; the shelf shows 58 available after
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#writes, in the receipt’s transaction, the receipt movement naming the line, the layer of 60 @ 1000 and the capitalize_receipt fact of 60000
04 Landed-cost allocation retains the minor-unit totalunittest
Proves
BR-CAP-COM-ORD-018-04
Preconditions
Receipt lines have different quantities and values.
Steps
Allocate freight by each supported basis and derive layer unit cost.
Expected
Shares preserve the total through the final-line remainder and unit cost includes the allocated portion.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#shares by quantity to the minor unit, the last line taking the rounding remainder
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#shares by value: a line worth three times another takes three times the landed cost
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#is the line’s cost plus its landed share per unit, to the nearest minor unit
Source
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#shares by quantity to the minor unit, the last line taking the rounding remainder
05 Method switching leaves earlier cost history intactapitest
Proves
BR-CAP-COM-ORD-018-05
Preconditions
Two layers have different dates and costs with no initial business-unit setting.
Steps
Relieve under default FIFO, switch to LIFO and relieve again.
Expected
FIFO uses earlier units, LIFO uses later units and the earlier relief records remain unchanged.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#relieves under FIFO while the business unit has no setting: 4 @ 1000 from the older layer, recorded fifo
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#relieves a LIFO business unit’s 12 over two layers newer first: 10 @ 1200 from the newer, then 2 @ 1000 from the older, recorded lifo
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#rewrites nothing made before the switch: the FIFO relief rows read back unchanged, the receipt layers still record fifo
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#relieves under FIFO while the business unit has no setting: 4 @ 1000 from the older layer, recorded fifo
06 Costing settings require current version and allowed methodapitest
Proves
BR-CAP-COM-ORD-018-06
Preconditions
The business unit has no configured setting.
Steps
Read defaults, write LIFO, try stale replacement and invalid method or unit inputs.
Expected
Defaults expose version zero, the valid write succeeds and stale or malformed requests fail.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#reads a business unit with no settings at the defaults: FIFO at version 0, not configured
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#writes LIFO at version 0, replaces it with the record read sent back, and refuses the stale version 409
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#refuses a method that is neither FIFO nor LIFO 400, and a body naming another business unit 400
Source
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#reads a business unit with no settings at the defaults: FIFO at version 0, not configured
07 Uncovered relief is explicitly flaggedapinegativetest
Proves
BR-CAP-COM-ORD-018-07
Preconditions
The shipped quantity exceeds available cost-layer coverage.
Steps
Relieve the shipped units.
Expected
Uncovered units carry zero cost with an uncosted_relief exception.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#relieves units no layer covers at cost zero under no layer and raises uncosted_relief, so the books say so
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#relieves units no layer covers at cost zero under no layer and raises uncosted_relief, so the books say so
08 Return cost reverses the shipment basisapitest
Proves
BR-CAP-COM-ORD-018-08
Preconditions
Shipment relief used identified layers at retained costs.
Steps
Restore five returned units.
Expected
Restore rows identify their reliefs and original-cost layers with a matching cost-restoration fact.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#restores 5 returned units at the relieved cost and place: a restore row naming the relief it reverses, a layer at that cost dated with the original layer, a restore_cogs fact of 5 × that cost
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#restores 5 returned units at the relieved cost and place: a restore row naming the relief it reverses, a layer at that cost dated with the original layer, a restore_cogs fact of 5 × that cost
09 Cost corrections preserve the consumed recordapitest
Proves
BR-CAP-COM-ORD-018-09
Preconditions
A costed layer has remaining units and needs a lower unit cost.
Steps
Correct its remaining cost basis.
Expected
The remainder moves into a successor layer, the original is consumed and the value difference becomes a cost-adjustment fact.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#moves the unconsumed remainder to a layer at the corrected cost, leaves the original consumed, and writes the cost_adjustment of the difference
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#corrects the second layer’s cost to 1100: the remainder on a correction layer, the original consumed, a cost_adjustment of 10 × 150, the valuation reconciled
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#moves the unconsumed remainder to a layer at the corrected cost, leaves the original consumed, and writes the cost_adjustment of the difference
10 Valuation reconciles quantities beside their assigned costapitest
Proves
BR-CAP-COM-ORD-018-10
Preconditions
The fixture layers contain three zero-cost units and two ten-unit priced layers.
Steps
Read valuation and business-unit summaries.
Expected
The item reports twenty-three units and 225 dollars with reconciliation and its costing setting.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#values the shirt L item at Σ the layers (3 at zero from the movement route, 10 × 1000, 10 × 1250 = 22500), reconciled with 23 on hand
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#shows the products’ business unit and its method beside the valuation’s totals: faa, FIFO, not configured
Source
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#values the shirt L item at Σ the layers (3 at zero from the movement route, 10 × 1000, 10 × 1250 = 22500), reconciled with 23 on hand
11 Posting acknowledgement is stable by referenceapitest
Proves
BR-CAP-COM-ORD-018-11
Preconditions
Two receipt facts remain unposted.
Steps
List them, acknowledge a reference, replay it and attempt another reference.
Expected
The same reference replays without changing history, another reference fails and acknowledged facts leave intake.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#lists the unposted facts by date, stamps them posted once under Accounting’s reference, and refuses another reference on a posted fact
services-commerce:modules/purchasing/tests/e2e/purchasing.e2e.spec.js#lists the facts unposted (the two receipts’), stamps them posted under Accounting’s reference, and lists none unposted after
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#lists the unposted facts by date, stamps them posted once under Accounting’s reference, and refuses another reference on a posted fact
12 Posting kinds expose their debit and credit purposesunittest
Proves
BR-CAP-COM-ORD-018-12
Preconditions
Inputs cover receipt, shipment, restore, loss, scrap and gain.
Steps
Resolve account purposes for each fact kind.
Expected
The returned inventory, clearing, cost-of-goods and adjustment directions match the supplied fact kind.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#debits inventory and credits GRNI for a receipt, debits COGS and credits inventory for a handoff, the reverse for a restore
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#debits the adjustment account for a loss or a write-off and credits it for a gain
Source
services-commerce:modules/purchasing/tests/unit/cost/cost-rules.spec.js#debits inventory and credits GRNI for a receipt, debits COGS and credits inventory for a handoff, the reverse for a restore
13 Supply flow connects waiting orders, valuation and postingapitest
Proves
AS-JNY-COM-ORD-006-01 AS-JNY-COM-ORD-006-02 AS-JNY-COM-ORD-006-03
Preconditions
A vendor supplies stock with existing backorders.
Steps
Issue the commitment, receive deliveries and inspect valuation and posting acknowledgement.
Expected
The demonstrated components fill waiting claims, reconcile layer value and acknowledge each fact once.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#fills the two backorders at the first receipt, oldest first, converting them to committed; the shelf shows 58 available after
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#values the item after at 30 × 1200 = 36000, reconciled with the ledger’s on-hand of 30
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#lists the unposted facts by date, stamps them posted once under Accounting’s reference, and refuses another reference on a posted fact
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#fills the two backorders at the first receipt, oldest first, converting them to committed; the shelf shows 58 available after
14 Transfers preserve value without inventing uncovered costapiproposed
Proves
BR-CAP-COM-ORD-018-14
Preconditions
A transfer contains covered stock whose total cost has a rounding remainder and additional stock without an acquisition layer.
Steps
Transfer the units and inspect source relief, destination layers and posting facts.
Expected
Covered value is preserved exactly across weighted destination layers, uncovered units create no destination cost layer, and the transfer creates no financial posting fact.
Data
Use the controlled records and transports established by the cited tests.
Source
services-commerce:modules/purchasing/services/cost/transfer-cost.ts:costTransfer
15 Count and staff movements retain the proper cost factsapitest
Proves
BR-CAP-COM-ORD-018-15
Preconditions
Inventory has receipt cost history and count or staff changes.
Steps
Record gains, losses and scrap in the fixture flows.
Expected
Gains create receipt-based cost, losses consume layers and each movement records its demonstrated adjustment or write-off purpose.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#relieves a scrap FIFO with a write_off fact, and a negative adjustment with an adjustment_loss fact
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#values a count gain at the last receipt cost (adjustment_gain) and relieves a count loss (adjustment_loss), each fact naming the count line
Source
services-commerce:modules/purchasing/tests/integration/services/receiving/purchasing-flow.integration.spec.js#relieves a scrap FIFO with a write_off fact, and a negative adjustment with an adjustment_loss fact

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.