diff --git a/src/app/admin/settings/page.tsx b/src/app/admin/settings/page.tsx index 470b933..9a96f74 100644 --- a/src/app/admin/settings/page.tsx +++ b/src/app/admin/settings/page.tsx @@ -95,6 +95,7 @@ interface CompanySettings { singleRent: { tier: 'Economy' | 'Standard' | 'Premium'; name: string; + contractMonths: number[]; dailyRent: number; deposit: number; weeklySubscription: number; @@ -105,6 +106,7 @@ interface CompanySettings { rentToOwn: { tier: 'Economy' | 'Standard' | 'Premium'; name: string; + contractMonths: number[]; dailyRent: number; deposit: number; weeklySubscription: number; @@ -120,6 +122,7 @@ interface CompanySettings { shareEv: { tier: 'Economy' | 'Standard' | 'Premium'; name: string; + contractMonths: number[]; dailyRentEach: number; totalDailyRent: number; depositEach: number; @@ -411,6 +414,7 @@ const initialSettings: CompanySettings = { { tier: 'Premium', name: 'Single Rent - Premium', + contractMonths: [1, 3, 6, 12], dailyRent: 400, deposit: 25000, weeklySubscription: 2800, @@ -421,6 +425,7 @@ const initialSettings: CompanySettings = { { tier: 'Standard', name: 'Single Rent - Standard', + contractMonths: [1, 3, 6, 12], dailyRent: 300, deposit: 20000, weeklySubscription: 2100, @@ -431,6 +436,7 @@ const initialSettings: CompanySettings = { { tier: 'Economy', name: 'Single Rent - Economy', + contractMonths: [1, 3, 6, 12], dailyRent: 250, deposit: 15000, weeklySubscription: 1750, @@ -443,6 +449,7 @@ const initialSettings: CompanySettings = { { tier: 'Premium', name: 'Rent to Own - Premium', + contractMonths: [12, 18, 24, 36], dailyRent: 350, deposit: 25000, weeklySubscription: 2450, @@ -458,6 +465,7 @@ const initialSettings: CompanySettings = { { tier: 'Standard', name: 'Rent to Own - Standard', + contractMonths: [12, 18, 24, 36], dailyRent: 250, deposit: 18000, weeklySubscription: 1750, @@ -473,6 +481,7 @@ const initialSettings: CompanySettings = { { tier: 'Economy', name: 'Rent to Own - Economy', + contractMonths: [12, 18, 24, 36], dailyRent: 200, deposit: 15000, weeklySubscription: 1400, @@ -490,6 +499,7 @@ const initialSettings: CompanySettings = { { tier: 'Premium', name: 'Share an EV - Premium', + contractMonths: [1, 3, 6, 12], dailyRentEach: 300, totalDailyRent: 600, depositEach: 20000, @@ -504,6 +514,7 @@ const initialSettings: CompanySettings = { { tier: 'Standard', name: 'Share an EV - Standard', + contractMonths: [1, 3, 6, 12], dailyRentEach: 200, totalDailyRent: 400, depositEach: 15000, @@ -518,6 +529,7 @@ const initialSettings: CompanySettings = { { tier: 'Economy', name: 'Share an EV - Economy', + contractMonths: [1, 3, 6, 12], dailyRentEach: 150, totalDailyRent: 300, depositEach: 12000, @@ -2202,18 +2214,14 @@ export default function CompanySettingsPage() { {settings.plans.singleRent.map((plan, idx) => (
-
- {/* {plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */} -
-

SINGLE RENT - {plan.tier} - ৳{plan.dailyRent}/day

-

{plan.description}

-
+
+

SINGLE RENT - {plan.tier} - ৳{plan.dailyRent}/day

-
+
@@ -2240,13 +2248,69 @@ export default function CompanySettingsPage() {
-
+
FICO + JAIBEN = {plan.ficoSharePercent + (100 - plan.ficoSharePercent)}% (FICO: {plan.ficoSharePercent}% + JAIBEN: {100 - plan.ficoSharePercent}%)
-
+
+ +
+ {plan.contractMonths.map(month => ( + + ))} +
+ { + if (e.key === 'Enter') { + const val = parseInt((e.target as HTMLInputElement).value); + if (val > 0 && !plan.contractMonths.includes(val)) { + const updated = [...settings.plans.singleRent]; + updated[idx].contractMonths = [...updated[idx].contractMonths, val].sort((a, b) => a - b); + setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); + (e.target as HTMLInputElement).value = ''; + } + } + }} + /> + +
+
+ {plan.contractMonths.length === 0 && ( +

No contract months selected.

+ )} +
+