Skip to content

ATS-COM-ORD-015Amend purchases and settle their price difference: Capability Test Specification

Markdown

ATS-COM-ORD-015

Amend purchases and settle their price difference: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision2

Read atservices-commerce c8b66a98macroservice-libraries 54536a44react-console baf6dae3

Coverage

  • Rule covered
  • Transition gap: FND-COM-ORD-072
  • Validation covered
  • Permission gap: FND-COM-ORD-072
  • Edge covered
  • Failure gap: FND-COM-ORD-072
  • Boundary covered
  • Concurrency covered
  • Invariant gap: FND-COM-ORD-072
  • Interaction gap: FND-COM-ORD-071

Test Scenarios

16 scenarios proving CAP-COM-ORD-015; 12 bound to an existing test.

01 Remaining-term upgrade places the net differenceruleapitest
Proves
BR-CAP-COM-ORD-015-01
Preconditions
A three-hundred-dollar annual purchase has six months left and replacement annual price is four hundred fifty dollars.
Steps
[ { "do": "Evaluate and execute its upgrade.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#prorates by remaining months (six of twelve): $150.00 unused, $225.00 for the rest of the term, net $75.00 charged" } ]
Expected
The unused value is 150, replacement remaining value 225 and the linked order charges 75 using the original parties.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#prorates by remaining months (six of twelve): $150.00 unused, $225.00 for the rest of the term, net $75.00 charged
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#placed the change order under the amendment: the original’s parties, one premium line at the remaining value, billed, placed
Source
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#prorates by remaining months (six of twelve): $150.00 unused, $225.00 for the rest of the term, net $75.00 charged
02 Replacement delivery completes the amendmenttransitionapitest
Proves
BR-CAP-COM-ORD-015-02
Preconditions
An executed upgrade still waits for its change-order payment.
Steps
[ { "do": "Pay the change order and process its application delivery.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#marked the original line amended with its successor (nothing to fence: the type claims nothing), and wrote a modify obligation superseding the delivered fulfilment" } ]
Expected
The original delivery is superseded and the replacement completion closes the amendment.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#marked the original line amended with its successor (nothing to fence: the type claims nothing), and wrote a modify obligation superseding the delivered fulfilment
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#completes once the buyer’s card accepts the change order and the worker delivers the modify: the original fulfilment superseded
Source
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#marked the original line amended with its successor (nothing to fence: the type claims nothing), and wrote a modify obligation superseding the delivered fulfilment
03 Downgrade credit accepts without a new paymentedgeapitest
Proves
BR-CAP-COM-ORD-015-03
Preconditions
The six-month remaining values produce a seventy-five-dollar decrease.
Steps
[ { "do": "Execute the downgrade.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#credits $225.00 unused against $150.00 new: net −$75.00 as a credit; the change order accepted at once, the document executing" } ]
Expected
The document carries a negative difference and accepts the change order using the credit treatment.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#credits $225.00 unused against $150.00 new: net −$75.00 as a credit; the change order accepted at once, the document executing
Source
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#credits $225.00 unused against $150.00 new: net −$75.00 as a credit; the change order accepted at once, the document executing
04 Change settlement includes both tax sharesboundaryapitest
Proves
BR-CAP-COM-ORD-015-04
Preconditions
Original and replacement purchases use eight-and-a-quarter-percent tax.
Steps
[ { "do": "Evaluate taxed upgrade and downgrade fixtures.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#shows the tax on both sides in the plan: $18.56 on the new value, $12.38 of the original tax unused, the net $81.18" } ]
Expected
The upgrade uses 18.56 new tax and 12.38 unused tax for 81.18 due; the downgrade retains its demonstrated tax-inclusive credit.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#shows the tax on both sides in the plan: $18.56 on the new value, $12.38 of the original tax unused, the net $81.18
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#placed the change order taxed: the tax on the change line and the header, a tax line on the tax product, the quote frozen
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#refunds a downgrade’s unused tax share less the new value’s tax: −$81.19, the change order accepted with nothing to pay
Source
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#shows the tax on both sides in the plan: $18.56 on the new value, $12.38 of the original tax unused, the net $81.18
05 Application review controls permitted changesconcurrencyapitest
Proves
BR-CAP-COM-ORD-015-05
Preconditions
One application refuses a change and another requests approval.
Steps
[ { "do": "Submit each change, attempt overlap and approve and execute the held case.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#rejects a change the participant refuses, with its problem, and leaves the line open" } ]
Expected
Refusal preserves the original line and the held request blocks overlap until permitted execution.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#rejects a change the participant refuses, with its problem, and leaves the line open
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#holds a change the participant wants approved; a second request on the line is 409; the approver approves, staff execute
Source
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#rejects a change the participant refuses, with its problem, and leaves the line open
06 Invalid amendment targets and callers are refusedpermissionapinegativetest
Proves
BR-CAP-COM-ORD-015-06
Preconditions
Fixtures include a change order, unknown product and unauthorized contexts.
Steps
[ { "do": "Request changes through the corresponding cases.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#refuses a change order itself (409 order_not_amendable), an unknown product (409 product_not_found), another member, a reader and another tenant" } ]
Expected
The responses identify invalid order or product and reject other-party, reader and cross-workspace access.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#refuses a change order itself (409 order_not_amendable), an unknown product (409 product_not_found), another member, a reader and another tenant
Source
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#refuses a change order itself (409 order_not_amendable), an unknown product (409 product_not_found), another member, a reader and another tenant
07 A later code adjusts paid or terms moneyinteractionapitest
Proves
BR-CAP-COM-ORD-015-07
Preconditions
A paid order and unpaid terms order can receive the same eligible code.
Steps
[ { "do": "Apply it with a reason and exercise missing-reason and missing-permission cases.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#answers 200 with the apply_promotion amendment completed, its plan on the document, its net owed to the buyer" } ]
Expected
The completed discount creates the appropriate credit or refund, while invalid requests fail before adjustment.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#answers 200 with the apply_promotion amendment completed, its plan on the document, its net owed to the buyer
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#sends the memo to the fixture Accounting per invoice line, then the refund of what it freed, under the amendment’s keys
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#completes the amendment with the memo alone: the balance reduced by 250, nothing refunded or credited
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#refuses a missing reason 400, a clerk without the key 403 permission_missing, a portal member 403, another tenant 404
Source
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#answers 200 with the apply_promotion amendment completed, its plan on the document, its net owed to the buyer
08 Stored Standard price enables after-sale comparisonvalidationapitest
Proves
BR-CAP-COM-ORD-015-08
Preconditions
The member item costs eighteen dollars with a twenty-five-dollar Standard basis; an older order lacks that basis.
Steps
[ { "do": "Apply non-combining and combining offers and try the older order.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/promotion-alternatives.e2e.spec.js#applies STD30 after placement on the lower of her $18.00 and the Standard $25.00 less 30 %, $17.50: she saves $0.50, not both" } ]
Expected
The demonstrated savings are fifty cents or four dollars fifty, while the missing-basis order is refused.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/promotion-alternatives.e2e.spec.js#applies STD30 after placement on the lower of her $18.00 and the Standard $25.00 less 30 %, $17.50: she saves $0.50, not both
services-commerce:modules/orders/tests/e2e/promotion-alternatives.e2e.spec.js#applies YES25, which combines, to her Member price: 25 % of $18.00 is $4.50, $13.50
services-commerce:modules/orders/tests/e2e/promotion-alternatives.e2e.spec.js#refuses STD30 for an order placed before the Standard price was stored, with the staff message
Source
services-commerce:modules/orders/tests/e2e/promotion-alternatives.e2e.spec.js#applies STD30 after placement on the lower of her $18.00 and the Standard $25.00 less 30 %, $17.50: she saves $0.50, not both
09 Rejected after-sale codes leave money unchangedvalidationapinegativetest
Proves
BR-CAP-COM-ORD-015-09
Preconditions
Offers are already used, exhausted, non-qualifying or unknown.
Steps
[ { "do": "Attempt each after-sale application.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#refuses the same code again 409 promotion_refused, already_applied, the second document rejected and nothing moved" } ]
Expected
The rejected document records its reason without redemption or financial movement.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#refuses the same code again 409 promotion_refused, already_applied, the second document rejected and nothing moved
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#refuses an exhausted code code_exhausted, after its one use on another order, with nothing written but the rejected document
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#refuses a code that applies to none of the lines nothing_qualifies, with the staff message
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#refuses a code the tenant does not have code_not_found
Source
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#refuses the same code again 409 promotion_refused, already_applied, the second document rejected and nothing moved
10 Proration variants honor their date and value basisboundaryunittest
Proves
BR-CAP-COM-ORD-015-13
Preconditions
Inputs cover daily and monthly terms, alternative value bases and invalid effective dates.
Steps
[ { "do": "Calculate the supported methods and refusal cases.", "provenance": "test", "source": "services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#leaves July out after its 15th: 5 of 12, unused 5000, new 6250, net 1250" } ]
Expected
The bindings prove the fifteenth-day rule, full-term and difference cases, suppressed-money cases, positive-net fee minimum and invalid time calculations.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#leaves July out after its 15th: 5 of 12, unused 5000, new 6250, net 1250
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#full_difference credits no time and charges the whole difference; a negative difference is credited whole
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#new_full_term credits the unused value by the days and charges the new price in full
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#applies the minimum upgrade fee to a positive net only
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#refuses an effective date before the start or after the end, a lifetime term under a time method, and a method with no term
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#prorates by remaining days: 183 of 365, unused 6016, new 7521, net 1505
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#billing_periods counts the term’s months until a plan carries periods
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#C4: a $90 promotional purchase under original_price credits 4500 and nets 3000; under standard_price 6000 and 1500
Source
services-commerce:modules/orders/tests/unit/amendments/proration.spec.js#leaves July out after its 15th: 5 of 12, unused 5000, new 6250, net 1250
11 Withdrawing a prepared change keeps the original purchase opentransitionapitest
Proves
BR-CAP-COM-ORD-015-11
Preconditions
A member has an approved unexecuted change.
Steps
[ { "do": "Withdraw it and inspect the original line.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#lets the member withdraw an approved, unexecuted change; the line stays open" } ]
Expected
The change is withdrawn and the original line remains open.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Bound to
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#lets the member withdraw an approved, unexecuted change; the line stays open
Source
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#lets the member withdraw an approved, unexecuted change; the line stays open
12 A void releases a later promotion redemptioninteractionapitest
Proves
BR-CAP-COM-ORD-015-12
Preconditions
An unaccepted order carries an after-sale promotion redemption.
Steps
[ { "do": "Void it and inspect the redemption.", "provenance": "test", "source": "services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#releases the amendment’s redemption order_voided, as the void releases a placement’s" } ]
Expected
The redemption records release for the order void.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Bound to
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#releases the amendment’s redemption order_voided, as the void releases a placement’s
Source
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#releases the amendment’s redemption order_voided, as the void releases a placement’s
13 A later code extends the sale’s retained discount historyinteractionapiproposed
Proves
BR-CAP-COM-ORD-004-06 BR-CAP-COM-ORD-015-07
Preconditions
An accepted sale carries an earlier offer and qualifies for a distinct combinable offer.
Steps
[ { "do": "Apply the later offer with authorized staff and inspect both allocations and credit.", "provenance": "proposed", "source": [ "services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#takes one use of the code and of the promotion", "services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#answers 200 with the apply_promotion amendment completed, its plan on the document, its net owed to the buyer" ] } ]
Expected
The earlier allocation remains and the later saving has its own amendment and financial adjustment.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#takes one use of the code and of the promotion,services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js#answers 200 with the apply_promotion amendment completed, its plan on the document, its net owed to the buyer
14 Independent change documents need an explicit cross-kind conflict decisioninteractionapinegativeproposed
Proves
BR-CAP-COM-ORD-014-07 BR-CAP-COM-ORD-015-05
Preconditions
An approved cancellation occupies a line that also supports amendment.
Steps
[ { "do": "Request an amendment before executing the cancellation, then try executing both.", "provenance": "proposed", "source": [ "services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#holds staff’s request for approval (participant_requires_approval) and refuses a second request on the line 409 line_already_cancelling (B38)", "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#holds a change the participant wants approved; a second request on the line is 409; the approver approves, staff execute", "FND-COM-ORD-071" ] } ]
Expected
Record whether one operation refuses or both proceed; the cross-kind policy needs a product decision.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:modules/orders/tests/e2e/cancellations.e2e.spec.js#holds staff’s request for approval (participant_requires_approval) and refuses a second request on the line 409 line_already_cancelling (B38),services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#holds a change the participant wants approved; a second request on the line is 409; the approver approves, staff execute,FND-COM-ORD-071
15 Replacement payment determines amendment completioninteractionapiproposed
Proves
BR-CAP-COM-ORD-015-01 BR-CAP-COM-ORD-005-01 BR-CAP-COM-ORD-006-01 BR-CAP-COM-ORD-007-01
Preconditions
An accepted purchase supports a positive-price upgrade.
Steps
[ { "do": "Execute the change, pay its linked replacement and deliver the replacement work.", "provenance": "proposed", "source": [ "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#refuses a change order itself (409 order_not_amendable), an unknown product (409 product_not_found), another member, a reader and another tenant", "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#marked the original line amended with its successor (nothing to fence: the type claims nothing), and wrote a modify obligation superseding the delivered fulfilment", "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#credited the unused value from the original payment and applied it to the change invoice; the document awaits the buyer’s tender", "services-commerce:modules/orders/services/amendments/amendment-settlement.ts:onChangeOrderVoided", "services-commerce:modules/orders/services/orders/accept-order.ts:acceptOrder", "services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#completes once the buyer’s card accepts the change order and the worker delivers the modify: the original fulfilment superseded" ] } ]
Expected
The original is superseded only through the amendment chain and completion follows replacement acceptance and delivery.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#refuses a change order itself (409 order_not_amendable), an unknown product (409 product_not_found), another member, a reader and another tenant,services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#marked the original line amended with its successor (nothing to fence: the type claims nothing), and wrote a modify obligation superseding the delivered fulfilment,services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#credited the unused value from the original payment and applied it to the change invoice; the document awaits the buyer’s tender,services-commerce:modules/orders/services/amendments/amendment-settlement.ts:onChangeOrderVoided,services-commerce:modules/orders/services/orders/accept-order.ts:acceptOrder,services-commerce:modules/orders/tests/e2e/amendments.e2e.spec.js#completes once the buyer’s card accepts the change order and the worker delivers the modify: the original fulfilment superseded
16 A later offer settles against the preserved sale basisinteractionapiproposed
Proves
BR-CAP-COM-ORD-015-01 BR-CAP-COM-ORD-004-01
Preconditions
An accepted order retains its Standard price and earlier discount allocations.
Steps
[ { "do": "Apply a qualifying later code and replay its money adjustment.", "provenance": "proposed", "source": [ "services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js", "services-commerce:modules/orders/tests/e2e/promotion-alternatives.e2e.spec.js", "services-commerce:modules/orders/services/amendments/promotion-amendment.ts", "services-commerce:modules/orders/services/adjustments/resume-adjustments.ts" ] } ]
Expected
The resulting amendment credits the evaluated saving once and retains the original sale basis.
Data
Use an isolated workspace with the records and responses named in the preconditions.
Source
services-commerce:modules/orders/tests/e2e/apply-promotion-amendment.e2e.spec.js,services-commerce:modules/orders/tests/e2e/promotion-alternatives.e2e.spec.js,services-commerce:modules/orders/services/amendments/promotion-amendment.ts,services-commerce:modules/orders/services/adjustments/resume-adjustments.ts

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.