diff --git a/src/app/components/VehicleCard.tsx b/src/app/components/VehicleCard.tsx index c2a70f4..fcdac0f 100644 --- a/src/app/components/VehicleCard.tsx +++ b/src/app/components/VehicleCard.tsx @@ -28,7 +28,7 @@ export default function VehicleCard({ vehicle, onDelete, onEdit }: VehicleCardPr
Mileage: - {vehicle.mileage.toLocaleString()} miles + {(vehicle.mileage ?? 0).toLocaleString()} miles
diff --git a/src/app/components/dashboards/CustomerDashboard.tsx b/src/app/components/dashboards/CustomerDashboard.tsx index 32c8fee..00b8bd7 100644 --- a/src/app/components/dashboards/CustomerDashboard.tsx +++ b/src/app/components/dashboards/CustomerDashboard.tsx @@ -155,7 +155,7 @@ const CustomerDashboard: React.FC = ({ profile }) => { overdueInvoices.slice(0, 3).map((invoice) => (

Invoice {invoice.invoiceNumber}

-

Amount due: LKR {invoice.totalAmount.toLocaleString()}

+

Amount due: LKR {(invoice.totalAmount ?? 0).toLocaleString()}

{formatCurrency(payment.amount)} - {payment.paymentMethod.replace('_', ' ')} + {payment.paymentMethod?.replace('_', ' ') ?? '—'} - - {payment.paymentStatus} + + {payment.paymentStatus ?? 'UNKNOWN'} - {formatDate(payment.processedAt ?? payment.createdAt)} + {payment.processedAt ? formatDate(payment.processedAt) : (payment.createdAt ? formatDate(payment.createdAt) : '—')} {payment.notes ?? '—'} ))} diff --git a/src/app/dashboard/vehicles/[vehicleId]/page.tsx b/src/app/dashboard/vehicles/[vehicleId]/page.tsx index be97817..854f162 100644 --- a/src/app/dashboard/vehicles/[vehicleId]/page.tsx +++ b/src/app/dashboard/vehicles/[vehicleId]/page.tsx @@ -183,7 +183,7 @@ export default function VehicleDetailsPage() {

Mileage

-
{vehicle.mileage.toLocaleString()} mi
+
{(vehicle.mileage ?? 0).toLocaleString()} mi

Color