Skip to content

ATS-ACC-TRX-011Provide and spend customer credit: Capability Test Specification

Markdown

ATS-ACC-TRX-011

Provide and spend customer credit: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaAccountingModuleTransactionsRevision2

Read atservices-accounting f47cb263react-console baf6dae3

Coverage

  • Rule gap: FND-ACC-TRX-076
  • Transition gap: FND-ACC-TRX-076
  • Validation covered
  • Permission covered
  • Edge gap: FND-ACC-TRX-076
  • Failure gap: FND-ACC-TRX-076
  • Boundary covered
  • Concurrency covered
  • Invariant gap: FND-ACC-TRX-076
  • Interaction covered

Test Scenarios

10 scenarios proving CAP-ACC-TRX-011; 9 bound to an existing test.

01 Manual credit requires compatible accountsvalidationapitest
Proves
BR-CAP-ACC-TRX-011-01 INV-DOM-ACC-TRX-004-01
Preconditions
Accounts exist in two units.
Steps
[ { "do": "Omit accounts, choose foreign-unit account, choose wrong currency and submit valid credit.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it refuses a manual credit without its accounts, and a payment’s credit without its payment (400)" } ]
Expected
Invalid variants fail and valid credit starts open at one million with its full value.
Data
Liability and expense destinations.
Bound to
services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it refuses a manual credit without its accounts, and a payment’s credit without its payment (400)
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it numbers the tenant’s first credit 1,000,000, open, with its accounts and its whole balance
Source
services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it refuses a manual credit without its accounts, and a payment’s credit without its payment (400)
02 Credit creation transfers available receipt valuetransitionapitest
Proves
BR-CAP-ACC-TRX-011-02 INV-DOM-ACC-TRX-004-02
Preconditions
A check holds 30.00.
Steps
[ { "do": "Create 20.00 of payment-backed credit twice.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the payment holds unapplied (over_application)" } ]
Expected
The first leaves 10.00 available and the second is rejected.
Data
An unapplied check receipt.
Bound to
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it takes the money off the payment: credited out 2000, unapplied 1000
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it is the payment’s customer, unit and currency, open with its balance
Source
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the payment holds unapplied (over_application)
03 Credit spending remains bounded under concurrencyconcurrencyapinegativetest
Proves
BR-CAP-ACC-TRX-011-03 BR-CAP-ACC-TRX-011-07 INV-DOM-ACC-TRX-004-03 INV-DOM-ACC-TRX-004-07
Preconditions
A credit holds 50.00 and another is available for a race.
Steps
[ { "do": "Spend all, retry after use, overspend another credit and race two applications.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the credit holds (insufficient_credit), the database’s CHECK, writing nothing" } ]
Expected
Used credit cannot spend again, excess writes nothing and one concurrent request fails.
Data
Parallel application clients.
Bound to
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the credit holds (insufficient_credit), the database’s CHECK, writing nothing
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it serializes two concurrent applications of one credit: one succeeds, the other is refused by the database
Source
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the credit holds (insufficient_credit), the database’s CHECK, writing nothing
04 One application can pay several invoicestransitionapitest
Proves
BR-CAP-ACC-TRX-011-04 INV-DOM-ACC-TRX-004-04
Preconditions
Credit holds 50.00 for two eligible bills.
Steps
[ { "do": "Distribute it through one application.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it raises the line’s amount_paid: a line settled by store credit reads open until fully paid, then paid" } ]
Expected
One number groups both target lines and settlement derives their paid standing.
Data
Two invoices for the same customer.
Bound to
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it numbers the application 1,000,000, applied, for the whole credit: 4000 then 1000 by pay priority
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it raises the line’s amount_paid: a line settled by store credit reads open until fully paid, then paid
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it applies one credit across two invoices in one application: a line of each, the balances of both lowered
Source
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it raises the line’s amount_paid: a line settled by store credit reads open until fully paid, then paid
05 Credit cannot cross customersboundaryapinegativetest
Proves
BR-CAP-ACC-TRX-011-05 INV-DOM-ACC-TRX-004-05
Preconditions
Member credit targets an employer invoice.
Steps
[ { "do": "Submit the application.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses a credit of another customer than the invoice’s bill-to (credit_customer_mismatch)" } ]
Expected
Customer mismatch leaves the position unchanged.
Data
Separate member and employer records.
Bound to
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses a credit of another customer than the invoice’s bill-to (credit_customer_mismatch)
Source
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses a credit of another customer than the invoice’s bill-to (credit_customer_mismatch)
06 Expiry boundary and order restriction are enforcedboundaryapitest
Proves
BR-CAP-ACC-TRX-011-06
Preconditions
Credits expired yesterday, expire today and are membership-restricted.
Steps
[ { "do": "Apply each and select gala and membership targets for the restricted credit.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses a credit that expired before the application date (credit_expired)" } ]
Expected
Earlier expiry and unrelated order fail; same-day and matching-order use succeed.
Data
Invoices with order-type metadata.
Bound to
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses a credit that expired before the application date (credit_expired)
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses a credit restricted to another order type than the invoice’s (credit_order_type_mismatch)
Source
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses a credit that expired before the application date (credit_expired)
07 Application reversal restores held value oncetransitionapitest
Proves
BR-CAP-ACC-TRX-011-08 INV-DOM-ACC-TRX-004-08
Preconditions
Credit has been spent through an application.
Steps
[ { "do": "Reverse it with an explanation and repeat.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it marks the first reversed and gives the money back to the credit, which is open again" } ]
Expected
The opposing document restores debt and credit; another reversal fails.
Data
A live credit application.
Bound to
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it answers a second application naming the first, its lines negating the first’s
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it marks the first reversed and gives the money back to the credit, which is open again
Source
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it marks the first reversed and gives the money back to the credit, which is open again
08 Unused credit can be voided safelytransitionapitest
Proves
BR-CAP-ACC-TRX-011-09 INV-DOM-ACC-TRX-004-09
Preconditions
Manual, payment-backed and already-applied credits exist.
Steps
[ { "do": "Attempt to void each.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses voiding a credit with money applied (credit_has_applications)" } ]
Expected
Unused credit voids, source money returns for payment-backed credit and applied credit fails.
Data
Credits with differing use histories.
Bound to
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it voids an unused credit with the reason and nets its facts to nothing
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses voiding a credit with money applied (credit_has_applications)
Source
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses voiding a credit with money applied (credit_has_applications)
09 Reading credit does not authorize spendingpermissionapinegativetest
Proves
BR-CAP-ACC-TRX-011-11
Preconditions
The caller holds read-only access.
Steps
[ { "do": "Attempt every credit and application mutation.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it is refused the application routes without their permissions (403)" } ]
Expected
Every request is denied.
Data
A reader persona.
Bound to
services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it is refused the credit routes without their permissions (403)
services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it is refused the application routes without their permissions (403)
Source
services-accounting:modules/transactions/tests/e2e/credits.e2e.spec.js#it is refused the application routes without their permissions (403)
10 Credit transfer controls later use of its source receiptinteractionapiproposed
Proves
BR-CAP-ACC-TRX-011-02 BR-CAP-ACC-TRX-011-03 BR-CAP-ACC-TRX-011-09 BR-CAP-ACC-TRX-006-08 BR-CAP-ACC-TRX-006-10 BR-CAP-ACC-TRX-009-03 BR-CAP-ACC-TRX-009-04 BR-CAP-ACC-TRX-012-01 BR-CAP-ACC-TRX-012-02 BR-CAP-ACC-TRX-013-05 BR-CAP-ACC-TRX-014-03 BR-CAP-ACC-TRX-014-04 BR-CAP-ACC-TRX-003-04 BR-CAP-ACC-TRX-007-06
Preconditions
An isolated workspace has eligible customers, products, matching accounts, an open period and two open batches. Each branch owns separate financial records.
Steps
[ { "do": "Receive excess money, convert 20.00 into credit and attempt to void its source receipt. Spend part through settlement, refund another eligible part and cancel an unused grant in a separate branch. Reverse paid billing with credit remainder treatment. Use a lost-answer card settlement for one credit branch and issue a reduction memo releasing paid money in another.", "provenance": "proposed", "source": "services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the payment holds unapplied (over_application); services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the credit holds (insufficient_credit), the database’s CHECK, writing nothing; services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses voiding a credit with money applied (credit_has_applications); rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06" } ]
Expected
The live grant blocks source reversal; settlement and refund cannot consume the same available credit; cancelling unused receipt-derived credit restores its money; cancellation retains the separate remainder grant.
Data
Separate command keys, two customers, invoice lines, receipts and credit; controlled processor outcomes and a fixed calendar where the branch requires them.
Source
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the payment holds unapplied (over_application); services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses more than the credit holds (insufficient_credit), the database’s CHECK, writing nothing; services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it refuses voiding a credit with money applied (credit_has_applications); rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-008-settle-a-customer-s-invoices-with-credit-and-money.md#WF-ACC-TRX-008; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-010-reverse-billing-in-one-operation.md#WF-ACC-TRX-010; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-006-record-money-received-by-hand.md#BR-CAP-ACC-TRX-006-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-01; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-003-reduce-or-add-to-an-issued-invoice-with-credit-and-debit.md#BR-CAP-ACC-TRX-003-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06

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.