Admin CRM — Invoice Test Cases

A. Document controlA. Kiểm soát tài liệu

Doc IDCPG-TC-CPG-CRM_Invoice_TestCases
VersionPhiên bản1.0
StatusTrạng tháiDraft
OwnerCPG BA / Architecture
AudienceĐối tượngQA, Product, Backend, Frontend
ClassificationPhân loạiInternal
Effective dateNgày hiệu lực01/12/2026
Related docs CRM Invoice UC · CRM Invoice FSD

B. Version historyB. Lịch sử phiên bản

Version Date Author ChangesThay đổi
1.0 01/12/2026 Khoa Trinh Version 1.0

C. Table of contentsC. Mục lục

D. ContentD. Nội dung

Index

Test ID Test name BR UC Category
TC-CRM-INV-001 Sidebar hides Invoices without invoice:view API-Invoice-Admin; invoice:view UC-INV-ACCESS Security
TC-CRM-INV-002 Route /invoices requires invoice:view API-Invoice-Admin; invoice:view UC-INV-ACCESS Security
TC-CRM-INV-003 Tab read deny shows no-access message API-Invoice-Admin; invoices.list UC-INV-ACCESS Security
TC-CRM-INV-004 Export buttons hidden for view-only user INV-EXPORT-03; invoice:manage UC-INV-ACCESS Security
TC-CRM-INV-005 Detail Download PDF hidden for view-only user INV-DETAIL-06; invoice:manage UC-INV-ACCESS Security
TC-CRM-INV-006 Manage without view cannot open invoices route invoice:manage; invoice:view UC-INV-ACCESS Security
TC-CRM-INV-007 Default list load shows invoices sorted by invoice date DESC F1; INV-LIST-02 UC-INV-F1 Function
TC-CRM-INV-008 Page size is 10 and footer shows entry range F1; INV-LIST-07 UC-INV-F1 Function
TC-CRM-INV-009 Empty list shows empty state F1; INV-LIST-08 UC-INV-F1 Function
TC-CRM-INV-010 Pagination next/prev navigates pages with applied filters F1; INV-LIST-07 UC-INV-F1 Function
TC-CRM-INV-011 List columns render required Admin fields F1; INV-LIST-03; INV-LIST-04; INV-LIST-05; INV-LIST-06 UC-INV-F1 Function
TC-CRM-INV-012 Row # is pagination-aware F1; INV-LIST-07 UC-INV-F1 Function
TC-CRM-INV-013 Loading state shown while list request in flight F1 UC-INV-F1 Function
TC-CRM-INV-014 Changing filters without Search does not reload list F2; INV-FILTER-08 UC-INV-F2 Function
TC-CRM-INV-015 Search by Order ID filters list F2; INV-FILTER-08; INV-FILTER-06 UC-INV-F2 Function
TC-CRM-INV-016 Search by Invoice Number filters list F2; INV-FILTER-06 UC-INV-F2 Function
TC-CRM-INV-017 Status filter maps UI label to API enum F2; INV-FILTER-01 UC-INV-F2 Function
TC-CRM-INV-018 From Date after To Date blocks Search F2; INV-FILTER-04 UC-INV-F2 Validation
TC-CRM-INV-019 Valid date range filters by invoice date F2; INV-FILTER-04 UC-INV-F2 Function
TC-CRM-INV-020 Merchant filter sends UUID not business code F2; API-Invoice-Admin UC-INV-F2 Function
TC-CRM-INV-021 Combined filters and clear merchant restore broader list F2; INV-FILTER-01; INV-FILTER-02 UC-INV-F2 Function
TC-CRM-INV-022 Merchant autocomplete requires min 2 characters F2 UC-INV-F2 Function
TC-CRM-INV-023 Empty filters after Search returns all invoices F2; INV-FILTER-02 UC-INV-F2 Function
TC-CRM-INV-024 Click Invoice Number opens detail modal F4; INV-LIST-03 UC-INV-F4 Function
TC-CRM-INV-025 Click Order ID opens same detail modal F4; INV-LIST-04 UC-INV-F4 Function
TC-CRM-INV-026 Detail modal is read-only F4; INV-DETAIL-01; INV-DETAIL-07 UC-INV-F4 Function
TC-CRM-INV-027 Paid Date shown only for Paid invoices F4; INV-DETAIL-04 UC-INV-F4 Function
TC-CRM-INV-028 Detail shows line items with # and totals including discount F4; INV-DETAIL-05 UC-INV-F4 Function
TC-CRM-INV-029 Bill To shows customer name and email F4 UC-INV-F4 Function
TC-CRM-INV-030 From section shows Merchant ID link only F4 UC-INV-F4 Function
TC-CRM-INV-031 Notes section appears when notes present F4 UC-INV-F4 Function
TC-CRM-INV-032 Detail refresh banner while GET detail in flight F4 UC-INV-F4 Function
TC-CRM-INV-033 Status badges use correct colors on list F5; INV-LIST-05; INV-DETAIL-03 UC-INV-F5 Function
TC-CRM-INV-034 No manual status change control on Admin UI F5; INV-STATUS-01 UC-INV-F5 Function
TC-CRM-INV-035 Export CSV downloads with applied filters F6; INV-EXPORT-01; INV-EXPORT-03 UC-INV-F6 Function
TC-CRM-INV-036 Export Excel downloads with applied filters F6; INV-EXPORT-01 UC-INV-F6 Function
TC-CRM-INV-037 Export PDF (list) downloads with applied filters F6; INV-EXPORT-01 UC-INV-F6 Function
TC-CRM-INV-038 Async export 202 polls then downloads file F6; INV-EXPORT-04 UC-INV-F6 NFR
TC-CRM-INV-039 Starting second export aborts in-flight export F6 UC-INV-F6 NFR
TC-CRM-INV-040 Modal Download PDF fetches single invoice PDF F4; INV-DETAIL-06; INV-EXPORT-03 UC-INV-F4 Function
TC-CRM-INV-041 List merchant name navigates to merchant detail API-Invoice-Admin UC-INV-NAV Function
TC-CRM-INV-042 Detail Merchant ID link closes modal and opens merchant API-Invoice-Admin UC-INV-NAV Function
TC-CRM-INV-043 Breadcrumb Home navigates to dashboard F1 UC-INV-NAV Function
TC-CRM-INV-044 List API failure shows toast and empty list F1 UC-INV-ERR Function
TC-CRM-INV-045 Detail 404 shows Invoice not found toast F4 UC-INV-ERR Function
TC-CRM-INV-046 Detail non-404 error shows failure toast F4 UC-INV-ERR Function
TC-CRM-INV-047 Export API 403 surfaces error toast F6; INV-EXPORT-03 UC-INV-ERR Security
TC-CRM-INV-048 Merchant search failure clears options silently F2 UC-INV-ERR Function
TC-CRM-INV-049 Unfiltered Admin list spans multiple merchants API-Invoice-Admin UC-INV-ADMIN Function
TC-CRM-INV-050 Admin can open detail for another merchant invoice API-Invoice-Admin UC-INV-ADMIN Function
TC-CRM-INV-051 Admin export without merchant filter can include cross-merchant rows API-Invoice-Admin; INV-EXPORT-02 (Admin variant) UC-INV-ADMIN Function

Test cases

TC-CRM-INV-001

Field Value
Test ID TC-CRM-INV-001
Business Requirement ID API-Invoice-Admin; invoice:view
Category Security
Use Case ID UC-INV-ACCESS
Test name Sidebar hides Invoices without invoice:view
Preconditions Signed in as Admin-NoInvoice.
Data User permissions exclude invoice:view.
Steps 1. Open Admin CRM after sign-in.
2. Inspect the left sidebar menu.
Expected result Invoices menu item is not visible. Direct navigation to /invoices is blocked by PermissionGuard (redirect away from invoices).

TC-CRM-INV-002

Field Value
Test ID TC-CRM-INV-002
Business Requirement ID API-Invoice-Admin; invoice:view
Category Security
Use Case ID UC-INV-ACCESS
Test name Route /invoices requires invoice:view
Preconditions Signed in as Admin-NoInvoice.
Data Target URL /invoices.
Steps 1. Paste /invoices into the address bar and navigate.
2. Observe landing page.
Expected result User does not see the Invoices page content. Guard redirects to an allowed route (e.g. /).

TC-CRM-INV-003

Field Value
Test ID TC-CRM-INV-003
Business Requirement ID API-Invoice-Admin; invoices.list
Category Security
Use Case ID UC-INV-ACCESS
Test name Tab read deny shows no-access message
Preconditions Signed in as Admin-TabDeny (global invoice:view present; grants array exists without read on invoices.list).
Data N/A
Steps 1. Navigate to /invoices.
2. Observe main card content.
Expected result Message “You do not have access to the invoice list.” is shown. Filters, table, and export buttons are not rendered. List API is not called.

TC-CRM-INV-004

Field Value
Test ID TC-CRM-INV-004
Business Requirement ID INV-EXPORT-03; invoice:manage
Category Security
Use Case ID UC-INV-ACCESS
Test name Export buttons hidden for view-only user
Preconditions Signed in as Admin-ViewOnly. Invoice list loads successfully.
Data N/A
Steps 1. Open /invoices.
2. Inspect page header actions.
Expected result Export CSV, Export Excel, and Export PDF buttons are not visible.

TC-CRM-INV-005

Field Value
Test ID TC-CRM-INV-005
Business Requirement ID INV-DETAIL-06; invoice:manage
Category Security
Use Case ID UC-INV-ACCESS
Test name Detail Download PDF hidden for view-only user
Preconditions Signed in as Admin-ViewOnly. At least one invoice exists.
Data Any list invoice.
Steps 1. Open an invoice detail modal from the list.
2. Inspect modal footer actions.
Expected result Download PDF button is not shown. Close button is available.

TC-CRM-INV-006

Field Value
Test ID TC-CRM-INV-006
Business Requirement ID invoice:manage; invoice:view
Category Security
Use Case ID UC-INV-ACCESS
Test name Manage without view cannot open invoices route
Preconditions Admin user has invoice:manage but not invoice:view.
Data URL /invoices.
Steps 1. Sign in with manage-only permissions.
2. Navigate to /invoices.
Expected result Route PermissionGuard requires invoice:view; page is not accessible despite manage permission.

TC-CRM-INV-007

Field Value
Test ID TC-CRM-INV-007
Business Requirement ID F1; INV-LIST-02
Category Function
Use Case ID UC-INV-F1
Test name Default list load shows invoices sorted by invoice date DESC
Preconditions Signed in as Admin-Manage. Backend has ≥2 invoices with different invoice_date values.
Data No filters applied.
Steps 1. Open /invoices.
2. Wait until loading completes.
3. Compare Invoice Date column order on page 1.
Expected result List loads without error. Rows are ordered by Invoice Date descending (newest first). Loading text disappears.

TC-CRM-INV-008

Field Value
Test ID TC-CRM-INV-008
Business Requirement ID F1; INV-LIST-07
Category Function
Use Case ID UC-INV-F1
Test name Page size is 10 and footer shows entry range
Preconditions Admin-Manage. Total invoices ≥ 11.
Data Unfiltered list.
Steps 1. Open /invoices.
2. Count rows in the table.
3. Read pagination footer text.
Expected result Exactly 10 data rows on page 1. Footer shows “Showing 1 to 10 of {total} entries” where total matches API pagination.total.

TC-CRM-INV-009

Field Value
Test ID TC-CRM-INV-009
Business Requirement ID F1; INV-LIST-08
Category Function
Use Case ID UC-INV-F1
Test name Empty list shows empty state
Preconditions Admin-Manage. Environment has zero invoices (or filters that match none).
Data Filters that return 0 rows, or empty dataset.
Steps 1. Open /invoices (or Search with filters that match nothing).
2. Observe content area after load.
Expected result Message “No invoices found.” is displayed. No table rows. Footer not shown (or zero entries).

TC-CRM-INV-010

Field Value
Test ID TC-CRM-INV-010
Business Requirement ID F1; INV-LIST-07
Category Function
Use Case ID UC-INV-F1
Test name Pagination next/prev navigates pages with applied filters
Preconditions Admin-Manage. ≥21 invoices matching a status filter (e.g. Paid).
Data Status = Paid applied via Search.
Steps 1. Set Status=Paid and click Search.
2. Click page 2 (or Next).
3. Click Prev back to page 1.
4. Confirm Status filter still Paid (re-search not required for page change).
Expected result Page 2 shows next 10 matching Paid invoices. Row # continues globally (11…). Prev returns to page 1. Applied status filter remains in effect for subsequent page requests.

TC-CRM-INV-011

Field Value
Test ID TC-CRM-INV-011
Business Requirement ID F1; INV-LIST-03; INV-LIST-04; INV-LIST-05; INV-LIST-06
Category Function
Use Case ID UC-INV-F1
Test name List columns render required Admin fields
Preconditions Admin-Manage. At least one invoice with merchant name, email, amount, status.
Data Any visible row.
Steps 1. Open /invoices.
2. Inspect table headers and first row cells.
Expected result Columns present: #, Invoice Number, Order ID, Merchant, Customer Email, Amount, Status, Invoice Date, Due Date. Amount includes asset (e.g. 1,250.00 USDT). Status is a colored badge. Invoice Number and Order ID are clickable. Merchant is clickable. Product Code column is absent.

TC-CRM-INV-012

Field Value
Test ID TC-CRM-INV-012
Business Requirement ID F1; INV-LIST-07
Category Function
Use Case ID UC-INV-F1
Test name Row # is pagination-aware
Preconditions Admin-Manage. ≥11 invoices.
Data Unfiltered list.
Steps 1. Note # values on page 1.
2. Go to page 2.
3. Note # values.
Expected result Page 1 # values are 1–10. Page 2 starts at 11 (startIndex + index + 1).

TC-CRM-INV-013

Field Value
Test ID TC-CRM-INV-013
Business Requirement ID F1
Category Function
Use Case ID UC-INV-F1
Test name Loading state shown while list request in flight
Preconditions Admin-Manage. Ability to observe slow network (throttle) or first paint.
Data N/A
Steps 1. Hard-refresh /invoices with network throttled.
2. Observe content before response returns.
Expected result “Loading invoices…” is displayed until the list response is applied.

TC-CRM-INV-014

Field Value
Test ID TC-CRM-INV-014
Business Requirement ID F2; INV-FILTER-08
Category Function
Use Case ID UC-INV-F2
Test name Changing filters without Search does not reload list
Preconditions Admin-Manage. Initial unfiltered list loaded.
Data Type an Order ID that would exclude current rows, but do not click Search.
Steps 1. Note first invoice order id on screen.
2. Enter a different Order ID in the filter.
3. Do not click Search.
4. Observe table.
Expected result Table still shows the previously loaded (unfiltered) results until Search is clicked.

TC-CRM-INV-015

Field Value
Test ID TC-CRM-INV-015
Business Requirement ID F2; INV-FILTER-08; INV-FILTER-06
Category Function
Use Case ID UC-INV-F2
Test name Search by Order ID filters list
Preconditions Admin-Manage. Known order_id ORD-KNOWN on Merchant-A.
Data Order ID = ORD-KNOWN.
Steps 1. Enter ORD-KNOWN in Order ID.
2. Click Search.
3. Review returned rows.
Expected result Only invoices whose order_id matches (exact/partial per API) are shown. Request includes order_id query param.

TC-CRM-INV-016

Field Value
Test ID TC-CRM-INV-016
Business Requirement ID F2; INV-FILTER-06
Category Function
Use Case ID UC-INV-F2
Test name Search by Invoice Number filters list
Preconditions Admin-Manage. Known invoice_code e.g. INV000001.
Data Invoice Number = INV000001.
Steps 1. Enter INV000001 in Invoice Number.
2. Click Search.
Expected result Matching invoice(s) returned. API query uses invoice_id=INV000001.

TC-CRM-INV-017

Field Value
Test ID TC-CRM-INV-017
Business Requirement ID F2; INV-FILTER-01
Category Function
Use Case ID UC-INV-F2
Test name Status filter maps UI label to API enum
Preconditions Admin-Manage. Mix of Paid and Pending invoices.
Data Status = Paid.
Steps 1. Select Status Paid.
2. Click Search.
3. Inspect Network request query (optional) and row statuses.
Expected result All listed rows show Paid badge. Request sends status=PAID (not “Paid”).

TC-CRM-INV-018

Field Value
Test ID TC-CRM-INV-018
Business Requirement ID F2; INV-FILTER-04
Category Validation
Use Case ID UC-INV-F2
Test name From Date after To Date blocks Search
Preconditions Admin-Manage on /invoices.
Data Date-Invalid: From = 2026-12-01, To = 2026-11-01.
Steps 1. Set From Date later than To Date.
2. Click Search.
Expected result Inline error “From Date must be on or before To Date.” Search does not fire a new list request. List unchanged.

TC-CRM-INV-019

Field Value
Test ID TC-CRM-INV-019
Business Requirement ID F2; INV-FILTER-04
Category Function
Use Case ID UC-INV-F2
Test name Valid date range filters by invoice date
Preconditions Admin-Manage. Invoices inside and outside Date-Valid window.
Data Date-Valid range.
Steps 1. Set From/To within Date-Valid.
2. Click Search.
3. Check Invoice Date values.
Expected result Only invoices with invoice_date within the local-day window (sent as ISO from/to instants) appear.

TC-CRM-INV-020

Field Value
Test ID TC-CRM-INV-020
Business Requirement ID F2; API-Invoice-Admin
Category Function
Use Case ID UC-INV-F2
Test name Merchant filter sends UUID not business code
Preconditions Admin-Manage. Merchant-A searchable by name; UUID m_A known.
Data Merchant search term ≥2 chars matching Merchant-A.
Steps 1. Type merchant name (≥2 chars); wait for dropdown.
2. Select Merchant-A.
3. Click Search.
4. Inspect request merchant_id (devtools).
Expected result Dropdown appears after debounce. Selected merchant applies. API merchant_id equals merchant UUID (m_A), not MER-A business code. Results limited to that merchant when Admin overlay is live.

TC-CRM-INV-021

Field Value
Test ID TC-CRM-INV-021
Business Requirement ID F2; INV-FILTER-01; INV-FILTER-02
Category Function
Use Case ID UC-INV-F2
Test name Combined filters and clear merchant restore broader list
Preconditions Admin-Manage. Multiple merchants with invoices.
Data Merchant-A + Status Pending.
Steps 1. Select Merchant-A, Status=Pending, Search.
2. Clear merchant selection.
3. Set Status=All, Search again.
Expected result Step 1 returns Pending for Merchant-A only. After clear + All Status search, list returns broader (all merchants when Admin overlay live). Filters combine when both set.

TC-CRM-INV-022

Field Value
Test ID TC-CRM-INV-022
Business Requirement ID F2
Category Function
Use Case ID UC-INV-F2
Test name Merchant autocomplete requires min 2 characters
Preconditions Admin-Manage on /invoices.
Data Search term “A” (1 char) then “Ac” (2 chars).
Steps 1. Type 1 character in Merchant search.
2. Type a second character.
3. Observe dropdown / network.
Expected result No merchant search call for length < 2. At length ≥ 2, after ~300ms debounce, merchant options load (or empty on no match).

TC-CRM-INV-023

Field Value
Test ID TC-CRM-INV-023
Business Requirement ID F2; INV-FILTER-02
Category Function
Use Case ID UC-INV-F2
Test name Empty filters after Search returns all invoices
Preconditions Admin-Manage. Previously applied a status filter.
Data Clear all filter fields; Status=All; Account=All.
Steps 1. Apply Status=Paid and Search.
2. Reset Status to All, clear text fields, clear merchant.
3. Click Search.
Expected result Second Search returns the unfiltered (or all-status) invoice set subject to Admin ownership rules.

TC-CRM-INV-024

Field Value
Test ID TC-CRM-INV-024
Business Requirement ID F4; INV-LIST-03
Category Function
Use Case ID UC-INV-F4
Test name Click Invoice Number opens detail modal
Preconditions Admin-Manage. List has INV-PENDING.
Data Invoice Number link.
Steps 1. Click Invoice Number on a row.
2. Observe modal.
Expected result Detail modal opens. GET /invoices/{id} is called. Header shows INVOICE and subtitle “Flypay Gateway Invoice”.

TC-CRM-INV-025

Field Value
Test ID TC-CRM-INV-025
Business Requirement ID F4; INV-LIST-04
Category Function
Use Case ID UC-INV-F4
Test name Click Order ID opens same detail modal
Preconditions Admin-Manage. List has a row with order id.
Data Order ID link.
Steps 1. Click Order ID on a row.
Expected result Same invoice detail modal opens for that invoice.

TC-CRM-INV-026

Field Value
Test ID TC-CRM-INV-026
Business Requirement ID F4; INV-DETAIL-01; INV-DETAIL-07
Category Function
Use Case ID UC-INV-F4
Test name Detail modal is read-only
Preconditions Admin-Manage. Detail open.
Data Any invoice detail.
Steps 1. Open detail.
2. Attempt to edit any field (name, amounts, status).
Expected result No editable inputs for invoice content. Only Close and optional Download PDF actions.

TC-CRM-INV-027

Field Value
Test ID TC-CRM-INV-027
Business Requirement ID F4; INV-DETAIL-04
Category Function
Use Case ID UC-INV-F4
Test name Paid Date shown only for Paid invoices
Preconditions Admin-Manage. INV-PAID and INV-PENDING exist.
Data Open INV-PAID then INV-PENDING.
Steps 1. Open Paid invoice detail; note dates.
2. Close and open Pending invoice detail.
Expected result Paid invoice shows Paid Date. Pending invoice does not show Paid Date row.

TC-CRM-INV-028

Field Value
Test ID TC-CRM-INV-028
Business Requirement ID F4; INV-DETAIL-05
Category Function
Use Case ID UC-INV-F4
Test name Detail shows line items with # and totals including discount
Preconditions Admin-Manage. Invoice with ≥1 line item and discount_amount from API.
Data Invoice with items, subtotal, discount, tax, total.
Steps 1. Open detail and wait for detail refresh.
2. Inspect line items table and totals.
Expected result Line table columns: #, Item Description, Qty, Unit Price, Total; # starts at 1. Totals show Subtotal, Discount, Tax, Total Amount. Amounts include asset formatting when provided.

TC-CRM-INV-029

Field Value
Test ID TC-CRM-INV-029
Business Requirement ID F4
Category Function
Use Case ID UC-INV-F4
Test name Bill To shows customer name and email
Preconditions Admin-Manage. Invoice with customer_name and customer_email.
Data customer_name and customer_email populated.
Steps 1. Open detail.
2. Inspect Bill To section.
Expected result Customer name displayed above customer email (or — when missing).

TC-CRM-INV-030

Field Value
Test ID TC-CRM-INV-030
Business Requirement ID F4
Category Function
Use Case ID UC-INV-F4
Test name From section shows Merchant ID link only
Preconditions Admin-Manage. Detail open.
Data merchant_id present.
Steps 1. Open detail.
2. Inspect From section.
Expected result From shows Merchant ID as a link. Merchant name and merchant address are not shown in From. Blockchain is not shown.

TC-CRM-INV-031

Field Value
Test ID TC-CRM-INV-031
Business Requirement ID F4
Category Function
Use Case ID UC-INV-F4
Test name Notes section appears when notes present
Preconditions Admin-Manage. One invoice with notes, one without.
Data notes = “Net 10” vs empty.
Steps 1. Open invoice with notes.
2. Open invoice without notes.
Expected result Notes section visible only when notes are non-empty.

TC-CRM-INV-032

Field Value
Test ID TC-CRM-INV-032
Business Requirement ID F4
Category Function
Use Case ID UC-INV-F4
Test name Detail refresh banner while GET detail in flight
Preconditions Admin-Manage. Throttled network.
Data Any list row.
Steps 1. Click invoice number with slow network.
2. Observe modal during fetch.
Expected result Modal can open with list-row data; “Refreshing invoice details…” appears until detail response replaces content.

TC-CRM-INV-033

Field Value
Test ID TC-CRM-INV-033
Business Requirement ID F5; INV-LIST-05; INV-DETAIL-03
Category Function
Use Case ID UC-INV-F5
Test name Status badges use correct colors on list
Preconditions Admin-Manage. Samples of Paid, Pending, Overdue, Cancelled.
Data Four status values visible (filter as needed).
Steps 1. Locate each status in the list.
2. Compare badge styling.
Expected result Paid=green, Pending=yellow, Overdue=red, Cancelled=gray. Detail badge matches list status for the same invoice.

TC-CRM-INV-034

Field Value
Test ID TC-CRM-INV-034
Business Requirement ID F5; INV-STATUS-01
Category Function
Use Case ID UC-INV-F5
Test name No manual status change control on Admin UI
Preconditions Admin-Manage. Detail open.
Data N/A
Steps 1. Open detail for Pending invoice.
2. Look for status edit / dropdown / save.
Expected result No UI to change status. Status is display-only (system-driven).

TC-CRM-INV-035

Field Value
Test ID TC-CRM-INV-035
Business Requirement ID F6; INV-EXPORT-01; INV-EXPORT-03
Category Function
Use Case ID UC-INV-F6
Test name Export CSV downloads with applied filters
Preconditions Admin-Manage. Status=Paid applied via Search.
Data format=csv; applied filters Status=Paid.
Steps 1. Apply Paid filter and Search.
2. Click Export CSV.
3. Open downloaded file.
Expected result Download starts. Toast “Downloaded {filename}”. File content reflects Paid (filtered) set, not only current page of 10. Export buttons temporarily disabled during request.

TC-CRM-INV-036

Field Value
Test ID TC-CRM-INV-036
Business Requirement ID F6; INV-EXPORT-01
Category Function
Use Case ID UC-INV-F6
Test name Export Excel downloads with applied filters
Preconditions Admin-Manage. Filters applied (e.g. date range).
Data format=excel.
Steps 1. Apply filters and Search.
2. Click Export Excel.
Expected result Spreadsheet download succeeds. Filename sanitized from Content-Disposition when provided. Respects applied filters.

TC-CRM-INV-037

Field Value
Test ID TC-CRM-INV-037
Business Requirement ID F6; INV-EXPORT-01
Category Function
Use Case ID UC-INV-F6
Test name Export PDF (list) downloads with applied filters
Preconditions Admin-Manage.
Data format=pdf.
Steps 1. Click Export PDF from header.
2. Confirm download.
Expected result PDF file downloads. Toast confirms filename. Uses current applied filters.

TC-CRM-INV-038

Field Value
Test ID TC-CRM-INV-038
Business Requirement ID F6; INV-EXPORT-04
Category NFR
Use Case ID UC-INV-F6
Test name Async export 202 polls then downloads file
Preconditions Admin-Manage. Backend returns 202 PROCESSING for large export (or test stub).
Data Large matching set > sync threshold.
Steps 1. Trigger Export CSV/Excel/PDF that returns 202.
2. Wait while UI polls.
3. Observe download when COMPLETED.
Expected result Client polls GET /invoices/exports/{export_id} then downloads /file. Success toast on download. FAILED yields error toast. Timeout yields “Export timed out…” after max attempts.

TC-CRM-INV-039

Field Value
Test ID TC-CRM-INV-039
Business Requirement ID F6
Category NFR
Use Case ID UC-INV-F6
Test name Starting second export aborts in-flight export
Preconditions Admin-Manage. Slow/async export possible.
Data Two rapid export clicks (different or same format).
Steps 1. Click Export CSV.
2. Immediately click Export Excel before first completes.
Expected result First request is aborted (no abort error toast). Second export proceeds. Buttons remain disabled while active export runs.

TC-CRM-INV-040

Field Value
Test ID TC-CRM-INV-040
Business Requirement ID F4; INV-DETAIL-06; INV-EXPORT-03
Category Function
Use Case ID UC-INV-F4
Test name Modal Download PDF fetches single invoice PDF
Preconditions Admin-Manage. Detail open for INV-PAID.
Data GET /invoices/{id}/pdf
Steps 1. Open detail.
2. Click Download PDF.
Expected result PDF blob downloads. Success toast. File name derived from Content-Disposition or fallback.

TC-CRM-INV-041

Field Value
Test ID TC-CRM-INV-041
Business Requirement ID API-Invoice-Admin
Category Function
Use Case ID UC-INV-NAV
Test name List merchant name navigates to merchant detail
Preconditions Admin-Manage. Row with merchantId UUID.
Data Merchant cell link.
Steps 1. Click Merchant name on a list row.
Expected result Navigates to /view-merchant/{merchantId}.

TC-CRM-INV-042

Field Value
Test ID TC-CRM-INV-042
Business Requirement ID API-Invoice-Admin
Category Function
Use Case ID UC-INV-NAV
Test name Detail Merchant ID link closes modal and opens merchant
Preconditions Admin-Manage. Detail open.
Data Merchant ID link in From.
Steps 1. Open detail.
2. Click Merchant ID link.
Expected result Modal closes. Browser navigates to /view-merchant/{merchantId}.

TC-CRM-INV-043

Field Value
Test ID TC-CRM-INV-043
Business Requirement ID F1
Category Function
Use Case ID UC-INV-NAV
Test name Breadcrumb Home navigates to dashboard
Preconditions Admin-Manage on /invoices.
Data N/A
Steps 1. Click Home in breadcrumb.
Expected result Navigates to /dashboard.

TC-CRM-INV-044

Field Value
Test ID TC-CRM-INV-044
Business Requirement ID F1
Category Function
Use Case ID UC-INV-ERR
Test name List API failure shows toast and empty list
Preconditions Admin-Manage. Invoice service returns 500/unavailable (or mock).
Data List GET fails.
Steps 1. Open /invoices while list API fails.
Expected result Error toast with API message (or fallback “Failed to load invoices.”). Table empty / “No invoices found.”

TC-CRM-INV-045

Field Value
Test ID TC-CRM-INV-045
Business Requirement ID F4
Category Function
Use Case ID UC-INV-ERR
Test name Detail 404 shows Invoice not found toast
Preconditions Admin-Manage. Force detail GET 404 (deleted id or stub).
Data Click a row then detail returns 404.
Steps 1. Open detail for an id that returns 404.
Expected result Toast “Invoice not found.” Modal may still show list-row snapshot; detail items not replaced with full detail.

TC-CRM-INV-046

Field Value
Test ID TC-CRM-INV-046
Business Requirement ID F4
Category Function
Use Case ID UC-INV-ERR
Test name Detail non-404 error shows failure toast
Preconditions Admin-Manage. Detail GET returns 500.
Data Server error on detail.
Steps 1. Open detail while API errors.
Expected result Toast “Failed to load invoice detail.” (or API message).

TC-CRM-INV-047

Field Value
Test ID TC-CRM-INV-047
Business Requirement ID F6; INV-EXPORT-03
Category Security
Use Case ID UC-INV-ERR
Test name Export API 403 surfaces error toast
Preconditions User somehow triggers export without server manage permission (or stub 403).
Data Export returns 403.
Steps 1. Click Export CSV when API returns 403.
Expected result Error toast with forbidden/API message. No successful download.

TC-CRM-INV-048

Field Value
Test ID TC-CRM-INV-048
Business Requirement ID F2
Category Function
Use Case ID UC-INV-ERR
Test name Merchant search failure clears options silently
Preconditions Admin-Manage. Merchant list API failing.
Data Search term ≥2 chars.
Steps 1. Type merchant name while merchants API errors.
Expected result Dropdown options empty. No error toast required (silent catch).

TC-CRM-INV-049

Field Value
Test ID TC-CRM-INV-049
Business Requirement ID API-Invoice-Admin
Category Function
Use Case ID UC-INV-ADMIN
Test name Unfiltered Admin list spans multiple merchants
Preconditions Admin overlay live. Invoices exist for Merchant-A and Merchant-B. Admin-Manage.
Data No merchant filter.
Steps 1. Open /invoices with empty filters.
2. Scan Merchant column.
Expected result Rows from more than one merchant appear. No JWT merchant scoping empty-result behavior.

TC-CRM-INV-050

Field Value
Test ID TC-CRM-INV-050
Business Requirement ID API-Invoice-Admin
Category Function
Use Case ID UC-INV-ADMIN
Test name Admin can open detail for another merchant invoice
Preconditions Admin overlay live. Invoice owned by Merchant-B visible in list.
Data Merchant-B invoice id.
Steps 1. Open detail for Merchant-B invoice.
Expected result Detail loads successfully (not 404 ownership hide). Merchant ID links to Merchant-B detail.

TC-CRM-INV-051

Field Value
Test ID TC-CRM-INV-051
Business Requirement ID API-Invoice-Admin; INV-EXPORT-02 (Admin variant)
Category Function
Use Case ID UC-INV-ADMIN
Test name Admin export without merchant filter can include cross-merchant rows
Preconditions Admin overlay live. Cross-merchant data. Admin-Manage.
Data Export with empty merchant filter.
Steps 1. Clear merchant filter, Search.
2. Export CSV.
3. Inspect merchant identifiers in file.
Expected result Export file may contain invoices from multiple merchants (Admin variant of INV-EXPORT-02).

E. ReferencesE. Tham chiếu