[Issue]: Activity should log partial payment amount #140
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
epic
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#140
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
Partial payment of xyz confirmed instead of partial payment confirmed
Priority
P2 — Medium
Context
/po/cmqs2r112007ruxawl0z5e5t2Claude triage
Triage — Issue #140: Activity should log partial payment amount
Interpretation
When Accounts confirms a partial payment, the PO Activity (audit trail)
timeline shows a generic line:
The reporter (a Manager, viewing PO
cmqs2r112007ruxawl0z5e5t2) wants theamount of that partial payment included, e.g.:
This is purely a display enhancement. The amount is already persisted — when
markPaid()writes thePARTIAL_PAYMENT_CONFIRMEDaction it recordsmetadata.paymentAmount(the amount paid in this instalment) plusmetadata.totalPaid(running total) and
metadata.paymentRef. Nothing in the payment flow, moneycomputation, or DB needs to change; only the activity-log rendering needs to read that
metadata and surface it.
Action items
components/po/po-detail.tsx, the Activity timeline (≈ line 575–589) renders eachrow's title from the static
ACTION_LABELSmap (≈ line 90–108), wherePARTIAL_PAYMENT_CONFIRMED → "Partial payment confirmed".PARTIAL_PAYMENT_CONFIRMED, interpolates theamount: read
action.metadata.paymentAmount(already typed asPrisma.JsonValueon the action — see line 78) and format it with the existingformatCurrency(amount, po.currency)helper (already imported from@/lib/utils,line 8; pattern already used at lines 312–313, 556).
"Partial payment confirmed"label whenpaymentAmountis missing/non-numeric (e.g. older audit rows) so historicalPOs never render
NaN/undefined.pattern could enrich
PAYMENT_SENTwithmetadata, but the issue only asks for thepartial case — keep scope tight.)
Files / areas involved
components/po/po-detail.tsx— Activity timeline render +ACTION_LABELSmap (theonly render site;
grepconfirmsPARTIAL_PAYMENT_CONFIRMEDis rendered only here).app/(portal)/payments/actions.ts— read only for confirmation thatmetadata.paymentAmountis already written (line 123–130); no change needed.lib/utils.ts— reuseformatCurrency(no change).and falls back gracefully when metadata is absent.
Open questions
"Partial payment of <amount> confirmed"using the PO'sown currency via
formatCurrency(amount, po.currency). (Sensible default matching thereporter's "Partial payment of xyz confirmed" phrasing.)
paymentAmount(matches the reporter'sintent), not the running
totalPaid. The running total can stay out of the label.Risk / safety assessment
migration, no schema change, no auth/permission change, no change to payment
processing or money computation, no external system.
pnpm type-check/pnpm lintand a focused unit test on the label.we only display a persisted value, so the queue exclusion is not triggered.
Routing rationale: localized, display-only audit-log change reading already-persisted
metadata.paymentAmountwith clear acceptance and unit/type-check verifiability, touchingno migration/auth/payment-logic/external systems → claude-queue.
Routing:
claude-queue| Type:feature[Claude] Started working on this issue on branch
claude/issue-140.[Claude] Opened PR #141 with a proposed fix. Review and merge it, then create a release tag to deploy.