From 53bd87e807387f854723f046d888f4fa81d42223 Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Fri, 17 Jul 2026 14:40:00 +0330 Subject: [PATCH] feat(admin): show payment date/time and recorder on session payments Each recorded payment row (PaymentStep + DetailsStep) now shows the payment date+time (paid_at, Jalali via formatDateTime, falling back to created_at) and the user who recorded it (created_by_name) beneath the method/amount line. Both fields were already in the API payload. Add created_at to SessionPaymentEntry. Co-Authored-By: Claude Fable 5 --- assets/admin/components/SessionServiceCard.tsx | 1 + .../admin/components/session/DetailsStep.tsx | 18 ++++++++++++------ .../admin/components/session/PaymentStep.tsx | 18 ++++++++++++------ 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/assets/admin/components/SessionServiceCard.tsx b/assets/admin/components/SessionServiceCard.tsx index 5a7b2edd..391ef77f 100644 --- a/assets/admin/components/SessionServiceCard.tsx +++ b/assets/admin/components/SessionServiceCard.tsx @@ -7,6 +7,7 @@ export interface SessionPaymentEntry { method: string; amount_rials: number; paid_at?: number; + created_at?: number; created_by_name?: string | null; } diff --git a/assets/admin/components/session/DetailsStep.tsx b/assets/admin/components/session/DetailsStep.tsx index cf278a06..f95a14d4 100644 --- a/assets/admin/components/session/DetailsStep.tsx +++ b/assets/admin/components/session/DetailsStep.tsx @@ -101,12 +101,18 @@ export default function DetailsStep({ session, recordUuid, onBack, onFinish }: P {payments.length === 0 ? ( پرداختی ثبت نشده است ) : payments.map((p) => ( -
- - - {METHOD_LABELS[p.method] ?? p.method} - - مبلغ: {formatRial(p.amount_rials)} +
+
+ + + {METHOD_LABELS[p.method] ?? p.method} + + مبلغ: {formatRial(p.amount_rials)} +
+
+ {(p.paid_at ?? p.created_at) && {formatDateTime(p.paid_at ?? p.created_at!)}} + {p.created_by_name && ثبت: {p.created_by_name}} +
))} diff --git a/assets/admin/components/session/PaymentStep.tsx b/assets/admin/components/session/PaymentStep.tsx index 85136a62..b51b65c7 100644 --- a/assets/admin/components/session/PaymentStep.tsx +++ b/assets/admin/components/session/PaymentStep.tsx @@ -252,12 +252,18 @@ export default function PaymentStep({ recordUuid, session, walletBalance, onCont ) : (
{payments.map((p) => ( -
- - - {METHOD_LABELS[p.method] ?? p.method} - - مبلغ : {formatRial(p.amount_rials)} +
+
+ + + {METHOD_LABELS[p.method] ?? p.method} + + مبلغ : {formatRial(p.amount_rials)} +
+
+ {(p.paid_at ?? p.created_at) && {formatDateTime(p.paid_at ?? p.created_at!)}} + {p.created_by_name && ثبت: {p.created_by_name}} +
))}