Skip to content

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.

IDTitlePriorityAutomation
E2E-BIL-001Create a settlement from a closed repair orderP1Automated (API, partial)
E2E-BIL-002A repair order settles only once; an open order cannot be settledP2Automated (API, partial)
E2E-BIL-003Record a partial payment, then the restP1Automated (API, partial)
E2E-BIL-004Each payment gets a numbered payment voucherP1Automated (API, partial)
E2E-BIL-005Void a payment and restore the outstanding amountP1Automated (API, partial)
E2E-BIL-006A retried payment request is recorded once (Idempotency-Key)P2Automated (API, partial)
E2E-BIL-007Receipt and voucher PDFs show the garage’s legal headerP2Automated (API, partial)
E2E-BIL-008The outstanding filter and the dashboard revenue follow the settlementP2Automated (API, partial)
E2E-BIL-009Permissions: billing view and billing writeP1Automated
E2E-BIL-010The daily transaction limit counts settlement creationP2Automated (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

  1. Settlements → New settlement. Pick the closed repair order.
  2. 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

  1. Try to create a second settlement for the settled order.
  2. 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

  1. Record payment with payment 1.
  2. Record payment with payment 2.
  3. Try a third payment of 1000.

Expected results

  • After step 1 the status is Partially paid, paid 500,000, outstanding 470,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

  1. Open the settlement and read the vouchers list.
  2. 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

  1. Void payment 2 with the reason Entered twice.
  2. 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

  1. Send the same record-payment request twice with the same Idempotency-Key.
  2. 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).

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

  1. 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

  1. Filter settlements by Outstanding only.
  2. 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

  1. Sign in as ADVISOR_A1 (no billing permission) and open Settlements.
  2. 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

  1. 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).