feat(claims): add insurance_name field to claims and update API responses
This commit is contained in:
@@ -17,6 +17,7 @@ interface ClaimItem {
|
||||
interface Claim {
|
||||
uuid: string;
|
||||
insurance_id: number;
|
||||
insurance_name: string | null;
|
||||
insurance_kind: string;
|
||||
total_claimed_rials: number;
|
||||
total_approved_rials: number | null;
|
||||
@@ -28,6 +29,7 @@ interface Claim {
|
||||
|
||||
interface DebtRow {
|
||||
insurance_id: number;
|
||||
insurance_name: string | null;
|
||||
claimed: number;
|
||||
approved: number;
|
||||
paid: number;
|
||||
@@ -94,7 +96,7 @@ export default function ClaimsPage() {
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
||||
{debt.map((d: DebtRow) => (
|
||||
<div key={d.insurance_id} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '8px 12px', borderRadius: 8, border: '1px solid var(--border)', fontSize: 13 }}>
|
||||
<span style={{ fontWeight: 600 }}>بیمه #{formatNumber(d.insurance_id)}</span>
|
||||
<span style={{ fontWeight: 600 }}>{d.insurance_name ?? `بیمه #${formatNumber(d.insurance_id)}`}</span>
|
||||
<span style={{ color: 'var(--text-3)' }}>ادعا {formatRial(d.claimed)} · پرداخت {formatRial(d.paid)}</span>
|
||||
<span style={{ fontWeight: 700, color: d.debt > 0 ? 'var(--danger)' : 'var(--success, #16a34a)' }}>بدهی {formatRial(d.debt)}</span>
|
||||
</div>
|
||||
@@ -129,7 +131,7 @@ export default function ClaimsPage() {
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 10 }}>
|
||||
<div>
|
||||
<div style={{ fontWeight: 600, fontSize: 13.5 }}>
|
||||
بیمه #{formatNumber(c.insurance_id)}
|
||||
{c.insurance_name ?? `بیمه #${formatNumber(c.insurance_id)}`}
|
||||
<span className="badge gray" style={{ fontSize: 10, marginInlineStart: 6 }}>{KIND_LABEL[c.insurance_kind] ?? c.insurance_kind}</span>
|
||||
<span className={`badge ${meta.cls}`} style={{ fontSize: 10, marginInlineStart: 4 }}><span className="bdot" />{meta.label}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user