Skip to main content

KIOSK-254 — Pages to Apply USD Wallet Wording Changes

FieldValue
Task IDKIOSK-254
Mục tiêuĐồng bộ tên giao dịch USD Walletnhãn tài chính trên 3 portal vận hành
In scopekioskgaming_admin, kioskgaming_superagent, kioskgaming_agent, shared UI packages/ui (portal-usd-wallet, portal-ledger)
Out of scope (v1)Shop portal (kioskgaming_shop), đổi route URL (/online-transactions), đổi tên biến/API nội bộ (onlineBalanceNet, fetchAgentOnlineBalanceLedger), DB schema
RelatedFinance System · Admin USD wallet detail view · Task-kiosk-260 (correction / reversal / refund labels trên Admin)

1. Background

Trong codebase, USD Wallet (usd_wallets + usd_wallet_transactions) là ví tiền thật (USD) dùng để mua credit, nhận settlement deposit, và rút crypto. Tuy nhiên UI vẫn còn nhiều tên legacy:

Thuật ngữ legacyVấn đề
Online balanceKhông khớp tên sản phẩm; user không biết đây là “USD Wallet”
Online transactions (nav Agent)Khác với Super Agent / page title (“USD wallet transactions”)
Online balance top up / withdrawal (Shop utils)Chỉ Shop — out of scope KIOSK-254 nhưng cùng pattern cần tránh lan sang portal in-scope

Mục tiêu ticket: một bộ từ vựng thống nhất — ưu tiên “USD wallet” / “USD Wallet” cho tên sản phẩm và mô tả số dư; transaction labels dùng chung từ @kioskgaming/ui khi có thể.


2. Quy ước wording (source of truth)

2.1 Tên sản phẩm & số dư

Ngữ cảnhLabel chuẩn (EN)Không dùng
Tên ví / sidebar / dashboard cardUSD walletOnline balance, online USD balance
Số dư khả dụngCurrent USD balance hoặc USD wallet balanceOnline balance, USD online balance
Trang ledger chínhUSD wallet transactionsOnline transactions
Mô tả trangTrack USD wallet ledger activity, balances, and withdrawal requests.Online balance ledger…
Rút tiềnRequest withdrawal / USD withdrawalOnline balance withdrawal
Mua credit từ USDConvert USD wallet balance to credits / USD converted to creditsConvert online balance…

Capitalization: Nav / page title → sentence case (USD wallet transactions). Badge / card heading ngắn → USD wallet. Modal title có thể USD Wallet khi là proper noun (timeline step).

2.2 Nhãn loại giao dịch (ledger table & detail)

Dùng chung từ packages/ui/src/portal-usd-wallet/ledgerUtils.ts (usdLedgerTypeLabel) và portal-ledger/usdTransactionPresentation.ts (buildUsdBusinessView):

Signal (type / ref)Label list / tableDetail modal title
depositDepositUSD added to wallet
withdrawal (payout)WithdrawUSD withdrawal
purchase_credits / balance_to_creditsPurchase creditsUSD converted to credits
adjustment creditBalance Correction — CreditWallet adjustment
adjustment debitBalance Correction — DebitWallet adjustment
reversalTransaction ReversalWallet activity reversed
Refund flowsRefund(Admin: displayLabel từ API — xem KIOSK-260)
FallbackUSD wallet activityUSD wallet activity

Admin list/detail: ưu tiên displayLabel / displayCategory từ API (usdLedgerEnrichment) khi có — không duplicate heuristic ở frontend. Xem Task-kiosk-260.

2.3 Status labels (giữ nguyên — đã thống nhất)

Completed · Pending · Processing · Failed · Cancelled — từ usdLedgerStatusLabel.


3. Scope — bảng thay đổi theo portal

3.1 Admin Portal (kioskgaming_admin)

Page / AreaRoute / fileHiện tại (gap)Required change
Nav / route meta/usd-wallets · routes.tsxTitle nav: USD WalletsGiữ hoặc đổi thành USD wallet transactions nếu product muốn khớp portal khác; breadcrumb thống nhất
USD wallet ledgerusdWallets/index.tsxTitle đã là USD wallet transactionsRà soát toast/export: USD ledger exported → có thể USD wallet ledger exported
Ledger detail modalUsdWalletLedgerDetailModal.tsx · UsdWalletActivityView.tsxMột số câu dùng “online balance”, “online USD”Đổi sang USD wallet / USD wallet balance (xem §3.1 copy table)
Agent detail — balance cardagents/AgentDetailPage.tsxUSD walletGiữ; sublabel Gross net giữ nguyên
Super Agent detailsuperAgents/SuperAgentDetailPage.tsxUSD wallet balanceGiữ
Shop detailagents/ShopDetailPage.tsxUSD walletGiữ
Finance correction modalfinance/FinanceCorrectionDebitModal.tsxUSD online balance, USD (online balance)USD wallet balance / USD wallet
Super Agent withdrawal limitsSuperAgentPortalWithdrawalLimitsCard.tsxOnline balance withdrawal limits (USD)USD wallet withdrawal limits
Payment transaction detailtransactions/TransactionDetails.tsxpaid online USD balancepaid from USD wallet / used USD wallet balance
Cash flow timelineutils/transactionCashFlowTimeline.tsUSD Wallet, USD wallet movementGiữ; đảm bảo leg labels khớp buildUsdBusinessView
Credit wallet cross-refCreditWalletActivityView.tsxUSD wallet transactionGiữ
Provider fees tableproviderFees/providerFeesColumns.tsxUSD wallet · internal transferGiữ

Admin activity copy — thay thế cụ thể (UsdWalletActivityView.tsx):

Pattern cũPattern mới
converted online balance toconverted USD wallet balance to
used online USD to buyused USD wallet balance to buy
(các câu đã có “USD wallet”)Giữ

3.2 Super Agent Portal (kioskgaming_superagent)

Page / AreaRoute / fileHiện tại (gap)Required change
Sidebar navAppLayout.tsx · /online-transactionsUSD wallet transactionsGiữ
BreadcrumbsuperAgentBreadcrumb.tsUSD wallet transactionsGiữ
Ledger pageOnlineBalanceTransactionsPage.tsxPage title USD wallet transactionstoast: Could not load online balance ledger trong hook → USD wallet ledger
DashboardDashboardPage.tsxCard USD wallet + link USD wallet transactionsGiữ
Sidebar balanceAppLayout.tsxCurrent USD balanceCó thể đổi thành USD wallet balance nếu muốn khớp Admin Super Agent detail
Credit purchaseCreditPurchaseModal.tsx · CreditPurchaseTrigger.tsxonline USD balance, Insufficient online balance, Use online USD balanceUSD wallet balance / Insufficient USD wallet balance
Managed shop walletManagedShopWalletHistoryPanel.tsxTab label USD wallet, empty No USD wallet transactions yetGiữ
Credit / USD tx listAgentTransactionsPage.tsxDùng UsdWalletTransactionDetailModal từ UI packageLabels từ shared package (§4)
Provider feesproviderFees/MethodCell.tsxUSD wallet · internal transferGiữ
Hooks / errorsuseSuperAgentOnlineBalanceLedger.tsCould not load online balance ledgerCould not load USD wallet ledger

3.3 Agent Portal (kioskgaming_agent)

Page / AreaRoute / fileHiện tại (gap)Required change
Sidebar navAppLayout.tsx · /online-transactionsOnline transactionsUSD wallet transactions (khớp Super Agent + page title)
Ledger pageOnlineBalanceTransactionsPage.tsxTitle USD wallet transactionsĐồng bộ nav (trên)
Sidebar balanceAppLayout.tsxCurrent USD balanceTùy chọn: USD wallet balance
Shop detail — tabShopDetailPageRedesign.tsxTab USD wallet txUSD wallet transactions (hoặc USD wallet nếu thiếu chỗ)
Shop detail — sectionShopDetailPageRedesign.tsxSubtitle Online balance (USD wallet) ledger entriesUSD wallet ledger entries
Shop detail — empty/loadingShopDetailPageRedesign.tsxLoading USD transactions…, No USD transactions yetUSD wallet transactions
Credit purchaseCreditPurchaseModal.tsx · CreditPurchaseTrigger.tsxGiống Super Agent — online balanceUSD wallet balance
Provider feesproviderFees/MethodCell.tsxUSD wallet · internal transferGiữ
Hooks / errorsuseAgentOnlineBalanceLedger.tsCould not load online balance ledgerCould not load USD wallet ledger

4. Shared UI package (packages/ui)

Agent + Super Agent (+ phần list Admin) dùng chung module này. Sửa một lần → cả 3 portal hưởng lợi (trừ Admin detail riêng).

ModuleFile chínhWording cần rà
portal-usd-walletledgerUtils.tsusdLedgerTypeLabel, usdPartyDisplayLabel, summary grid
PortalUsdWalletSummaryGrid.tsxCurrent USD balance, Available for withdrawal
PortalUsdWalletLedgerTable.tsxColumn headers: Owner, Type, Status, Balance before/after (net)…
PortalWithdrawalLimitsPanel.tsxWithdrawal limit copy
portal-ledgerusdTransactionPresentation.tsNhiều chỗ online USD balance / online balance → đổi sang USD wallet (balance)
UsdWalletTransactionDetailModal.tsxTiêu đề từ buildUsdBusinessView
cashFlowTimelineSample.tsSample Online balanceUSD wallet

4.1 usdTransactionPresentation.ts — copy đích

FieldHiện tạiĐổi thành
summaryLine (B2C)…from your online balance into credits…from your USD wallet into credits
subtitle (deposit)Your online USD balance increasedYour USD wallet balance increased
subtitle (withdrawal)…from your online USD balance…from your USD wallet
subtitle (generic)…affected your online USD balance…affected your USD wallet balance
balanceRows labelTotal debited from USD WalletGiữ (đã đúng)

5. Kiến trúc triển khai

┌─────────────────────────────────────────────────────────────┐
│ packages/ui │
│ portal-usd-wallet/ledgerUtils.ts │
│ portal-ledger/usdTransactionPresentation.ts │
└───────────────────────────┬─────────────────────────────────┘
│ import @kioskgaming/ui
┌───────────────────┼───────────────────┐
▼ ▼ ▼
kioskgaming_agent kioskgaming_superagent kioskgaming_admin
(nav, hooks, (hooks, credit (usdWalletLedgerUtils,
shop detail, purchase copy) ActivityView, finance modal)
credit purchase)

Thứ tự đề xuất:

  1. UI package — transaction detail + type labels (K254-UI-1)
  2. Agent + Super Agent — nav, hooks, credit purchase, shop detail (K254-AG-1, K254-SA-1)
  3. Admin — chỗ còn “online balance” + finance/super-agent cards (K254-AD-1)
  4. QC grep — không còn user-facing online balance trên 3 app in-scope (K254-QC-1)

Không đổi trong task này: tên hook useAgentOnlineBalanceLedger, endpoint online-balance, field API online_balance_net — chỉ đổi string hiển thị.


6. Implementation plan (reviewable tasks)

IDTaskRepoSize
K254-UI-1Replace online balance / online USD strings trong usdTransactionPresentation.ts + testspackages/uiS
K254-UI-2ledgerUtils.ts + PortalUsdWalletSummaryGrid (nếu cần USD wallet balance label)packages/uiXS
K254-SA-1Super Agent: credit purchase copy + hook error toastkioskgaming_superagentXS
K254-AG-1Agent: nav label, shop detail subtitles, credit purchase, hook toastkioskgaming_agentS
K254-AD-1Admin: UsdWalletActivityView, FinanceCorrectionDebitModal, SuperAgentPortalWithdrawalLimitsCard, TransactionDetailskioskgaming_adminS
K254-QC-1Grep gate + checklist QC (§7)allXS

Phụ thuộc KIOSK-260: Admin badge Refund / Balance Correction do API displayLabel — K254 không thay logic classification; chỉ đảm bảo narrative text dùng “USD wallet” thay “online balance”.


7. Test plan (QC)

7.1 Agent — nav consistency

  1. Login Agent portal.
  2. Sidebar mục /online-transactions hiển thị USD wallet transactions (không còn “Online transactions”).
  3. Page header cùng wording.

7.2 Shared detail modal

  1. Mở một row Purchase credits trên Agent hoặc Super Agent.
  2. Modal: title USD converted to credits; body không chứa “online balance”.

7.3 Withdrawal flow copy

  1. Mở Request withdrawal modal.
  2. Label Current USD balance / validation message dùng USD wallet terminology.

7.4 Admin finance correction

  1. Mở finance correction debit modal, chọn wallet USD.
  2. Không còn option label USD (online balance).

7.5 Shop detail (Agent)

  1. Agent → Shop detail → tab USD.
  2. Subtitle USD wallet ledger entries; empty state No USD wallet transactions yet.

7.6 Regression grep (automatable)

# User-facing strings — expect 0 matches in src/ (allow comments & API field names)
rg -i 'online balance' kioskgaming_admin/src kioskgaming_agent/src kioskgaming_superagent/src packages/ui/src \
--glob '!**/*.test.*'

Cho phép ngoại lệ: code comments, tên biến onlineBalanceNet, JSDoc @param onlineBalance.


8. Acceptance criteria

  • AC-1: Ba portal dùng cùng tên trang USD wallet transactions cho ledger chính (nav + header).
  • AC-2: Không còn user-facing “online balance” / “online transactions” (Agent nav) trên in-scope surfaces.
  • AC-3: Detail modal & shared ledger labels dùng USD wallet (balance) thay legacy online wording.
  • AC-4: Admin entity cards (agent / super agent / shop) vẫn hiển thị USD wallet balance — không regression.
  • AC-5: Transaction type labels thống nhất giữa list table và detail modal (shared package).

9. File index (quick lookup)

PortalFiles
Sharedpackages/ui/src/portal-usd-wallet/ledgerUtils.ts, PortalUsdWalletSummaryGrid.tsx, packages/ui/src/portal-ledger/usdTransactionPresentation.ts
AdminusdWallets/index.tsx, UsdWalletActivityView.tsx, usdWalletLedgerUtils.ts, finance/FinanceCorrectionDebitModal.tsx, superAgents/SuperAgentPortalWithdrawalLimitsCard.tsx, transactions/TransactionDetails.tsx, agents/*DetailPage.tsx, agents/ShopDetailPage.tsx
Super Agentpages/OnlineBalanceTransactionsPage.tsx, components/layout/AppLayout.tsx, components/credits/CreditPurchase*.tsx, hooks/useSuperAgentOnlineBalanceLedger.ts, components/shops/ManagedShopWalletHistoryPanel.tsx
Agentpages/OnlineBalanceTransactionsPage.tsx, pages/ShopDetailPageRedesign.tsx, components/layout/AppLayout.tsx, components/credits/CreditPurchase*.tsx, hooks/useAgentOnlineBalanceLedger.ts

10. Definition of done

  • Tất cả AC (§8) pass trên staging.
  • packages/ui build + Agent/Super Agent/Admin consume bản UI mới.
  • Grep gate §7.6 pass (với allowlist documented).
  • PR description link doc này + note overlap với KIOSK-260 nếu cùng release.

11. Ghi chú cho PM / copywriter

Nếu Jira KIOSK-254 có bảng Required change chi tiết hơn (từng scenario deposit/settlement/payout), bổ sung vào §3 dưới dạng row mới — doc này map từ inventory codebase khi ticket image không đọc được chi tiết.

Các label Balance Correction / Transaction Reversal / Refund thuộc KIOSK-260; KIOSK-254 chỉ cover tên sản phẩm USD Walletonline → USD wallet narrative, không thay taxonomy correction.