Skip to content

Audit admin panel#308

Open
github-actions[bot] wants to merge 2 commits intomasterfrom
claude/audit-admin-panel-QlQ4Q
Open

Audit admin panel#308
github-actions[bot] wants to merge 2 commits intomasterfrom
claude/audit-admin-panel-QlQ4Q

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Auto-generated PR from Claude branch

Branch: claude/audit-admin-panel-QlQ4Q
Commits ahead of master: 2
Changes: 72 files changed, 624 insertions(+), 1232 deletions(-)

Commits included

a982530 fix: align all field names with actual database column names
2135e27 fix: resolve critical user journey blockers across admin portal

Merge policy

This PR will auto-merge after CI checks pass (lint + tests).


Automatically created by the Claude automation workflow.

- Badge: add status-aware variant mapping so variant="status" renders
  correct colors for active/pending/rejected/etc across all pages
- Button: add danger and primary variant aliases used by KYC review,
  loan approval, and customer detail pages
- Header: fix profile button route (/settings/profile → /settings),
  remove hardcoded notification count from dead bell button
- Customer edit: fix 404 links (/dashboard/customers/ → /customers/)
- Customer detail: add Edit button to reach the edit page
- CollectionsQueue: fix 404 links and badge variant type errors
- ReconciliationTable: pass adminId to reconcilePayment for audit trail
- KYC document viewer: render actual <img> elements instead of
  placeholder icons so reviewers can see submitted ID documents
- Pending loans: fix field name mismatches (principal → loan_amount_usd,
  term_months → loan_term_months, monthly_payment → monthly_installment_usd,
  brand → manufacturer)
- Loans API: fix column name mismatches (loan_status → status) in
  getLoans, approveLoan, rejectLoan queries; fix device field names
  (device_brand → manufacturer, device_model → model) in select queries

https://claude.ai/code/session_01WKDXWGCznnbpgxLSCEm3WL
The types/index.ts type definitions use different field names than the
actual database columns. Since Supabase select('*') returns raw DB column
names, all renders that accessed the type-defined names showed undefined.

Loans (DB: status, not loan_status):
- loans/_client.tsx: status badge, .replace now uses global regex
- loans/[id]/_client.tsx: status badge, approve condition, monthly
  payment calculated from total_amount_due_usd / loan_term_months
- customers/[id]/_client.tsx: loan table status column

Payments (DB: amount_usd + status, not payment_amount_usd + payment_status):
- payments/_client.tsx: amount, status badge, reference columns
- payments/[id]/_client.tsx: status badge, amount, conditions for
  reconcile/retry/refund actions, loan status display
- payments API: filter uses status not payment_status, retry/refund
  update status not payment_status, stats query uses amount_usd,
  search uses transaction_id not transaction_reference

Devices (DB: manufacturer + model + imei, not device_brand + device_model + device_imei):
- devices/_client.tsx: device column render
- devices/handovers/_client.tsx: device brand display
- devices API: search filter and handover select query

https://claude.ai/code/session_01WKDXWGCznnbpgxLSCEm3WL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant