Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • A Ahad Mobile
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • holatech
  • Ahad Mobile
  • Merge requests
  • !73

feat(admin): dựng lại module Lending theo mockup, ghép API thật

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Khanh Pham requested to merge feat/admin-lending-console into develop Sep 23, 2026
  • Overview 0
  • Commits 35
  • Pipelines 3
  • Changes 89

Tóm tắt

Dựng lại module Lending của Admin Console theo mockup mới, chuyển toàn bộ từ mock sang API thật.

Sidebar Lending còn 2 mục / 3 màn (trước là 6 trang chạy trên sample-data.ts):

Route Màn
/lending redirect → /lending/markets
/lending/markets Markets — bảng 9 cột, click dòng → detail
/lending/markets/:id Market detail — 12 panel
/lending/risk Risk & operations — 6 panel

Đã xoá 6 trang mock, sample-data.ts của lending, 4 nav entry và 4 route cũ.

Tầng data

admin/src/services/lending.service.ts + hooks react-query theo pattern ramp.service.ts. Không component nào tự fetch. Thêm tag Admin - Lending vào orval.

Chất lượng

  • 13 task, mỗi task 1 implementer + 1 reviewer riêng.
  • Review toàn nhánh: kiểm từng vị trí Number/parseFloat/toFixed, Idempotency-Key giữ end-to-end kể cả lượt replay sau 401-refresh, quyền luôn render-gate chứ không disable, refusal rẽ nhánh theo code không theo HTTP status.
  • Codex gate 4 vòng: 2×P1+4×P2 → 3×P2 → 3×P2 → 2×P2+1×P3. Không còn P1 từ vòng 2.
  • 13 finding đã đóng, mỗi finding quan trọng có mutation proof: sửa hỏng code → test đỏ vì hậu quả, không phải vì cơ chế.

Gates: pnpm lint:check 0 lỗi (13 warning có sẵn) · pnpm type-check sạch · pnpm test 45 suite / 488 pass / 0 fail (trước: 460).

Quy tắc dữ liệu

  • Tỉ lệ ×100, 2 chữ số. Tiền: chuỗi 18 decimal, format theo decimals của market, cắt bớt chứ không làm tròn lên.
  • Ô không có nguồn dữ liệu render —, không bịa, không tính client-side.
  • datetime-local đọc là UTC, nhãn ghi rõ "(UTC)" — panel vốn in mọi mốc thời gian là UTC.
  • Reconciliation là verdict lưu sẵn, không recompute khi load.

Cần biết trước khi merge

  1. Chưa render thử với API thật — không có tài khoản staging đủ lending:read/configure/operate lúc làm. Xác minh gián tiếp qua test mock tầng service + type-check.
  2. 33 nhãn tiếng Việt vẫn là tiếng Anh; cột Kind hiện enum thô vì thiếu key lending.operationKind.*.
  3. Không route nào trong repo gate quyền — RequireAuth có prop permission nhưng routes.tsx:102 dùng bản trần cho cả app. Không sửa trong MR này vì đổi hành vi toàn admin, vượt phạm vi module lending.

Việc còn lại

Gate quyền tầng route · đổi <= thành < cho biên to của GET /audits · i18n operationKind · dịch 33 nhãn · filter cho All liquidation rounds · màn refunds/ageing · HOUSE inventory · nhúng decimals vào response.

Lỗi cùng họ ngoài phạm vi, đã ghi nhận không sửa: users/user-detail-page.tsx:142 — Cancel đóng panel KYC override mà không xoá reason.

🤖 Generated with Claude Code

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feat/admin-lending-console