Skip to content

ATS-ACC-TRX-005Prepare and deliver invoice documents: Capability Test Specification

Markdown

ATS-ACC-TRX-005

Prepare and deliver invoice documents: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-ACC-TRX-005

Design

Executed by
TST-ACC-TRX-007, TST-ACC-TRX-051, TST-ACC-TRX-060

KindAcceptance test setProduct areaAccountingModuleTransactionsRevision1

Read atservices-accounting f47cb263

Coverage

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

Test Scenarios

8 scenarios proving CAP-ACC-TRX-005; 6 bound to an existing test.

01 Rendering selects the applicable document designruleapitest
Proves
BR-CAP-ACC-TRX-005-01
Preconditions
Examples use invoice, unit and default templates plus inactive and wrong-kind choices.
Steps
[ { "do": "Render each invoice.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/invoices/render-invoice.integration.spec.js#it is the invoice’s own template over its unit’s" } ]
Expected
The precedence selects the proper design and invalid named choices fail.
Data
Valid and invalid template records.
Bound to
services-accounting:modules/transactions/tests/integration/services/invoices/render-invoice.integration.spec.js#it is the built-in invoice when neither the invoice nor its unit names one
Source
services-accounting:modules/transactions/tests/integration/services/invoices/render-invoice.integration.spec.js#it is the invoice’s own template over its unit’s
02 Invoice output is generated on requestinvariantapitest
Proves
BR-CAP-ACC-TRX-005-02
Preconditions
An invoice has issued.
Steps
[ { "do": "Request HTML and an unsupported format.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it refuses a format other than html: 400" } ]
Expected
Fresh HTML contains the document data; unsupported format fails without a stored rendering.
Data
A real invoice with identifiable content.
Bound to
services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it renders the invoice with its template, and its e-mail
Source
services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it refuses a format other than html: 400
03 Sending requires an issued bill and recipientsvalidationapinegativetest
Proves
BR-CAP-ACC-TRX-005-03 BR-CAP-ACC-TRX-005-04
Preconditions
Draft, addressless contact, organization and addressed contact examples exist.
Steps
[ { "do": "Attempt each send, supply explicit recipients, then submit eleven or malformed addresses.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses a draft: it has no number and no receivable" } ]
Expected
Ineligible sends fail; explicit recipients replace the default and invalid recipient lists fail.
Data
Contacts with varied e-mail availability.
Bound to
services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses an invoice whose bill-to contact has no address, in 1.0’s words
services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it goes to the addresses the caller names instead, canonical, without the contact as a recipient
Source
services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses a draft: it has no number and no receivable
04 Communication retry retains one submissionedgeapitest
Proves
BR-CAP-ACC-TRX-005-05
Preconditions
A sendable invoice exists.
Steps
[ { "do": "Send without a key, then repeat a keyed send.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses an e-mail without an idempotency key: 400 idempotency_key_required" } ]
Expected
Missing identity fails and repetition retains one submission reference.
Data
A communication-capable invoice.
Bound to
services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses an e-mail without an idempotency key: 400 idempotency_key_required
services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it answers the request’s derived id, the same for the repeated key, and one pointer row names it
Source
services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses an e-mail without an idempotency key: 400 idempotency_key_required
05 Submission failure rolls back delivery evidencefailureapinegativetest
Proves
BR-CAP-ACC-TRX-005-06
Preconditions
The communication sender throws during submission.
Steps
[ { "do": "Request invoice delivery.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it writes nothing, not even the event, when the sender’s statement fails: the command’s transaction rolls back" } ]
Expected
Neither the communication request nor e-mail event remains.
Data
A failing sender test double.
Bound to
services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it writes nothing, not even the event, when the sender’s statement fails: the command’s transaction rolls back
Source
services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it writes nothing, not even the event, when the sender’s statement fails: the command’s transaction rolls back
06 Viewing and delivery use separate authoritiespermissionapinegativetest
Proves
BR-CAP-ACC-TRX-005-07
Preconditions
One identity reads and another can send.
Steps
[ { "do": "Request document and e-mail through each identity.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it refuses the e-mail to a principal holding only accounting.invoices.read: 403, submitting nothing" } ]
Expected
Both can view but only the sender can deliver.
Data
Read and send personas.
Bound to
services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it renders for a principal holding only accounting.invoices.read
services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it refuses the e-mail to a principal holding only accounting.invoices.read: 403, submitting nothing
services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it sends the e-mail for a principal holding accounting.invoices.email
Source
services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it refuses the e-mail to a principal holding only accounting.invoices.read: 403, submitting nothing
07 Rendering follows eligible amendmentinteractionapiproposed
Proves
BR-CAP-ACC-TRX-005-02 BR-CAP-ACC-TRX-005-05 BR-CAP-ACC-TRX-005-06 BR-CAP-ACC-TRX-002-01 BR-CAP-ACC-TRX-002-03
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": "Render an issued 80.00 bill, amend an unpaid line to 100.00, then render and send the changed bill under a fresh delivery key.", "provenance": "proposed", "source": "services-accounting:modules/transactions/tests/e2e/invoice-documents.e2e.spec.js#it refuses a format other than html: 400; services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses an e-mail without an idempotency key: 400 idempotency_key_required; services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it writes nothing, not even the event, when the sender’s statement fails: the command’s transaction rolls back; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-016-e-mail-an-invoice.md#WF-ACC-TRX-016; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-005-send-a-customer-their-invoice.md#BR-CAP-ACC-TRX-005-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-005-send-a-customer-their-invoice.md#BR-CAP-ACC-TRX-005-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-005-send-a-customer-their-invoice.md#BR-CAP-ACC-TRX-005-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-002-correct-or-cancel-an-issued-invoice-before-its-batch-posts.md#BR-CAP-ACC-TRX-002-01; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-002-correct-or-cancel-an-issued-invoice-before-its-batch-posts.md#BR-CAP-ACC-TRX-002-03" } ]
Expected
The later document shows the revised amount and revision; delivery submission retains the current rendering without replacing the earlier financial history.
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/e2e/invoice-documents.e2e.spec.js#it refuses a format other than html: 400; services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses an e-mail without an idempotency key: 400 idempotency_key_required; services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it writes nothing, not even the event, when the sender’s statement fails: the command’s transaction rolls back; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-016-e-mail-an-invoice.md#WF-ACC-TRX-016; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-005-send-a-customer-their-invoice.md#BR-CAP-ACC-TRX-005-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-005-send-a-customer-their-invoice.md#BR-CAP-ACC-TRX-005-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-005-send-a-customer-their-invoice.md#BR-CAP-ACC-TRX-005-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-002-correct-or-cancel-an-issued-invoice-before-its-batch-posts.md#BR-CAP-ACC-TRX-002-01; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-002-correct-or-cancel-an-issued-invoice-before-its-batch-posts.md#BR-CAP-ACC-TRX-002-03
08 Recipient count accepts the limit and rejects one moreboundaryapinegativeproposed
Proves
BR-CAP-ACC-TRX-005-04
Preconditions
An issued bill has ten distinct valid explicit recipients and a working sender.
Steps
[ { "do": "Send to ten recipients, then submit a separately keyed request naming eleven.", "provenance": "proposed", "source": "services-accounting:modules/transactions/services/invoices/invoice-emails.ts:emailInvoice; services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses more than ten addresses: 400" } ]
Expected
The first request supplies one communication for the ten recipients; the second fails before submission.
Data
Branch-owned records in one configured workspace, valid accounting context and controlled requests at the stated boundary.
Source
services-accounting:modules/transactions/services/invoices/invoice-emails.ts:emailInvoice; services-accounting:modules/transactions/tests/integration/services/invoices/email-invoice.integration.spec.js#it refuses more than ten addresses: 400

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.