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
-
+
-
+
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.
+ )}
+
+
@@ -2261,18 +2325,14 @@ export default function CompanySettingsPage() {
{settings.plans.rentToOwn.map((plan, idx) => (
-
- {/*
{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */}
-
-
RENT TO OWN - {plan.tier} - ৳{plan.dailyRent}/day
-
{plan.description}
-
+
+
RENT TO OWN - {plan.tier} - ৳{plan.dailyRent}/day
-
+
-
+
FICO + JAIBEN =
{plan.ficoRentSharePercent + plan.ficoProfitSharePercent + (100 - plan.ficoRentSharePercent - plan.ficoProfitSharePercent)}% (FICO Rent: {plan.ficoRentSharePercent}% + FICO Profit: {plan.ficoProfitSharePercent}% + JAIBEN: {100 - plan.ficoRentSharePercent - plan.ficoProfitSharePercent}%)
-
+
+
+
+ {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.rentToOwn];
+ updated[idx].contractMonths = [...updated[idx].contractMonths, val].sort((a, b) => a - b);
+ setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } });
+ (e.target as HTMLInputElement).value = '';
+ }
+ }
+ }}
+ />
+
+
+
+ {plan.contractMonths.length === 0 && (
+
No contract months selected.
+ )}
+
+
@@ -2340,18 +2456,14 @@ export default function CompanySettingsPage() {
{settings.plans.shareEv.map((plan, idx) => (
-
- {/*
{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */}
-
-
SHARE AN EV - {plan.tier} - ৳{plan.dailyRentEach}/day each (Total: ৳{plan.totalDailyRent})
-
{plan.description}
-
+
+
SHARE AN EV - {plan.tier} - ৳{plan.dailyRentEach}/day each (Total: ৳{plan.totalDailyRent})
-
+
-
+
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.shareEv];
+ updated[idx].contractMonths = [...updated[idx].contractMonths, val].sort((a, b) => a - b);
+ setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } });
+ (e.target as HTMLInputElement).value = '';
+ }
+ }
+ }}
+ />
+
+
+
+ {plan.contractMonths.length === 0 && (
+
No contract months selected.
+ )}
+
+