refactor: implement plan tiering and expand rental options across all service categories

This commit is contained in:
sazzadulalambd
2026-05-05 04:20:17 +06:00
parent 8f73819986
commit da0df6db3e

View File

@@ -82,17 +82,17 @@ interface CompanySettings {
};
plans: {
singleRent: {
tier: 'Economy' | 'Standard' | 'Premium';
name: string;
dailyRent: number;
deposit: number;
weeklySubscription: number;
monthlySubscription: number;
ficoSharePercent: number;
jaibenKeepPercent: number;
description: string;
features: string[];
}[];
rentToOwn: {
tier: 'Economy' | 'Standard' | 'Premium';
name: string;
dailyRent: number;
deposit: number;
@@ -105,9 +105,9 @@ interface CompanySettings {
ficoRentSharePercent: number;
ficoProfitSharePercent: number;
description: string;
features: string[];
}[];
shareEv: {
tier: 'Economy' | 'Standard' | 'Premium';
name: string;
dailyRentEach: number;
totalDailyRent: number;
@@ -119,7 +119,6 @@ interface CompanySettings {
totalMonthlySubscription: number;
ficoSharePercent: number;
description: string;
features: string[];
}[];
};
}
@@ -319,20 +318,55 @@ const initialSettings: CompanySettings = {
plans: {
singleRent: [
{
name: 'Single Rent',
tier: 'Premium',
name: 'Single Rent - Premium',
dailyRent: 400,
deposit: 25000,
weeklySubscription: 2800,
monthlySubscription: 12000,
ficoSharePercent: 50,
description: 'Premium single person rental plan with extra benefits',
},
{
tier: 'Standard',
name: 'Single Rent - Standard',
dailyRent: 300,
deposit: 20000,
weeklySubscription: 2100,
monthlySubscription: 9000,
ficoSharePercent: 45,
jaibenKeepPercent: 55,
description: 'Single person rental plan with deposit and weekly/monthly subscription',
features: ['Deposit Money > 20,000TK', '1st Day Rent Advance', 'Weekly Subscription > 2,100TK', 'Monthly Subscription > 9,000TK', 'Auto Deduct from Wallet Balance', 'FICO gets 45% > 135TK', 'JAIBEN keeps 55% > 165TK']
description: 'Standard single person rental plan',
},
{
tier: 'Economy',
name: 'Single Rent - Economy',
dailyRent: 250,
deposit: 15000,
weeklySubscription: 1750,
monthlySubscription: 7500,
ficoSharePercent: 40,
description: 'Economy single person rental plan',
}
],
rentToOwn: [
{
name: 'Rent to Own',
tier: 'Premium',
name: 'Rent to Own - Premium',
dailyRent: 350,
deposit: 25000,
weeklySubscription: 2450,
monthlySubscription: 10500,
durationMonths: 18,
evPrice: 150000,
totalPayment: 170000,
profit: 20000,
ficoRentSharePercent: 50,
ficoProfitSharePercent: 45,
description: 'Premium rent to own plan with high-end EV',
},
{
tier: 'Standard',
name: 'Rent to Own - Standard',
dailyRent: 250,
deposit: 18000,
weeklySubscription: 1750,
@@ -343,13 +377,42 @@ const initialSettings: CompanySettings = {
profit: 15000,
ficoRentSharePercent: 45,
ficoProfitSharePercent: 45,
description: 'Rent to own plan - get ownership after 18 months',
features: ['Daily Rent = 250TK', 'Deposit Money > 18,000TK', 'Weekly Subscription > 1,750TK or 1,875TK', 'Monthly Subscription > 7,000TK or 7,500TK', 'Duration > 18 Months', 'In 18 months Total Pay > 1,35,000TK (EV Price 1,20,000TK)', 'Profit > 15,000TK', 'FICO gets 45% of the rent > 112 TK and Profit Share 45% > 6,750TK', 'Rider gets a brand new EV after 18 months']
description: 'Standard rent to own plan',
},
{
tier: 'Economy',
name: 'Rent to Own - Economy',
dailyRent: 200,
deposit: 15000,
weeklySubscription: 1400,
monthlySubscription: 6000,
durationMonths: 18,
evPrice: 100000,
totalPayment: 115000,
profit: 15000,
ficoRentSharePercent: 40,
ficoProfitSharePercent: 40,
description: 'Economy rent to own plan',
}
],
shareEv: [
{
name: 'Share an EV',
tier: 'Premium',
name: 'Share an EV - Premium',
dailyRentEach: 300,
totalDailyRent: 600,
depositEach: 20000,
totalDeposit: 40000,
weeklySubscriptionEach: 2100,
totalWeeklySubscription: 4200,
monthlySubscriptionEach: 8400,
totalMonthlySubscription: 16800,
ficoSharePercent: 50,
description: 'Premium shared EV with premium bikes',
},
{
tier: 'Standard',
name: 'Share an EV - Standard',
dailyRentEach: 200,
totalDailyRent: 400,
depositEach: 15000,
@@ -359,11 +422,24 @@ const initialSettings: CompanySettings = {
monthlySubscriptionEach: 5600,
totalMonthlySubscription: 11200,
ficoSharePercent: 45,
description: 'Share EV between 2 riders - split earnings',
features: ['Daily Rent = 200TK each (Total = 400TK)', 'Deposit Money > 15,000TK each (Total = 30,000TK)', 'Weekly Subscription > 1,400TK or 1,500TK each (Total = 2,800TK or 3,000TK)', 'Monthly Subscription > 5,600TK or 6,000TK each (Total = 11,200TK or 12,000TK)', 'FICO gets 45% of daily rent 90+90 > 180TK from two riders one EV', 'No ownership']
}
]
description: 'Standard shared EV plan',
},
{
tier: 'Economy',
name: 'Share an EV - Economy',
dailyRentEach: 150,
totalDailyRent: 300,
depositEach: 12000,
totalDeposit: 24000,
weeklySubscriptionEach: 1050,
totalWeeklySubscription: 2100,
monthlySubscriptionEach: 4200,
totalMonthlySubscription: 8400,
ficoSharePercent: 40,
description: 'Economy shared EV plan',
}
],
},
};
export default function CompanySettingsPage() {
@@ -1487,10 +1563,13 @@ export default function CompanySettingsPage() {
{settings.plans.singleRent.map((plan, idx) => (
<div key={idx} className="bg-white rounded-xl border border-slate-200 overflow-hidden">
<div className="bg-blue-50 px-4 py-3 border-b border-blue-100 flex items-center justify-between">
<div className="flex items-center gap-3">
{/* <span className="text-2xl">{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'}</span> */}
<div>
<h4 className="font-semibold text-blue-800">SINGLE RENT - {plan.dailyRent}/day</h4>
<h4 className="font-semibold text-blue-800">SINGLE RENT - {plan.tier} - {plan.dailyRent}/day</h4>
<p className="text-sm text-blue-600 mt-1">{plan.description}</p>
</div>
</div>
<button onClick={handleSave} className="px-3 py-1.5 bg-blue-600 text-white rounded-lg text-xs font-medium flex items-center gap-1">
<Save className="w-3 h-3" /> Save
</button>
@@ -1543,10 +1622,13 @@ export default function CompanySettingsPage() {
{settings.plans.rentToOwn.map((plan, idx) => (
<div key={idx} className="bg-white rounded-xl border border-slate-200 overflow-hidden">
<div className="bg-purple-50 px-4 py-3 border-b border-purple-100 flex items-center justify-between">
<div className="flex items-center gap-3">
{/* <span className="text-2xl">{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'}</span> */}
<div>
<h4 className="font-semibold text-purple-800">RENT TO OWN - {plan.dailyRent}/day</h4>
<h4 className="font-semibold text-purple-800">RENT TO OWN - {plan.tier} - {plan.dailyRent}/day</h4>
<p className="text-sm text-purple-600 mt-1">{plan.description}</p>
</div>
</div>
<button onClick={handleSave} className="px-3 py-1.5 bg-purple-600 text-white rounded-lg text-xs font-medium flex items-center gap-1">
<Save className="w-3 h-3" /> Save
</button>
@@ -1619,10 +1701,13 @@ export default function CompanySettingsPage() {
{settings.plans.shareEv.map((plan, idx) => (
<div key={idx} className="bg-white rounded-xl border border-slate-200 overflow-hidden">
<div className="bg-green-50 px-4 py-3 border-b border-green-100 flex items-center justify-between">
<div className="flex items-center gap-3">
{/* <span className="text-2xl">{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'}</span> */}
<div>
<h4 className="font-semibold text-green-800">SHARE AN EV - {plan.dailyRentEach}/day each (Total: {plan.totalDailyRent})</h4>
<h4 className="font-semibold text-green-800">SHARE AN EV - {plan.tier} - {plan.dailyRentEach}/day each (Total: {plan.totalDailyRent})</h4>
<p className="text-sm text-green-600 mt-1">{plan.description}</p>
</div>
</div>
<button onClick={handleSave} className="px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium flex items-center gap-1">
<Save className="w-3 h-3" /> Save
</button>