Feature Spec — Create (Merchant Portal · Invoice)

Round A — business confirmation through interface (CPG-GUIDE-SPEC-A)Vòng A — xác nhận nghiệp vụ qua giao diện (CPG-GUIDE-SPEC-A)

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

Doc IDCPG-SPEC-INV-CREATE
VersionPhiên bản0.2
StatusTrạng tháiFor Review
OwnerDHC — BA
AudienceĐối tượngFlyPay — PM / Business; DHC — BA, UI, Frontend, Backend, QA
ClassificationPhân loạiConfidential — FlyPay and DHCConfidential — FlyPay và DHC
Effective dateNgày hiệu lực02/12/2026
Related docs 01_BR · Merchant Portal FSD Invoice · MP Invoice UC · GUIDE-SPEC-A · MP Invoice TC
AuthorSoạnDHC — BA
ReviewRà soátFlyPay — BusinessFlyPay — Nghiệp vụ
ApprovalPhê duyệtFlyPay — PM
ConfidentialityĐộ mậtConfidential — FlyPay and DHC
FrameworkKhungCPG-GUIDE-SPEC-A (Round A) · sample CPG-SPEC-ACC-HW-CREATE

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

Version Date Author ChangesThay đổi
0.1 14/11/2026 DHC — BA InitializeKhởi tạo
0.2 01/12/2026 DHC — BA Layout of 14 items according to GUIDE-SPEC-A + Invoice module Round ABố cục 14 mục theo GUIDE-SPEC-A + module Invoice Vòng A

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

D. ContentD. Nội dung

Specification — Create Invoice (MANUAL)Đặc tả — Create Invoice (MANUAL) · F3 · Round A. API_PAYMENT:· F3 · Vòng A. API_PAYMENT: L35 API Create (reference).

1. Introduction1. Giới thiệu

1.1 Purpose1.1 Mục đích

Confirm the invoice creation modal on the Merchant Portal before designing the detailed FE/BE.Xác nhận modal tạo hóa đơn trên Merchant Portal trước khi thiết kế chi tiết FE/BE.

RoundVòngContentNội dungOwnerThực hiện
A — business confirmation via UI (this document)A — xác nhận nghiệp vụ qua giao diện (tài liệu này)
  • UI journey: screens, buttons, fieldsHành trình trên giao diện: màn hình, nút, trường
  • Rules and user-visible error messagesQuy tắc, thông báo lỗi người dùng thấy
  • Acceptance criteriaTiêu chí nghiệm thu
DHC drafts, FlyPay approvesDHC soạn, FlyPay phê duyệt
B — FSD / backend design (after Round A approval)B — FSD / thiết kế backend (sau khi vòng A được duyệt)
  • Break down by network, API, data, system error codes, detailed audit logPhân rã theo network, API, dữ liệu, mã lỗi hệ thống, audit log chi tiết
  • Cover every Round A UI flowBao phủ mọi luồng giao diện của vòng A
DHC drafts, FlyPay approvesDHC soạn, FlyPay phê duyệt

1.2 Scope1.2 Phạm vi

In scopeTrong phạm viOut of scope (other docs)Ngoài phạm vi (tài liệu khác)
  • Create Modal from ListModal Create từ List
  • Validation INV-CREATE-01…16
  • Result PENDINGKết quả PENDING

1.3 Audience1.3 Đối tượng đọc

AudienceĐối tượngReadĐọc phần
FlyPay — PM, OperationsFlyPay — PM, nghiệp vụSection 2, 3, 6, 12Mục 2, 3, 6, 12
DHC — BA, interface design, frontendDHC — BA, thiết kế giao diện, frontendEntireToàn bộ
DHC — backend, QASection 8, 9, 11; Section 13.2Mục 8, 9, 11; Mục 13.2

1.4 Glossary & abbreviations1.4 Thuật ngữ & viết tắt

Terms follow the CPG glossary: keep industry English terms; short meaning text (ND-03).Thuật ngữ theo Từ điển thuật ngữ CPG: giữ thuật ngữ ngành (tiếng Anh), giải thích ngắn bằng tiếng Việt (ND-03).

VietnameseTiếng ViệtEnglish / UITiếng Anh / trên giao diệnMeaningNghĩaStatusTrạng thái
hóa đơnInvoiceMerchant crypto payment request document (code INV-…), linked to order/customer/line items.Chứng từ yêu cầu thanh toán crypto của merchant (mã INV-…), gắn order/khách/dòng hàng.referencetham khảo
trạng thái hóa đơnPENDING / PAID / OVERDUE / CANCELLEDPending: awaiting payment. Paid: fully paid. Overdue: past due unpaid. Cancelled: cancelled. System-driven only.Pending: chờ thanh toán. Paid: đã thanh toán đủ. Overdue: quá hạn chưa thanh toán. Cancelled: đã hủy. Chỉ hệ thống đổi trạng thái.referencetham khảo
tài sảnAssetToken received / held: USDT, USDC (stablecoin).Đồng tiền nhận / giữ: USDT, USDC (stablecoin).referencetham khảo
mã đơnOrder IDMerchant order reference bound to the invoice.Tham chiếu đơn hàng phía merchant gắn với hóa đơn.referencetham khảo
hạn thanh toánDue Date / Expiry TimeInvoice payment deadline; past due may become Overdue.Thời điểm hết hạn thanh toán hóa đơn; quá hạn có thể chuyển Overdue.referencetham khảo
nguồn tạosource_typeInvoice origin: MANUAL (portal), QR_CODE, CHECKOUT_LINK, API_PAYMENT (SDK/API).Nguồn sinh hóa đơn: MANUAL (cổng), QR_CODE, CHECKOUT_LINK, API_PAYMENT (SDK/API).referencetham khảo
(keep English)Hot Wallet (HW)CPG-managed transit wallet per merchant and network. Do not use the Vietnamese calque for 'hot wallet'.Ví trung chuyển do CPG quản lý, theo từng merchant và network. Không dịch 'ví nóng'.referencetham khảo
(keep English)Virtual Account (VA)Per-customer deposit address bound to a Hot Wallet.Địa chỉ nhận tiền riêng của từng khách hàng, gắn với một Hot Wallet.referencetham khảo
(keep English)networkBlockchain the wallet runs on: TRON, BSC, Ethereum, Polygon (Mainnet / Testnet).Blockchain mà ví hoạt động: TRON, BSC, Ethereum, Polygon (Mainnet / Testnet).referencetham khảo
xuất dữ liệuExportDownload invoice list (CSV / Excel / PDF) under current filters.Tải danh sách hóa đơn (CSV / Excel / PDF) theo bộ lọc hiện tại.referencetham khảo
phân quyền theo vaiRBAC / roleMerchant Admin, Finance, Operator, Approver, Support, Developer, Viewer.Merchant Admin, Finance, Operator, Approver, Support, Developer, Viewer.referencetham khảo
hộp thoạidialog / modalOverlay window on the page with confirm and cancel actions.Cửa sổ nổi trên trang, có nút xác nhận và hủy.referencetham khảo
(keep English)error bannerError strip at the top of a dialog for non-field-specific errors.Khung báo lỗi đầu hộp thoại cho lỗi không gắn với một ô cụ thể.referencetham khảo
nhật ký kiểm toánaudit logImmutable record of who did what, when, and the outcome.Bản ghi không sửa được: ai làm gì, lúc nào, kết quả.referencetham khảo
yêu cầu / quy tắc nghiệp vụBR / Business Rule (RL)IDs from FlyPay URD / RTM.Mã lấy từ URD / RTM của FlyPay.referencetham khảo
trường hợp sử dụng / nghiệm thu / kiểm thửUC / AC / TCUse Case / Acceptance Criteria / Test Case.Use Case / Acceptance Criteria / Test Case.referencetham khảo
phạm vi công việc / yêu cầu thay đổiSoW / CRStatement of Work / Change Request.Statement of Work / Change Request.referencetham khảo
(keep English)baselineConfirmed and signed requirements snapshot.Bản yêu cầu đã xác nhận và ký.referencetham khảo
tài liệu yêu cầu / truy vết / thiết kếURD / RTM / FSDFlyPay requirements / traceability matrix / functional spec (Round B).Tài liệu yêu cầu FlyPay / sổ cái truy vết / đặc tả chức năng (vòng B).referencetham khảo

1.5 References1.5 Tài liệu tham chiếu

IDMãDocumentTài liệuRelated toLiên quan tớiVersion / statusPhiên bản / tình trạngLink
L20CPG-GUIDE-SPEC-A — Guide for writing Round A feature specificationsCPG-GUIDE-SPEC-A — Hướng dẫn viết đặc tả tính năng vòng A14-item rules, HA-01…09, ND-01…13Quy tắc 14 mục, HA-01…09, ND-01…13v0.1, 13/11/2026OpenMở
L21CPG-SPEC-ACC-HW-CREATE — Sample Document for Creating Hot WalletCPG-SPEC-ACC-HW-CREATE — Tài liệu mẫu Tạo Hot WalletStandard detail level (Create Hot Wallet)Mức chi tiết chuẩn (Tạo Hot Wallet)v0.1, 13/11/2026 — illustrative samplev0.1, 13/11/2026 — mẫu minh hoạOpenMở
L24FSD Merchant Portal / Invoice v2.1Invoice v2.1 business baseline (F1–F6, system status)Baseline nghiệp vụ Invoice v2.1 (F1–F6, status hệ thống)—OpenMở
L25UC Invoice (DHC) — catalog theo vaiUC Invoice code by roleMã UC Invoice theo vai—OpenMở
L26MP Invoice test script setBộ kịch bản kiểm thử MP InvoiceTC-MP-INV-*—OpenMở
L27API Invoice plan (BE)Endpoint create/list/detail/export (reference Round A)Endpoint create/list/detail/export (tham chiếu Round A)—OpenMở
L30CPG-SPEC-INV-LIST — List InvoicesList + advanced filter (F1+F2)Danh sách + lọc nâng cao (F1+F2)available (version 0.2, 16/11/2026)có (bản 0.2, 16/11/2026)OpenMở
L32CPG-SPEC-INV-DETAIL — Invoice DetailDetails / view PDF (read-only)Chi tiết / xem PDF (read-only)available (version 0.2, 16/11/2026)có (bản 0.2, 16/11/2026)OpenMở
L35CPG-SPEC-INV-API-CREATE — API Create (reference)Reference created via API (following SDK)Tham chiếu tạo qua API (SDK sau)available (version 0.2, 16/11/2026)có (bản 0.2, 16/11/2026)OpenMở

1.6 Presentation conventions1.6 Quy ước trình bày

ConventionQuy ướcMeaningNghĩa
MUSTRequired — fail = not accepted (RFC 2119: SHALL)Bắt buộc — không đạt thì không nghiệm thu (RFC 2119: SHALL)
MUST NOTForbidden (SHALL NOT)Cấm (SHALL NOT)
SHOULDRecommended — alternatives need a reason (SHOULD)Khuyến nghị — làm khác phải nêu lý do (SHOULD)
MAYOptional (MAY)Tuỳ chọn (MAY)
Status labelNhãn trạng tháiMeaningNghĩa
Confirmed (source)Đã xác nhận (source)Already in URD / RTM / FSD v2.2 or confirmed by FlyPay (cite source, date).Đã có trong URD / RTM / FSD v2.2 hoặc FlyPay đã xác nhận (ghi nguồn, ngày).
DHC proposalDHC đề xuấtDHC proposal with rationale; needs FlyPay agreement.DHC đề xuất kèm lý do; cần FlyPay đồng ý.
Awaiting decision QnChờ quyết định QnFlyPay must answer Qn in §12; each has a DHC recommendation.Cần FlyPay trả lời câu hỏi Qn ở Mục 12; mỗi câu có khuyến nghị DHC.
DHC added (v0.2)DHC bổ sung (bản 0.2)DHC added in the version in parentheses (usually missing shot / description).DHC bổ sung ở phiên bản ghi trong ngoặc (thường là ảnh / mô tả còn thiếu).
referencetham khảoExplanatory info, not a requirement.Thông tin giải thích, không phải yêu cầu.
Combined cellÔ ghépExample: Confirmed (RL-05-01); length: Awaiting Q6. 'Confirmed' applies only to the cited part.Ví dụ: Đã xác nhận (RL-05-01); độ dài: Chờ quyết định Q6.
SymbolKý hiệuMeaningNghĩa
S1, S2, S2-N…Screen ids; suffix = variantMã màn hình; hậu tố là biến thể
B1…BnUser-flow step ids (§5)Mã bước trong luồng người dùng (Mục 5)
1 2 3…Callout numbers on shots; explained in the table below the image.Số chú thích trên ảnh; giải thích ở bảng ngay dưới ảnh.
BR, RL, TC, E-*, AC, Q, LRequirement, rule, test case, error, acceptance, question, referenceYêu cầu, quy tắc, kịch bản kiểm thử, thông báo lỗi, tiêu chí nghiệm thu, câu hỏi, tài liệu tham chiếu
(new id)(mã mới)DHC-proposed id; FlyPay assigns official RTM ids (ND-08)Mã DHC đề xuất; FlyPay cấp mã chính thức khi cập nhật RTM (ND-08)
dd/mm/yyyyDate formatĐịnh dạng ngày

2. Overview2. Tổng quan

  • Create from List; Admin/Operator rights (Section 4).Create từ List; quyền Admin/Operator (Mục 4).
  • Full validation; Create disabled until valid (Section 6).Validation đầy đủ; Create disabled đến khi hợp lệ (Mục 6).
  • After creation: PENDING, unchanged (Section 8).Sau tạo: PENDING, bất biến (Mục 8).
  • source_type MANUAL (Section 8).source_type MANUAL (Mục 8).
  • API/SDK: separate reference page.API/SDK: trang tham chiếu riêng.
  • 3 FlyPay questions.3 câu hỏi FlyPay.
DHC added (v0.2)DHC bổ sung (bản 0.2) — no screenshot for this screen yet.chưa có ảnh cho màn hình này.
Figure 1Hình 1 — Overview: Create Invoice modal from the button on the List (source_type implicitly MANUAL).— Toàn cảnh: Modal Create Invoice từ nút trên List (source_type ngầm MANUAL).

3. Business rules3. Nghiệp vụ

3.1 The role of the Invoice in payment transactions3.1 Vai trò của Invoice trong nghiệp vụ thanh toán

Invoice isInvoice là documents requesting crypto paymentchứng từ yêu cầu thu tiền crypto of merchant: anchor the amount to be collected (của merchant: neo số tiền phải thu (asset + total), customer, order (+ tổng), khách hàng, đơn hàng (order_id), payment deadline (), hạn thanh toán (due_date) and the list of product lines. It) và danh mục dòng hàng. Nó nokhông replace manual payment confirmation — funds are recorded through observing the chain/transaction and the system updates the status (seethay bước xác nhận thanh toán thủ công — tiền về được ghi nhận qua quan sát chuỗi / giao dịch và hệ thống cập nhật trạng thái (xem L33 Invoice Status).

RoleVai tròBusiness meaningÝ nghĩa nghiệp vụStateTrạng thái
Accounts receivable ledgerNeo khoản phải thuConfirm the amount, asset, term, and contents of the order before the customer pays — then create immutable contentChốt số tiền, asset, hạn và nội dung đơn trước khi khách trả — sau tạo nội dung bất biến (INV-CREATE-16).Confirmed (FSD Invoice §1 · §F3)Đã xác nhận (FSD Invoice §1 · §F3)
Payment channel inputĐầu vào kênh thu tiềnCan be generated from the portal (MANUAL), attach QR Code / Checkout Link, or Payment API — the same type of receipt.Có thể sinh từ cổng (MANUAL), gắn QR Code / Checkout Link, hoặc API Payment — cùng một loại chứng từ thu.Confirmed (FSD §1 source_type)Đã xác nhận (FSD §1 source_type)
Reconcile with transactionĐối soát với giao dịchWhen payment is successful, the invoice is attached to / reflects the transaction; status → PAID (system). If overdue and not paid → OVERDUE.Khi thanh toán thành công, invoice gắn / phản ánh transaction; status → PAID (hệ thống). Quá hạn không trả → OVERDUE.Confirmed (FSD §F5)Đã xác nhận (FSD §F5) · L33 Invoice Status
Operational linkLiên kết vận hànhMapping order, product, customer; after payment, it can be linked to VA / HW / network / asset / transaction (FSD scope).Ánh xạ order, product, customer; sau thanh toán có thể gắn VA / HW / network / asset / transaction (FSD scope).Confirmed (FSD §1 in scope)Đã xác nhận (FSD §1 in scope)
Do not do anything on this UIKhông làm gì trên UI nàyDo not manually confirm payment; do not manually change status; no fiat settlement / refund on Create.Không xác nhận thanh toán tay; không sửa status tay; không settlement fiat / refund trên Create.Confirmed (FSD §1 out of scope)Đã xác nhận (FSD §1 out of scope)
Create on the portalCreate trên cổng = step= bước releasephát hành receipt voucher (PENDING). Stepchứng từ thu (PENDING). Bước collect enough moneythu đủ tiền Belongs to the payment flow / Sync–Transaction; the UI Create only ensures that the data is sufficient for later reconciliation.thuộc luồng thanh toán / Sync–Transaction; UI Create chỉ đảm bảo dữ liệu đủ để đối soát sau này.

3.2 Create an invoice on the portal3.2 Tạo hóa đơn trên cổng

Admin/Operator manually creates the invoice. After creation: statusAdmin/Operator tạo hóa đơn thủ công. Sau khi tạo: status PENDING, content, nội dung unchangingbất biến (INV-CREATE-15/16). source_type undergroundngầm MANUAL. Create from QR/Checkout (. Tạo từ QR/Checkout (INV-CREATE-17) and API) và API L35 API Create (reference) beyond the scope of this round of UI details.ngoài phạm vi chi tiết UI vòng này.

3.3 Requirements3.3 Yêu cầu

BR IDMã BROriginal wording (URD / RTM / FSD)Nguyên văn (URD / RTM / FSD)InterpretationDiễn giảiUI manifestationThể hiện trên giao diệnStatusTrạng thái
INV-CREATE-01…14Validation form + disable CreateOrder ID, email, expiry, asset, ≥1 product lineOrder ID, email, expiry, asset, ≥1 dòng SPS1Confirmed (FSD §F3)Đã xác nhận (FSD §F3)
INV-CREATE-15/16Pending + immutableDo not edit after creatingKhông sửa sau tạoS2Confirmed (FSD §F3)Đã xác nhận (FSD §F3)

3.4 Reason3.4 Lý do

Design pointĐiểm thiết kếBusiness rationaleLý do nghiệp vụSeen atThấy ởStatusTrạng thái
Invoice before having an on-chain transactionInvoice trước khi có tx on-chainMerchant needs documents / finalized amount for the customer to pay and for the system to match later.Merchant cần chứng từ / số tiền chốt để khách trả và để hệ thống match sau này.Section 3.1Mục 3.1Confirmed (FSD §1)Đã xác nhận (FSD §1)
Calculate Total per line / Invoice Total on UITính Total dòng / Invoice Total trên UIMerchant sees the number before submittingMerchant thấy số trước khi submitS1Confirmed (INV-CREATE-12/13)Đã xác nhận (INV-CREATE-12/13)
Disable Create khi invalidReduce 400 errors; avoid issuing documents missing reconciliation fieldsGiảm lỗi 400; tránh phát hành chứng từ thiếu field đối soátS1Confirmed (INV-CREATE-14)Đã xác nhận (INV-CREATE-14)

4. Roles & permissions4. Vai trò & phân quyền

ActionThao tácAdminFinanceOperatorSupportDeveloperViewerStatusTrạng thái
Open Create InvoiceMở Create InvoiceCreditCóNoneKhôngCreditCóNoneKhôngNoneKhôngNoneKhôngConfirmed (FSD §2)Đã xác nhận (FSD §2)
Submit created successfullySubmit tạo thành côngCreditCóNoneKhôngCreditCóNoneKhôngNoneKhôngNoneKhôngConfirmed (invoice:manage)Đã xác nhận (invoice:manage)

5. User flows5. Luồng người dùng

Admin/OperatorMerchant PortalHệ thốngBắt đầuB1: Bấm Create InvoiceB2: Mở modal trốngB3: Nhập field + dòng SPB4: Validate realtime;Enable Create?Có ↓Không→ B3B5: Create InvoiceB6: Tạo OK?Đạt ↓Không đạt→ B3B7: Đóng modal; toast; listcó dòng PENDINGKết thúc
Figure 4 — Create Invoice (MANUAL) — Column = actor lane; blue ellipse = Start; red ellipse = End; diamond = condition (Hình 4 — Create Invoice (MANUAL) — Cột = làn actor; elip xanh = Bắt đầu; elip đỏ = Kết thúc; hình thoi = điều kiện (Achieve/HaveĐạt/Có ↓ next step,↓ bước sau, Not pass/NoKhông đạt/Không → go back to the step indicated by the red arrow); dotted line = option / step outside the function. Text in the block is not cut off.→ quay về bước ghi trên mũi tên đỏ); nét đứt = phương án / bước ngoài tính năng. Chữ trong block không bị cắt.
StepBướcWhoAiActionLàm gìSystem responseHệ thống phản hồiScreenMàn hình
B1–B2UserOpen modalMở modalTitle Create InvoiceS1
B3–B4User/PortalEnter & validateNhập & validateDisable Create if failDisable Create nếu failS1
B5–B7User/SystemUser/Hệ thốngSubmitPENDING + immutableS2

6. Step-by-step UI6. Giao diện từng bước

Each step: screenshot first, then a table explaining each orange callout number (HA-02, HA-03). Keep UI copy in English as on DEV. DEV shots are wireframes; missing variants are marked DHC added (v0.2)DHC added (version 0.2) in the Figure column.Mỗi bước: ảnh màn hình trước, bảng ngay dưới giải thích từng số tròn cam (HA-02, HA-03). Chữ trên giao diện để tiếng Anh như DEV hiện tại. Ảnh DEV là wireframe; biến thể chưa có ảnh ghi DHC added (v0.2)DHC bổ sung (bản 0.2) ở cột Hình.

6.1 Modal Create (S1)

Next:Đi tiếp: Create OK → S2; Cancel → list

DHC added (v0.2)DHC bổ sung (bản 0.2) — no screenshot for this screen yet.chưa có ảnh cho màn hình này.
Figure 6.1Hình 6.1 — S1: Order ID · Customer ID · Email · Expiry · Asset · product rows · Notes · Cancel/Create
#ElementThành phầnDisplay / behaviorHiển thị / hành viDetail inChi tiết ởStatusTrạng thái
1Order ID *CompulsoryBắt buộcINV-CREATE-01Confirmed (FSD)Đã xác nhận (FSD)
2Customer Email *Valid emailEmail hợp lệINV-CREATE-02/03Confirmed (FSD)Đã xác nhận (FSD)
3Expiry Time *> nowINV-CREATE-04/05Confirmed (FSD)Đã xác nhận (FSD)
4Asset *USDT/USDCINV-CREATE-06Confirmed (FSD)Đã xác nhận (FSD)
5Product rowsID, Name, Price≥0, Qty>0; Total=P×QINV-CREATE-07…12Confirmed (FSD)Đã xác nhận (FSD)
6Invoice TotalSum line — read-onlySum dòng — read-onlyINV-CREATE-13Confirmed (FSD)Đã xác nhận (FSD)
7Create InvoiceDisabled until validINV-CREATE-14Confirmed (FSD)Đã xác nhận (FSD)
DHC added (v0.2)DHC bổ sung (bản 0.2)

6.1.1 Product line (6.1.1 Dòng sản phẩm (5)

CategoryLoạiRepeater row
CompulsoryBắt buộc≥1 line≥1 dòng
BehaviourHành vi
  • Add Product add rowAdd Product thêm dòng
  • Delete when >1 lineDelete khi >1 dòng
  • Total read-only
ErrorLỗi

6.2 Results (S2)6.2 Kết quả (S2)

DHC added (v0.2)DHC bổ sung (bản 0.2) — no screenshot for this screen yet.chưa có ảnh cho màn hình này.
Figure 6.2Hình 6.2 — S2: Toast success; list has PENDING invoice; open optional detail— S2: Toast success; list có invoice PENDING; mở detail optional

7. Use cases7. Trường hợp sử dụng (Use Case)

ItemMụcContentNội dungStatusTrạng thái
Name codeMã / tênUC-INV-CREATE Create portal invoice (MANUAL)Tạo hóa đơn cổng (MANUAL)Confirmed (F3)Đã xác nhận (F3)
ActorsTác nhânAdmin, OperatorConfirmed (FSD §2)Đã xác nhận (FSD §2)
Target sectionMục tiêuCreate a PENDING invoice permanentlyTạo invoice PENDING bất biếnConfirmed (INV-CREATE-15/16)Đã xác nhận (INV-CREATE-15/16)
terms as usualĐiều kiện trước
  • Log inĐăng nhập
  • Has the right to manageCó quyền manage
Confirmed (FSD)Đã xác nhận (FSD)
Results upon successKết quả khi thành công
  • invoice_code
  • status PENDING
  • updated listlist cập nhật
Confirmed (FSD)Đã xác nhận (FSD)
Consequences of failureKết quả khi thất bạiModal holds data; shows errorModal giữ data; báo lỗiConfirmed (FSD)Đã xác nhận (FSD)
Main StreamLuồng chínhB1 → B7—
Alternative flowLuồng thay thế
  • A1 Cancel dirty → confirm close
  • A2 QR/Checkout plus — beyond detailed UIA2 QR/Checkout plus — ngoài UI chi tiết
Awaiting decision Q1Chờ quyết định Q1
ExceptionNgoại lệ
  • X1 Validation
  • X2 API error
Confirmed (FSD)Đã xác nhận (FSD)
Related UCUC liên quanUC-INV-LIST, DETAIL, API-CREATEConfirmed (08_UC)Đã xác nhận (08_UC)

8. Business rules detail8. Quy tắc nghiệp vụ

Each rule uses keywords from §1.6 and a verification method: Test = test against AC in §11.1; Inspection = verify directly on the UI.Mỗi quy tắc dùng từ khoá theo Mục 1.6 và có cách kiểm chứng: Test = kiểm thử theo AC ở Mục 11.1; Inspection = kiểm tra trực tiếp trên giao diện.

IDMãRuleQuy tắcSeen atThấy ởErrorLỗiVerificationKiểm chứngStatusTrạng thái
RL-INV-CRT-01 (new id)(mã mới)Order ID, Email, Expiry, Asset, ≥1 SP are mandatoryBắt buộc Order ID, Email, Expiry, Asset, ≥1 SPS1E-CRT-01TestConfirmed (INV-CREATE-01…07)Đã xác nhận (INV-CREATE-01…07)
RL-INV-CRT-02 (new id)(mã mới)Email in correct format; Expiry > nowEmail đúng format; Expiry > nowS1E-CRT-02/03TestConfirmed (INV-CREATE-03/05)Đã xác nhận (INV-CREATE-03/05)
RL-INV-CRT-03 (new id)(mã mới)Price≥0; Qty>0; Total=P×Q; Invoice Total=sumS1—TestConfirmed (INV-CREATE-10…13)Đã xác nhận (INV-CREATE-10…13)
RL-INV-CRT-04 (new id)(mã mới)Create disabled until validS1—InspectionConfirmed (INV-CREATE-14)Đã xác nhận (INV-CREATE-14)
RL-INV-CRT-05 (new id)(mã mới)After creation: PENDING + immutableSau tạo: PENDING + immutableS2—TestConfirmed (INV-CREATE-15/16)Đã xác nhận (INV-CREATE-15/16)
RL-INV-CRT-06 (new id)(mã mới)manual source_type on the portalsource_type MANUAL trên cổng——InspectionConfirmed (API default MANUAL)Đã xác nhận (API default MANUAL)

9. Error messages9. Thông báo lỗi

CodeMãConditionĐiều kiệnUser message (EN)Thông báoPlacementVị tríScreenMàn hìnhStatusTrạng thái
E-CRT-01 (new id)(mã mới)Mandatory missingThiếu bắt buộcThis field is requiredUnder the fieldDưới fieldS1DHC proposalDHC đề xuất
E-CRT-02 (new id)(mã mới)Email saiEnter a valid emailEmailS1Confirmed (INV-CREATE-03)Đã xác nhận (INV-CREATE-03)
E-CRT-03 (new id)(mã mới)Expiry ≤ nowExpiry must be in the futureExpiryS1Confirmed (INV-CREATE-05)Đã xác nhận (INV-CREATE-05)
E-CRT-04 (new id)(mã mới)Qty/Price invalidQuantity must be greater than 0RowS1Confirmed (INV-CREATE-10/11)Đã xác nhận (INV-CREATE-10/11)
E-CRT-05 (new id)(mã mới)API/create failUnable to create invoice. Please try again.BannerS1DHC proposalDHC đề xuất

10. Status — after creation10. Trạng thái sau khi tạo

FromTừToSangWhen / whoKhi nào / aiScreenMàn hìnhStatusTrạng thái
Unavailable(chưa có)PendingCreated successfullyCreate thành côngS2Confirmed (INV-CREATE-15)Đã xác nhận (INV-CREATE-15)

11. Acceptance criteria & traceability11. Tiêu chí nghiệm thu & truy vết

11.1 AC

IDMãGivenGiả sửWhenKhiThenThìFigureHìnhTCTCStatusTrạng thái
AC-01Admin, the form is emptyAdmin, form trốngOpen CreateMở CreateCreate disabledS1TC-MP-INV-020 (new id)(mã mới)Confirmed (INV-CREATE-14)Đã xác nhận (INV-CREATE-14)
AC-02Valid formForm hợp lệSubmitPENDING on the list; cannot edit the fieldPENDING trên list; không sửa được fieldS2TC-MP-INV-021 (new id)(mã mới)Confirmed (INV-CREATE-15/16)Đã xác nhận (INV-CREATE-15/16)
AC-03Wrong email / past expiryEmail sai / expiry quá khứBlur/submitField error; not createdLỗi field; không tạoS1TC-MP-INV-022 (new id)(mã mới)Confirmed (INV-CREATE-03/05)Đã xác nhận (INV-CREATE-03/05)
AC-04FinanceOpen listMở listNo Create buttonKhông nút Create—TC-MP-INV-023 (new id)(mã mới)Confirmed (FSD §2)Đã xác nhận (FSD §2)
AC-052 product lines2 dòng SPXem totalsCorrect P×Q and sumĐúng P×Q và sumS1TC-MP-INV-024 (new id)(mã mới)Confirmed (INV-CREATE-12/13)Đã xác nhận (INV-CREATE-12/13)

11.2 Trace

BRBRStepBướcScreenMàn hìnhRulesQuy tắcCriteriaTiêu chíTCTC
F3B1–B7S1–S2RL-INV-CRT-*AC-01…05TC-MP-INV-020…024

12. Questions for FlyPay12. Câu hỏi cần FlyPay quyết định

Each question includes a DHC recommendation (ND-07). FlyPay only needs to accept the recommendation or choose another option.Mỗi câu kèm khuyến nghị DHC (ND-07). FlyPay chỉ cần chọn: đồng ý khuyến nghị, hoặc chọn phương án khác.

IDMãQuestionCâu hỏiSectionMụcDHC proposalĐề xuất DHC
Q1Do Plus from QR/Checkout share the same modal?Plus từ QR/Checkout có cùng modal không?Section 3Mục 3Together with modal; return Invoice ID to parent (Cùng modal; trả Invoice ID cho parent (INV-CREATE-17) — UI parent in the QR/Checkout module.) — UI parent ở module QR/Checkout.
Q2Allow tax/discount on UI Phase 1?Cho phép tax/discount trên UI Phase 1?S1Hidden; API has an optional field — Round B/SDK.Ẩn; API có field optional — vòng B/SDK.
Q3Confirm when closing dirty form?Confirm khi đóng dirty form?S1There is (FSD Close Icon).Có (FSD Close Icon).

13. SoW baseline & FSD handoff13. Baseline SoW & phần chuyển sang FSD

13.1 Items for SoW baseline13.1 Phần đưa vào baseline SoW

The feature enters baseline when Q1–Q3 are decided and FlyPay signs §14.Tính năng vào baseline khi Q1–Q3 đã có quyết định và FlyPay ký Mục 14.

SoW itemMục SoWContentNội dungStatusTrạng thái
AreaPhạm viF3 portalConfirmed (FSD)Đã xác nhận (FSD)
HandoverBàn giao
  • Modal Create
  • AC
DHC proposalDHC đề xuất
AcceptanceNghiệm thuAC stagingDHC proposalDHC đề xuất
HypotheticalGiả địnhPOST /api/v1/invoicesreferencetham khảo
DependentPhụ thuộcDHC proposalDHC đề xuất
CREmail CRreferencetham khảo

13.2 Items moved to FSD (Round B)13.2 Phần chuyển sang FSD (vòng B)

Round A MUST NOT contain APIs, data tables, or system error codes (ND-02). The following belong in Round B FSD:Vòng A KHÔNG ĐƯỢC chứa API, bảng dữ liệu, mã lỗi hệ thống (ND-02). Các nội dung sau thuộc FSD vòng B:

  • Map DTO CreateInvoice
  • Idempotency if retryIdempotency nếu retry

14. Feedback & approval14. Phản hồi & phê duyệt

14.1 How to respond14.1 Cách phản hồi

  • FlyPay records each Q1–Q3 decision in the 'FlyPay decision' column of §12.FlyPay ghi quyết định từng câu Q1–Q3 vào cột 'FlyPay quyết định' ở Mục 12.
  • Other feedback: Word comments anchored to the exact paragraph / figure.Góp ý khác: ghi comment trong file Word, mỗi comment gắn đúng đoạn / ảnh.
  • Reply on the same email thread used to send the document.Gửi lại theo thread email đã gửi tài liệu.
  • DHC updates the next revision, updates Version history, and marks changed items.DHC cập nhật bản kế tiếp, ghi Lịch sử phiên bản và đánh dấu mục đã sửa.

14.2 Approval14.2 Phê duyệt

RoleVai tròNameHọ tênDateNgàyDecisionKết luận
DHC — BA authorDHC — BA soạn  —
FlyPay — BusinessFlyPay — Nghiệp vụ  Approve / Approve with conditions / RejectDuyệt / Duyệt có điều kiện / Không duyệt
FlyPay — PM  Approve / Approve with conditions / RejectDuyệt / Duyệt có điều kiện / Không duyệt
FSDMP FSD Invoice v2.1 · rules INV-CREATE-01…16
UCUC-INV-CREATE — UC Invoice
TCTC-MP-INV-020…024 — MP Invoice Test Cases
API (reference)API (tham chiếu)Endpoints FSD §7 · SDK after Round A· SDK sau Vòng A
Related SPECSPEC liên quanL28 Invoice Index (MP) · L30 List Invoices · L32 Invoice Detail · L35 API Create (reference)
InstructionsHướng dẫnCPG-GUIDE-SPEC-A · CPG-SPEC-ACC-HW-CREATE · CPG-REVIEW-SPEC-ACC

Missing code log / out of scopeNhật ký mã thiếu / ngoài scope

The codes areCác mã được yellow highlighthighlight vàng because there is no (or external) target document. Changelog version 0.3.vì chưa có (hoặc ngoài) tài liệu đích. Changelog bản 0.3.

CodeMãCategoryLoạiMarkGhi chú
UC-INV-CREATEuc_anchor_missingAdd anchor / stub on RTM or TC; highlight in yellow until FlyPay issues the official code.Bổ sung anchor / stub trên RTM hoặc TC; highlight vàng đến khi FlyPay cấp mã chính thức.
UC-INV-LISTuc_anchor_missingAdd anchor / stub on RTM or TC; highlight in yellow until FlyPay issues the official code.Bổ sung anchor / stub trên RTM hoặc TC; highlight vàng đến khi FlyPay cấp mã chính thức.