Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
dev/v7-production-failclosed-20261021
ci/public-windows-bridge-probe-20261017
ci/windows-dispatch-bootstrap-20261016
ci/windows-dual-app-lab-20261016
dev/v7-production-failclosed-20261021
feature/reconciliation-guard-20261013
main
phase-1-foundation
phase-1-implementation
phase-2-treasury-core
phase-3-banking-reconciliation
phase-4-operations-enterprise-ux
phase-5-hardening-release
phase-6-production-platform
phase-7-production-infrastructure-bank-golive
phase-7-sql-readonly-ux-20261015
transfer-exe-to-drive-20261006
| 1 | import Link from 'next/link'; |
| 2 | |
| 3 | export type PaymentRow={ |
| 4 | id:string; |
| 5 | clientReference:string; |
| 6 | beneficiaryName:string; |
| 7 | amountIrr:number; |
| 8 | paymentDate:string; |
| 9 | state:string; |
| 10 | }; |
| 11 | |
| 12 | export function validatePaymentDraftInput(input:{ |
| 13 | sourceAccountId:string; |
| 14 | beneficiaryId:string; |
| 15 | amountIrr:number; |
| 16 | paymentDate:string; |
| 17 | clientReference:string; |
| 18 | }){ |
| 19 | const errors:string[]=[]; |
| 20 | if(!input.sourceAccountId) errors.push('sourceAccountId'); |
| 21 | if(!input.beneficiaryId) errors.push('beneficiaryId'); |
| 22 | if(!Number.isSafeInteger(input.amountIrr)||input.amountIrr<=0) errors.push('amountIrr'); |
| 23 | if(!input.paymentDate) errors.push('paymentDate'); |
| 24 | if(!input.clientReference.trim()) errors.push('clientReference'); |
| 25 | return errors; |
| 26 | } |
| 27 | |
| 28 | const stateFa:Record<string,string>={ |
| 29 | DRAFT:'پیشنویس', |
| 30 | PENDING_APPROVAL:'در انتظار تأیید', |
| 31 | APPROVED:'تأییدشده', |
| 32 | QUEUED:'در صف ارسال', |
| 33 | DISPATCHING:'در حال بررسی نتیجه ارسال', |
| 34 | SUBMITTED:'ارسالشده', |
| 35 | SETTLED:'تسویهشده', |
| 36 | FAILED:'ناموفق', |
| 37 | UNKNOWN:'نتیجه نامعلوم', |
| 38 | NEEDS_REVIEW:'نیازمند بررسی' |
| 39 | }; |
| 40 | |
| 41 | export function PaymentStatus({state}:{state:string}){ |
| 42 | return <span className={'badge badge-'+state.toLowerCase()}>{stateFa[state]??state}</span>; |
| 43 | } |
| 44 | |
| 45 | export function PaymentsTable({rows}:{rows:PaymentRow[]}){ |
| 46 | if(rows.length===0) return <div className="empty-state"><strong>حوالهای یافت نشد</strong><span>فیلترها را تغییر دهید یا یک حواله جدید ثبت کنید.</span></div>; |
| 47 | return <div className="table-wrap"><table className="data-table"> |
| 48 | <thead><tr><th>مرجع</th><th>ذینفع</th><th>مبلغ</th><th>تاریخ</th><th>وضعیت</th><th></th></tr></thead> |
| 49 | <tbody>{rows.map(row=><tr key={row.id}> |
| 50 | <td><strong>{row.clientReference}</strong></td> |
| 51 | <td>{row.beneficiaryName}</td> |
| 52 | <td>{row.amountIrr.toLocaleString('fa-IR')} ریال</td> |
| 53 | <td>{row.paymentDate}</td> |
| 54 | <td><PaymentStatus state={row.state}/></td> |
| 55 | <td><Link className="table-action" href={'/payments/'+row.id}>جزئیات</Link></td> |
| 56 | </tr>)}</tbody> |
| 57 | </table></div>; |
| 58 | } |