CPG-MP FSD Report

FSD — Merchant Portal

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

Doc IDCPG-FSD-CPG-MP_FSD_Report
VersionPhiên bản1.0
StatusTrạng tháiDraft
OwnerCPG BA / Architecture
AudienceĐối tượngFrontend, Backend, QA, Product
ClassificationPhân loạiInternal
Effective dateNgày hiệu lực01/12/2026
Related docs Merchant Portal Index · BR/NFR Catalog

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

1. Module Scope

The Report module provides read-only, filterable, exportable reports for merchant operations across Crypto (Phase 1) and Fiat (Phase 2) domains.

In-scope:

  • Report types:
    • Account Report (Crypto Accounts / Fiat Accounts tab)
    • Revenue Report (Crypto Revenue / Fiat Revenue tab)
    • Settlement Report (Crypto Settlements / Fiat Settlements tab)
    • Transaction Report (Crypto Transactions / Fiat Transactions tab)
  • Common capabilities:
    • Advanced filters with Apply Filters action
    • Paginated tables + total records
    • Export: CSV / Excel / PDF
    • Role-based access (view/export)

2. User Roles

Role

Permissions

Merchant Admin

View all reports, apply filters, export CSV/Excel/PDF

Merchant Finance

View all reports, apply filters, export CSV/Excel/PDF

Merchant Operator

View reports, apply filters (export optional by policy)

Merchant Support

View reports (export optional by policy)

3. Functional Requirements

3.1 Features (Detailed breakdown)

A. Common Report Shell (All report pages)

A1. Navigation & Layout

  • Breadcrumb: Home / Reports / {Report Name}
  • Page title: Account Report / Revenue Report / Settlement Report / Transaction Report
  • Tabs: Crypto vs Fiat (Fiat tab may show empty/coming soon in Phase 1)
  • Export buttons (top-right): Export CSV, Export Excel, Export PDF

A2. Advanced Filters Panel

  • Each report includes a dedicated filter set (see sections B–E).
  • Apply Filters button triggers data reload.

A3. Results Table

  • Shows Total Records count.
  • Pagination controls (page number, next/prev).
  • Items per page selector.

A4. Exporting

  • Export uses current filters and current tab (Crypto/FIat).
  • File formats:
    • CSV: machine-readable
    • Excel: formatted spreadsheet
    • PDF: printable report layout
  • Exports must include:
    • Report title, merchant name/id (optional), applied filter summary, export timestamp, timezone.

B. Account Report

B1. Tabs

  • Crypto Accounts (active in Phase 1)
  • Fiat Accounts (Phase 2)

B2. Filters (Crypto Accounts)

  • Account (dropdown, default All Accounts)
  • Blockchain (dropdown, default All Blockchains)
  • Service (dropdown, default All Services)
  • Status (dropdown, default All Status)
  • Total Balance From (min amount)
  • Total Balance To (max amount)
  • Transaction From Date (date)
  • Transaction To Date (date)
  • Apply Filters

Validation rules

  • Min/Max numeric validation
  • Min <= Max
  • From Date <= To Date

B3. Table (Crypto Account Report Data)
Columns:

  • Account ID
  • Account Name
  • Blockchain
  • Balance
  • Status
  • Created Date
  • Last Activity

Rules

  • Balance shown in base reporting currency (e.g., USD) or configured display currency.
  • Last Activity derived from the latest transaction timestamp affecting the account.

C. Revenue Report

C1. Tabs

  • Crypto Revenue
  • Fiat Revenue (Phase 2 placeholder)

C2. Filters (Crypto Revenue)

  • Account
  • Blockchain
  • Service
  • Currency (token/symbol)
  • From Date
  • To Date
  • Apply Filters

Validation

  • From Date <= To Date

C3. Table (Crypto Revenue Report Data)
Columns:

  • Account
  • Blockchain
  • Service
  • Currency
  • Total Revenue
  • Transactions
  • Avg Transaction
  • Tax
  • Gas Used
  • Refund Amount

Rules

  • Total Revenue: gross or net depends on policy; recommended to specify as Gross Revenue and expose Fee/Net in future.
  • Avg Transaction = Total Revenue / Transactions (avoid divide-by-zero).
  • Gas Used: aggregated gas costs (in reporting currency).
  • Refund Amount: aggregated refunds amount for the period.

D. Settlement Report

D1. Tabs

  • Crypto Settlements
  • Fiat Settlements (Phase 2 placeholder)

D2. Filters (Crypto Settlements)

  • Batch ID (text)
  • Account (dropdown)
  • Blockchain (dropdown)
  • Currency (dropdown)
  • Status (dropdown)
  • From Date
  • To Date
  • Apply Filters

Validation

  • From Date <= To Date

D3. Table (Crypto Settlement Report Data)
Columns:

  • Batch ID
  • Settlement Date
  • Transactions
  • Total Amount
  • Fee
  • Net Amount
  • Status
  • Processed At

Status rules (typical)

  • Processing
  • Pending
  • Success
  • Failed (if later added)

E. Transaction Report

E1. Tabs

  • Crypto Transactions
  • Fiat Transactions (Phase 2)

E2. Filters (Crypto Transactions)

  • Account (dropdown)
  • Transaction Type (dropdown: All Types)
  • Status (dropdown)
  • Service (dropdown)
  • Currency (dropdown)
  • Min Amount
  • Max Amount
  • From Date
  • To Date
  • Apply Filters

Validation

  • Min/Max numeric validation; Min <= Max
  • From Date <= To Date

E3. Table (Crypto Transaction Report Data)
Columns:

  • Transaction ID
  • Account
  • Amount
  • Payment Method
  • Currency
  • Type (Payment / Refund)
  • Status (Completed / Pending / Failed)
  • Datetime

Rules

  • Transaction Type filter maps to type (Payment/Refund).
  • Payment Method values include: QR Payment, API Payment, Link Checkout Page (from UI).

3.2 Use Cases (As an {actor}, I want to {description})

Detailed use-case catalog for this module is maintained under 08_UC:Catalog use case chi tiết của module này được quản lý tại 08_UC:

4. User Interface

4.1 Shared UI Components

  • Page header: breadcrumb + title
  • Tab switcher: Crypto / Fiat
  • Export buttons: CSV / Excel / PDF (top-right)
  • “Advanced Filters” panel with consistent spacing and Apply Filters button
  • Data table card with:
    • Report data title (e.g., “Crypto Revenue Report Data”)
    • Total Records count (top-right)
    • Pagination + items per page

4.2 Report-Specific Notes

  • Account Report

  • Revenue Report table supports horizontal scrolling due to wide columns

  • Settlement Report Batch ID is shown as a pill/label style.

  • Transaction Report Type displayed as colored badges (Payment/Refund) and Status as badges.


5. API Routes

Base path: /api/v1

5.1 Account Report

Method

Route

Purpose

Notes

GET

/merchant/reports/accounts

Get Account Report rows

Query: scope(crypto/fiat), accountId, blockchain, serviceId, status, minBalance, maxBalance, txnFrom, txnTo, page, pageSize

GET

/merchant/reports/accounts/export

Export Account Report

Query includes same filters + format=csv/xlsx/pdf

5.2 Revenue Report

Method

Route

Purpose

Notes

GET

/merchant/reports/revenue

Get Revenue Report rows

Query: scope, accountId, blockchain, serviceId, currency, fromDate, toDate, page, pageSize

GET

/merchant/reports/revenue/export

Export Revenue Report

format=csv/xlsx/pdf

5.3 Settlement Report

Method

Route

Purpose

Notes

GET

/merchant/reports/settlements

Get Settlement Report rows

Query: scope, batchId, accountId, blockchain, currency, status, fromDate, toDate, page, pageSize

GET

/merchant/reports/settlements/export

Export Settlement Report

format=csv/xlsx/pdf

5.4 Transaction Report

Method

Route

Purpose

Notes

GET

/merchant/reports/transactions

Get Transaction Report rows

Query: scope, accountId, txnType, status, serviceId, currency, minAmount, maxAmount, fromDate, toDate, page, pageSize

GET

/merchant/reports/transactions/export

Export Transaction Report

format=csv/xlsx/pdf

5.5 Reference Data (Dropdowns)

Method

Route

Purpose

Notes

GET

/refs/accounts

List merchant accounts

Used by Account/Revenue/Transaction filters

GET

/refs/services

List services

Used by filters

GET

/refs/blockchains

List blockchains

Used by filters

E. ReferencesE. Tham chiếu