diff --git a/src/app/admin/batteries/[id]/page.tsx b/src/app/admin/batteries/[id]/page.tsx index 1dadfed..0ce336d 100644 --- a/src/app/admin/batteries/[id]/page.tsx +++ b/src/app/admin/batteries/[id]/page.tsx @@ -97,7 +97,12 @@ interface Battery { lastMaintenance?: string; nextMaintenance?: string; bmsData?: BMSData; - monthlyRent?: number; + deposit?: number; + rentPrice?: number; + investorId?: string; + investorName?: string; + investorSharePercentage?: number; + investedAmount?: number; ownershipLogs: OwnershipLog[]; damageHistory?: DamageRecord[]; maintenanceHistory?: MaintenanceRecord[]; @@ -126,7 +131,12 @@ const mockBattery: Battery = { assignedBikerPhone: '01712345678', currentHubId: 'HUB-001', currentHubName: 'JAIBEN Head Office', - monthlyRent: 1500, + deposit: 5000, + rentPrice: 150, + investorId: 'INV-001', + investorName: 'Tahmid Rahman', + investorSharePercentage: 60, + investedAmount: 45000, lastMaintenance: '2024-03-01', nextMaintenance: '2024-06-01', bmsData: { voltage: 67.2, current: -2.5, soc: 78, temperature: 32, cycles: 156, health: 95, timestamp: '2024-03-28 12:00:00' }, @@ -549,12 +559,14 @@ export default function BatteryDetailPage({ params }: { params: Promise<{ id: st

Purchase Price

৳{battery.purchasePrice.toLocaleString()}

- {battery.monthlyRent && ( -
-

Monthly Rent

-

৳{battery.monthlyRent}/month

-
- )} +
+

Deposit

+

৳{(battery.deposit || 5000).toLocaleString()}

+
+
+

Daily Rent Price

+

৳{(battery.rentPrice || 150).toLocaleString()}/day

+
)} @@ -646,13 +658,18 @@ export default function BatteryDetailPage({ params }: { params: Promise<{ id: st

Rent Information

- {battery.monthlyRent ? ( + {battery.rentPrice ? (
-
+
-

Monthly Rent Amount

-

৳{battery.monthlyRent}

-

per month

+

Daily Rent Price

+

৳{battery.rentPrice.toLocaleString()}

+

per day

+
+
+

Battery Deposit

+

৳{(battery.deposit || 0).toLocaleString()}

+

refundable

Status

@@ -970,8 +987,8 @@ export default function BatteryDetailPage({ params }: { params: Promise<{ id: st

{battery.currentHubName || battery.currentStationName || 'Not Assigned'}

-

Monthly Rent

-

৳{battery.monthlyRent}/month

+

Daily Rent

+

৳{(battery.rentPrice || 150)}/day

@@ -1099,11 +1116,20 @@ function EditBatteryModal({ />
- + handleChange('monthlyRent', parseInt(e.target.value))} + value={formData.deposit || 0} + onChange={(e) => handleChange('deposit', parseInt(e.target.value))} + className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm" + /> +
+
+ + handleChange('rentPrice', parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm" />
diff --git a/src/app/admin/batteries/page.tsx b/src/app/admin/batteries/page.tsx index adeb3d0..4854ca2 100644 --- a/src/app/admin/batteries/page.tsx +++ b/src/app/admin/batteries/page.tsx @@ -63,6 +63,8 @@ interface Battery { lastMaintenance?: string; nextMaintenance?: string; bmsData?: BMSData; + deposit?: number; + rentPrice?: number; history: BatteryHistory[]; } @@ -99,6 +101,8 @@ const mockBatteries: Battery[] = [ voltage: 60, purchaseDate: '2024-01-15', purchasePrice: 45000, + deposit: 5000, + rentPrice: 150, warrantyExpiry: '2027-01-15', status: 'in-use', currentSoc: 78, @@ -129,6 +133,8 @@ const mockBatteries: Battery[] = [ voltage: 48, purchaseDate: '2024-02-01', purchasePrice: 38000, + deposit: 4000, + rentPrice: 120, warrantyExpiry: '2027-02-01', status: 'available', currentSoc: 100, @@ -150,6 +156,8 @@ const mockBatteries: Battery[] = [ voltage: 60, purchaseDate: '2024-01-20', purchasePrice: 42000, + deposit: 4500, + rentPrice: 130, warrantyExpiry: '2027-01-20', status: 'maintenance', currentSoc: 15, @@ -172,6 +180,8 @@ const mockBatteries: Battery[] = [ voltage: 60, purchaseDate: '2024-02-15', purchasePrice: 46000, + deposit: 5000, + rentPrice: 150, warrantyExpiry: '2027-02-15', status: 'in-use', currentSoc: 92, @@ -200,6 +210,8 @@ const mockBatteries: Battery[] = [ voltage: 60, purchaseDate: '2024-03-01', purchasePrice: 50000, + deposit: 5500, + rentPrice: 160, warrantyExpiry: '2027-03-01', status: 'charging', currentSoc: 85, @@ -221,6 +233,8 @@ const mockBatteries: Battery[] = [ voltage: 48, purchaseDate: '2023-06-15', purchasePrice: 28000, + deposit: 3000, + rentPrice: 90, warrantyExpiry: '2026-06-15', status: 'retired', currentSoc: 0, @@ -896,6 +910,26 @@ function BatteryForm({ battery, onSave, onCancel }: { battery: Battery | null; o className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-accent" /> +
+ + handleChange('deposit', parseInt(e.target.value))} + placeholder="5000" + className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-accent" + /> +
+
+ + handleChange('rentPrice', parseInt(e.target.value))} + placeholder="150" + className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-accent" + /> +