E2E SCENARIOS — SETTLEMENT & PAYMENT VOUCHERS
VietGara — Release 1.4, written for Release 5.0 (single payer, payment vouchers) · Version 1.0 — October 9, 2026
Covers FR-BIL-01, 03, 05 and 06, FR-DOC-01 (receipt and voucher PDFs) and FR-RPT-01 (the settled amount reaches the dashboard). The scenarios assume the single-payer settlement of Release 5.0; before that release the customer is the only payer by default and the voucher steps do not exist. Insurance is out of scope until Phase 17. Records are in 00_Test_Data.md §3.3. Automation is planned for Release 4.1.
| ID | Title | Priority | Automation |
|---|---|---|---|
| E2E-BIL-001 | Create a settlement from a closed repair order | P1 | Automated (API, partial) |
| E2E-BIL-002 | A repair order settles only once; an open order cannot be settled | P2 | Automated (API, partial) |
| E2E-BIL-003 | Record a partial payment, then the rest | P1 | Automated (API, partial) |
| E2E-BIL-004 | Each payment gets a numbered payment voucher | P1 | Automated (API, partial) |
| E2E-BIL-005 | Void a payment and restore the outstanding amount | P1 | Automated (API, partial) |
| E2E-BIL-006 | A retried payment request is recorded once (Idempotency-Key) | P2 | Automated (API, partial) |
| E2E-BIL-007 | Receipt and voucher PDFs show the garage’s legal header | P2 | Automated (API, partial) |
| E2E-BIL-008 | The outstanding filter and the dashboard revenue follow the settlement | P2 | Automated (API, partial) |
| E2E-BIL-009 | Permissions: billing view and billing write | P1 | Automated |
| E2E-BIL-010 | The daily transaction limit counts settlement creation | P2 | Automated (API, partial) |
E2E-BIL-001 · Create a settlement from a closed repair order
Priority: P1 · Covers: FR-BIL-01 · Automation: Automated (API, partial)
Preconditions: baseline. Signed in as MANAGER_A1, garage A1. A repair order for QA Customer An Nguyen, vehicle 51A-111.11, closed, total 970,000 VND (build it with E2E-QUO-001, E2E-QUO-010 and E2E-REP closing steps).
Steps
- Settlements → New settlement. Pick the closed repair order.
- Save.
Expected results
- The settlement is created with a number from the garage’s settlement template, status Pending, total
970,000 VND, and the customer and vehicle plate copied from the order. - It appears in the list and in the outstanding view.
- Opening it shows no payments yet.
E2E-BIL-002 · A repair order settles only once; an open order cannot be settled
Priority: P2 · Covers: FR-BIL-01 · Automation: Automated (API, partial)
Preconditions: baseline. MANAGER_A1, garage A1. One closed order that already has a settlement, and one order still in progress.
Steps
- Try to create a second settlement for the settled order.
- Try to create a settlement for the in-progress order.
Expected results
- Step 1 is refused: the repair order already has a settlement.
- Step 2 is refused: the repair order must be closed first.
E2E-BIL-003 · Record a partial payment, then the rest
Priority: P1 · Covers: FR-BIL-03 · Automation: Automated (API, partial)
Preconditions: the settlement of E2E-BIL-001, total 970,000 VND.
Test data: payment 1: 500000, cash. Payment 2: 470000, bank transfer, note Transfer 123.
Steps
- Record payment with payment 1.
- Record payment with payment 2.
- Try a third payment of
1000.
Expected results
- After step 1 the status is Partially paid, paid
500,000, outstanding470,000. - After step 2 the status is Paid, outstanding
0; the settlement leaves the outstanding view. - Step 3 is refused: nothing is outstanding.
E2E-BIL-004 · Each payment gets a numbered payment voucher
Priority: P1 · Covers: FR-BIL-05 · Automation: Automated (API, partial)
Preconditions: the two payments of E2E-BIL-003.
Steps
- Open the settlement and read the vouchers list.
- Open the PDF of each voucher.
Expected results
- Two vouchers with consecutive numbers from the garage’s voucher template (sequence continues across settlements of the same garage and restarts per the template’s period).
- Each PDF shows the payer name, reason, amount in figures and in words, method, collector and the signature blocks.
- Garage A2 has its own, independent numbering.
E2E-BIL-005 · Void a payment and restore the outstanding amount
Priority: P1 · Covers: FR-BIL-06 · Automation: Automated (API, partial)
Preconditions: the paid settlement of E2E-BIL-003.
Steps
- Void payment 2 with the reason
Entered twice. - Open the voided voucher.
Expected results
- The settlement returns to Partially paid, outstanding
470,000, and re-enters the outstanding view. - The voucher stays on file marked Void with the reason; its PDF carries the void mark.
- Voiding without a reason is refused. The audit log shows who voided it.
E2E-BIL-006 · A retried payment request is recorded once
Priority: P2 · Covers: FR-BIL-03 · Automation: Automated (API, partial) (API level)
Preconditions: a pending settlement.
Steps
- Send the same record-payment request twice with the same
Idempotency-Key. - Send it a third time with a new key and the same body.
Expected results
- The first two produce one payment and one voucher; the second answer repeats the first.
- The third records a new payment (a new key is a new intent).
E2E-BIL-007 · Receipt and voucher PDFs show the garage’s legal header
Priority: P2 · Covers: FR-TEN-06, FR-DOC-01 · Automation: Manual only (visual check)
Preconditions: OWNER_A has set the legal name, tax ID, address and a logo on garage A1 (Release 5.0).
Steps
- Download the receipt PDF of a settlement and a voucher PDF.
Expected results
- Both show the logo, legal name, tax ID and address in the header; amounts use thousand separators.
- Changing the legal name afterwards does not change an already issued voucher.
E2E-BIL-008 · The outstanding filter and the dashboard revenue follow the settlement
Priority: P2 · Covers: FR-REC-01, FR-RPT-01 · Automation: Automated (API, partial)
Preconditions: a fully paid and a partially paid settlement today.
Steps
- Filter settlements by Outstanding only.
- Open the Dashboard.
Expected results
- Only the partially paid settlement is listed.
- The revenue figure for today includes the settlement totals created today, matching the revenue API.
E2E-BIL-009 · Permissions: billing view and billing write
Priority: P1 · Covers: FR-IAM-03 · Automation: Automated
Preconditions: baseline.
Steps
- Sign in as ADVISOR_A1 (no billing permission) and open Settlements.
- Sign in as a staff member with billing view only and try to create a settlement or record a payment.
Expected results
- Step 1 hides the menu and the API answers permission denied.
- Step 2 shows the list and detail but no create, payment or void actions.
E2E-BIL-010 · The daily transaction limit counts settlement creation
Priority: P2 · Covers: FR-LIC-02 · Automation: Automated (API, partial)
Preconditions: OWNER_B on the trial plan with a limit already used up by quotes and repair orders for the day.
Steps
- Try to create a settlement.
Expected results
- The request is refused with the plan-limit message; the limit resets the next day (the clock is faked in the test environment).