[Issue]: On manager dashboard, overhaul approved spend card #50
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
feature
interactive
portal
triaged
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shad0w/pelagia-portal#50
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised by
Kaushal Pal Singh (kps@pelagiamarine.com, MANAGER) — via portal Report Issue button
Description
Priority
P2 — Medium
Context
/dashboardClaude triage
Triage — Issue #50: Overhaul "Total Approved Spend" card on manager dashboard
Type: feature (display enhancement to existing behaviour)
Priority: P2 — Medium
Reporter: Kaushal Pal Singh (MANAGER)
Page:
/dashboard(Manager view)Interpretation
The "approved spend card" is the "Total Approved Spend"
StatCardrendered only inManagerDashboard(app/(portal)/dashboard/page.tsx:185). The reporter asks for two changes:"Remove the dollar sign, replace with rupee." The textual value already renders in
INR —
formatCurrency()usesIntl.NumberFormat("en-IN", { currency: "INR" }), so italready shows
₹. The actual$the manager sees is theDollarSignlucide iconpassed to this card (
icon={DollarSign}). Fix = swap that icon for the rupee icon.lucide-react@0.468shipsIndianRupee(confirmed:indian-rupee.jspresent in theinstalled package), so the rupee icon is available.
"Round up to make it easier to read — 49 L, 2 Cr." Render the amount in the Indian
short scale (lakh = 1e5, crore = 1e7) with a rounded/abbreviated value instead of the
full
₹49,00,000.00. Needs a new compact formatter.Concrete action items
lib/utils.ts— e.g.formatCompactINR(amount)returning
₹2 Cr,₹49 L,₹75 K, etc. (≥1 Cr → "Cr", ≥1 L → "L", ≥1 K → "K",else plain). Round to ~1–2 significant decimals, trimming trailing
.0.app/(portal)/dashboard/page.tsx):import { ..., IndianRupee }and dropDollarSignif no longer used (it is also usedby
AccountsDashboardandGenericDashboard— check before removing the import).icon={IndianRupee}andvalue={formatCompactINR(totalSpend)}.tests/unit/utils.test.tsforformatCompactINRcovering crore,lakh, thousand, sub-thousand, and zero boundaries (mirrors existing
formatCurrencytest block).
Files / areas involved
App/lib/utils.ts— newformatCompactINRhelper (alongsideformatCurrency).App/app/(portal)/dashboard/page.tsx—ManagerDashboardcard icon + value; lucide imports.App/components/dashboard/stat-card.tsx— no change needed (acceptsstring | numbervalue & anyLucideIcon).App/tests/unit/utils.test.ts— new tests.Open questions
ordinary rounding to a readable figure. Default to rounding to 1–2 significant figures
(not strict ceiling) unless the reporter insists.
DollarSignicon + fullformatCurrencyvalue also appear on the Accounts card ("Payment Queue Value") andthe Recent/Recent-Approved tables. Recommend keeping changes scoped to the manager
"Total Approved Spend" card only; tables likely should stay precise.
₹prefix(assumed yes) — minor, dev can pick sensible defaults.
Verification
pnpm type-check,pnpm lint, andpnpm test -- tests/unit/utils.test.ts. No DB,auth, payment-processing, or external-system involvement — purely display formatting.
Routing rationale: Localized 3-file display-only change (icon swap + new pure formatting util) with clear acceptance and unit-test verification, touching no DB/auth/payment-processing/external systems → claude-queue.
Routing:
claude-queue| Type:feature[Claude] Started working on this issue on branch
claude/issue-50.[Claude] Opened PR #51 with a proposed fix. Review and merge it, then create a release tag to deploy.