feat: implement super_admin role, add swap station user, and update login routing logic
This commit is contained in:
@@ -6,11 +6,12 @@ import { users } from '@/data/mockData';
|
|||||||
import { Zap, ArrowRight, Bike, Wallet, Shield, Users, Calculator, Store, Truck } from 'lucide-react';
|
import { Zap, ArrowRight, Bike, Wallet, Shield, Users, Calculator, Store, Truck } from 'lucide-react';
|
||||||
|
|
||||||
const demoUsers = [
|
const demoUsers = [
|
||||||
{ email: 'superadmin@jaiben.com', role: 'admin', label: 'Super Admin', icon: Shield, color: 'bg-accent' },
|
{ email: 'superadmin@jaiben.com', role: 'super_admin', label: 'Super Admin', icon: Shield, color: 'bg-accent' },
|
||||||
{ email: 'admin@jaiben.com', role: 'manager', label: 'Admin Manager', icon: Users, color: 'bg-blue-500' },
|
{ email: 'admin@jaiben.com', role: 'admin', label: 'Admin Manager', icon: Users, color: 'bg-blue-500' },
|
||||||
{ email: 'staff@jaiben.com', role: 'staff', label: 'Front Desk', icon: Users, color: 'bg-purple-500' },
|
{ email: 'staff@jaiben.com', role: 'staff', label: 'Front Desk', icon: Users, color: 'bg-purple-500' },
|
||||||
{ email: 'accountant@jaiben.com', role: 'accountant', label: 'Accountant', icon: Calculator, color: 'bg-green-500' },
|
{ email: 'accountant@jaiben.com', role: 'accountant', label: 'Accountant', icon: Calculator, color: 'bg-green-500' },
|
||||||
{ email: 'investor@email.com', role: 'investor', label: 'Investor', icon: Wallet, color: 'bg-amber-500' },
|
{ email: 'investor@email.com', role: 'investor', label: 'Investor', icon: Wallet, color: 'bg-amber-500' },
|
||||||
|
{ email: 'swap@jaiben.com', role: 'swap-station', label: 'Swap Station', icon: Zap, color: 'bg-purple-500' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function LoginPage() {
|
export default function LoginPage() {
|
||||||
@@ -34,14 +35,15 @@ export default function LoginPage() {
|
|||||||
sessionStorage.setItem('userRole', user.role);
|
sessionStorage.setItem('userRole', user.role);
|
||||||
sessionStorage.setItem('userName', user.name);
|
sessionStorage.setItem('userName', user.name);
|
||||||
|
|
||||||
switch (user.role) {
|
switch (user.role) {
|
||||||
|
case 'super_admin':
|
||||||
case 'admin':
|
case 'admin':
|
||||||
case 'manager':
|
case 'manager':
|
||||||
case 'staff':
|
case 'staff':
|
||||||
router.push('/admin');
|
router.push('/admin');
|
||||||
break;
|
break;
|
||||||
case 'accountant':
|
case 'accountant':
|
||||||
router.push('/admin');
|
router.push('/admin/accounting');
|
||||||
break;
|
break;
|
||||||
case 'investor':
|
case 'investor':
|
||||||
router.push('/investor');
|
router.push('/investor');
|
||||||
@@ -56,33 +58,34 @@ export default function LoginPage() {
|
|||||||
router.push('/merchant');
|
router.push('/merchant');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
router.push('/');
|
router.push('/login');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setError('Invalid email or password. Try demo123');
|
setError('Invalid email or password. Try demo123');
|
||||||
}
|
}
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleQuickLogin = async (userEmail: string) => {
|
const handleQuickLogin = async (userEmail: string) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
await new Promise(resolve => setTimeout(resolve, 500));
|
await new Promise(resolve => setTimeout(resolve, 500));
|
||||||
|
|
||||||
const user = users.find(u => u.email === userEmail);
|
const user = users.find(u => u.email === userEmail);
|
||||||
if (user) {
|
if (user) {
|
||||||
sessionStorage.setItem('authToken', 'demo-token');
|
sessionStorage.setItem('authToken', 'demo-token');
|
||||||
sessionStorage.setItem('userRole', user.role);
|
sessionStorage.setItem('userRole', user.role);
|
||||||
sessionStorage.setItem('userName', user.name);
|
sessionStorage.setItem('userName', user.name);
|
||||||
|
|
||||||
switch (user.role) {
|
switch (user.role) {
|
||||||
|
case 'super_admin':
|
||||||
case 'admin':
|
case 'admin':
|
||||||
case 'manager':
|
case 'manager':
|
||||||
case 'staff':
|
case 'staff':
|
||||||
router.push('/admin');
|
router.push('/admin');
|
||||||
break;
|
break;
|
||||||
case 'accountant':
|
case 'accountant':
|
||||||
router.push('/admin');
|
router.push('/admin/accounting');
|
||||||
break;
|
break;
|
||||||
case 'investor':
|
case 'investor':
|
||||||
router.push('/investor');
|
router.push('/investor');
|
||||||
@@ -140,7 +143,7 @@ export default function LoginPage() {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="password" className="block text-sm font-medium text-slate-300 mb-2">
|
<label htmlFor="password" className="block text-sm font-medium text-slate-300 mb-2">
|
||||||
Password
|
Password <span className="text-slate-500 text-xs">(demo: demo123)</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ export interface User {
|
|||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
phone: string;
|
phone: string;
|
||||||
role: 'biker' | 'admin' | 'manager' | 'staff' | 'accountant' | 'investor' | 'swap-station' | 'merchant';
|
role: 'biker' | 'super_admin' | 'admin_manager' | 'staff' | 'accountant' | 'investor' | 'swap-station' | 'merchant';
|
||||||
avatar?: string;
|
avatar?: string;
|
||||||
status: 'active' | 'pending' | 'inactive';
|
status: 'active' | 'pending' | 'inactive';
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
@@ -157,6 +157,7 @@ export interface Delivery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const users: User[] = [
|
export const users: User[] = [
|
||||||
|
{ id: 'u0', name: 'Super Admin', email: 'superadmin@jaiben.com', phone: '01710000000', role: 'super_admin', status: 'active', createdAt: '2023-01-01' },
|
||||||
{ id: 'u1', name: 'Rahim Ahmed', email: 'rahim@email.com', phone: '01712345678', role: 'biker', status: 'active', createdAt: '2024-01-15' },
|
{ id: 'u1', name: 'Rahim Ahmed', email: 'rahim@email.com', phone: '01712345678', role: 'biker', status: 'active', createdAt: '2024-01-15' },
|
||||||
{ id: 'u2', name: 'Karim Hasan', email: 'karim@email.com', phone: '01712345679', role: 'biker', status: 'active', createdAt: '2024-02-20' },
|
{ id: 'u2', name: 'Karim Hasan', email: 'karim@email.com', phone: '01712345679', role: 'biker', status: 'active', createdAt: '2024-02-20' },
|
||||||
{ id: 'u3', name: 'Admin User', email: 'admin@jaiben.com', phone: '01710000001', role: 'admin', status: 'active', createdAt: '2023-06-01' },
|
{ id: 'u3', name: 'Admin User', email: 'admin@jaiben.com', phone: '01710000001', role: 'admin', status: 'active', createdAt: '2023-06-01' },
|
||||||
@@ -169,59 +170,59 @@ export const users: User[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const bikes: Bike[] = [
|
export const bikes: Bike[] = [
|
||||||
{
|
{
|
||||||
id: 'EV001', model: 'Etron ET50', brand: 'Etron', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-1234', status: 'rented', batteryLevel: 78, location: 'Gulshan 1', assignedTo: 'u1', investorId: 'inv1', purchasePrice: 85000, purchaseDate: '2024-01-15', currentRent: 350, totalEarnings: 14250,
|
id: 'EV001', model: 'Etron ET50', brand: 'Etron', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-1234', status: 'rented', batteryLevel: 78, location: 'Gulshan 1', assignedTo: 'u1', investorId: 'inv1', purchasePrice: 85000, purchaseDate: '2024-01-15', currentRent: 350, totalEarnings: 14250,
|
||||||
assignmentHistory: [
|
assignmentHistory: [
|
||||||
{ id: 'ash1', bikeId: 'EV001', bikerId: 'u3', bikerName: 'Rahim Khan', assignedAt: '2024-01-20 10:30:00', assignedBy: 'admin1', unassignedAt: '2024-02-15 14:20:00', unassignedBy: 'admin1', reason: 'Bike transfer to another biker', status: 'completed', notes: 'Initial assignment' },
|
{ id: 'ash1', bikeId: 'EV001', bikerId: 'u3', bikerName: 'Rahim Khan', assignedAt: '2024-01-20 10:30:00', assignedBy: 'admin1', unassignedAt: '2024-02-15 14:20:00', unassignedBy: 'admin1', reason: 'Bike transfer to another biker', status: 'completed', notes: 'Initial assignment' },
|
||||||
{ id: 'ash2', bikeId: 'EV001', bikerId: 'u1', bikerName: 'Karim Ahmed', assignedAt: '2024-02-15 15:00:00', assignedBy: 'admin1', status: 'active', notes: 'Reassigned after maintenance' }
|
{ id: 'ash2', bikeId: 'EV001', bikerId: 'u1', bikerName: 'Karim Ahmed', assignedAt: '2024-02-15 15:00:00', assignedBy: 'admin1', status: 'active', notes: 'Reassigned after maintenance' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV002', model: 'Yadea DT3', brand: 'Yadea', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-5678', status: 'available', batteryLevel: 95, location: 'Banani', investorId: 'inv1', purchasePrice: 65000, purchaseDate: '2024-01-20', currentRent: 0, totalEarnings: 12750,
|
id: 'EV002', model: 'Yadea DT3', brand: 'Yadea', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-5678', status: 'available', batteryLevel: 95, location: 'Banani', investorId: 'inv1', purchasePrice: 65000, purchaseDate: '2024-01-20', currentRent: 0, totalEarnings: 12750,
|
||||||
assignmentHistory: [
|
assignmentHistory: [
|
||||||
{ id: 'ash3', bikeId: 'EV002', bikerId: 'u1', bikerName: 'Karim Ahmed', assignedAt: '2024-01-25 09:00:00', assignedBy: 'admin1', unassignedAt: '2024-03-01 11:30:00', unassignedBy: 'admin1', reason: 'Rental completed', status: 'completed', notes: 'First rental period' }
|
{ id: 'ash3', bikeId: 'EV002', bikerId: 'u1', bikerName: 'Karim Ahmed', assignedAt: '2024-01-25 09:00:00', assignedBy: 'admin1', unassignedAt: '2024-03-01 11:30:00', unassignedBy: 'admin1', reason: 'Rental completed', status: 'completed', notes: 'First rental period' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV003', model: 'AIMA Lightning', brand: 'AIMA', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-9012', status: 'rented', batteryLevel: 62, location: 'Uttara', assignedTo: 'u2', investorId: 'inv2', purchasePrice: 95000, purchaseDate: '2023-11-05', currentRent: 450, totalEarnings: 22500,
|
id: 'EV003', model: 'AIMA Lightning', brand: 'AIMA', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-9012', status: 'rented', batteryLevel: 62, location: 'Uttara', assignedTo: 'u2', investorId: 'inv2', purchasePrice: 95000, purchaseDate: '2023-11-05', currentRent: 450, totalEarnings: 22500,
|
||||||
assignmentHistory: [
|
assignmentHistory: [
|
||||||
{ id: 'ash4', bikeId: 'EV003', bikerId: 'u4', bikerName: 'Jamal Hossain', assignedAt: '2023-11-10 08:00:00', assignedBy: 'admin1', unassignedAt: '2024-01-05 16:00:00', unassignedBy: 'admin1', reason: 'Bike returned for maintenance', status: 'completed' },
|
{ id: 'ash4', bikeId: 'EV003', bikerId: 'u4', bikerName: 'Jamal Hossain', assignedAt: '2023-11-10 08:00:00', assignedBy: 'admin1', unassignedAt: '2024-01-05 16:00:00', unassignedBy: 'admin1', reason: 'Bike returned for maintenance', status: 'completed' },
|
||||||
{ id: 'ash5', bikeId: 'EV003', bikerId: 'u2', bikerName: 'Sofiq Rahman', assignedAt: '2024-01-10 10:00:00', assignedBy: 'admin1', status: 'active', notes: 'Rent-to-own agreement' }
|
{ id: 'ash5', bikeId: 'EV003', bikerId: 'u2', bikerName: 'Sofiq Rahman', assignedAt: '2024-01-10 10:00:00', assignedBy: 'admin1', status: 'active', notes: 'Rent-to-own agreement' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV004', model: 'TVS iQube', brand: 'TVS', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-3456', status: 'maintenance', batteryLevel: 45, location: 'Workshop', investorId: 'inv2', purchasePrice: 72000, purchaseDate: '2023-12-01', currentRent: 0, totalEarnings: 8500,
|
id: 'EV004', model: 'TVS iQube', brand: 'TVS', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-3456', status: 'maintenance', batteryLevel: 45, location: 'Workshop', investorId: 'inv2', purchasePrice: 72000, purchaseDate: '2023-12-01', currentRent: 0, totalEarnings: 8500,
|
||||||
assignmentHistory: [
|
assignmentHistory: [
|
||||||
{ id: 'ash6', bikeId: 'EV004', bikerId: 'u5', bikerName: 'Ripon Mia', assignedAt: '2023-12-05 12:00:00', assignedBy: 'admin1', unassignedAt: '2024-03-10 09:00:00', unassignedBy: 'admin1', reason: 'Battery replacement - under maintenance', status: 'completed', notes: 'Battery damaged, sent to workshop' }
|
{ id: 'ash6', bikeId: 'EV004', bikerId: 'u5', bikerName: 'Ripon Mia', assignedAt: '2023-12-05 12:00:00', assignedBy: 'admin1', unassignedAt: '2024-03-10 09:00:00', unassignedBy: 'admin1', reason: 'Battery replacement - under maintenance', status: 'completed', notes: 'Battery damaged, sent to workshop' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV005', model: 'Bajaj Chetak', brand: 'Bajaj', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-7890', status: 'available', batteryLevel: 100, location: 'Dhanmondi', investorId: 'inv2', purchasePrice: 68000, purchaseDate: '2023-11-10', currentRent: 0, totalEarnings: 20000,
|
id: 'EV005', model: 'Bajaj Chetak', brand: 'Bajaj', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-7890', status: 'available', batteryLevel: 100, location: 'Dhanmondi', investorId: 'inv2', purchasePrice: 68000, purchaseDate: '2023-11-10', currentRent: 0, totalEarnings: 20000,
|
||||||
assignmentHistory: [
|
assignmentHistory: [
|
||||||
{ id: 'ash7', bikeId: 'EV005', bikerId: 'u6', bikerName: 'Mizanur Rahman', assignedAt: '2023-11-15 14:00:00', assignedBy: 'admin1', unassignedAt: '2024-02-20 10:30:00', unassignedBy: 'admin1', reason: 'Biker requested return', status: 'completed', notes: 'Returned in good condition' }
|
{ id: 'ash7', bikeId: 'EV005', bikerId: 'u6', bikerName: 'Mizanur Rahman', assignedAt: '2023-11-15 14:00:00', assignedBy: 'admin1', unassignedAt: '2024-02-20 10:30:00', unassignedBy: 'admin1', reason: 'Biker requested return', status: 'completed', notes: 'Returned in good condition' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV006', model: 'Hero Photon', brand: 'Hero', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-1111', status: 'rented', batteryLevel: 88, location: 'Mirpur', investorId: 'inv2', purchasePrice: 55000, purchaseDate: '2024-02-01', currentRent: 300, totalEarnings: 4500,
|
id: 'EV006', model: 'Hero Photon', brand: 'Hero', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-1111', status: 'rented', batteryLevel: 88, location: 'Mirpur', investorId: 'inv2', purchasePrice: 55000, purchaseDate: '2024-02-01', currentRent: 300, totalEarnings: 4500,
|
||||||
assignmentHistory: [
|
assignmentHistory: [
|
||||||
{ id: 'ash8', bikeId: 'EV006', bikerId: 'u7', bikerName: 'Alamin Hossain', assignedAt: '2024-02-05 11:00:00', assignedBy: 'admin1', status: 'active' }
|
{ id: 'ash8', bikeId: 'EV006', bikerId: 'u7', bikerName: 'Alamin Hossain', assignedAt: '2024-02-05 11:00:00', assignedBy: 'admin1', status: 'active' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV007', model: 'Okinawa Praise', brand: 'Okinawa', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-2222', status: 'available', batteryLevel: 92, location: 'Gulshan 2', investorId: 'inv3', purchasePrice: 75000, purchaseDate: '2024-02-10', currentRent: 0, totalEarnings: 9500,
|
id: 'EV007', model: 'Okinawa Praise', brand: 'Okinawa', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-2222', status: 'available', batteryLevel: 92, location: 'Gulshan 2', investorId: 'inv3', purchasePrice: 75000, purchaseDate: '2024-02-10', currentRent: 0, totalEarnings: 9500,
|
||||||
assignmentHistory: []
|
assignmentHistory: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV008', model: 'Bajaj Chetak', brand: 'Bajaj', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-3333', status: 'available', batteryLevel: 100, location: 'Dhanmondi', purchasePrice: 70000, purchaseDate: '2024-03-01', currentRent: 0, totalEarnings: 0,
|
id: 'EV008', model: 'Bajaj Chetak', brand: 'Bajaj', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-3333', status: 'available', batteryLevel: 100, location: 'Dhanmondi', purchasePrice: 70000, purchaseDate: '2024-03-01', currentRent: 0, totalEarnings: 0,
|
||||||
assignmentHistory: []
|
assignmentHistory: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV009', model: 'TVS iQube', brand: 'TVS', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-4444', status: 'rented', batteryLevel: 75, location: 'Banani', purchasePrice: 75000, purchaseDate: '2024-03-05', currentRent: 380, totalEarnings: 1140,
|
id: 'EV009', model: 'TVS iQube', brand: 'TVS', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-4444', status: 'rented', batteryLevel: 75, location: 'Banani', purchasePrice: 75000, purchaseDate: '2024-03-05', currentRent: 380, totalEarnings: 1140,
|
||||||
assignmentHistory: [
|
assignmentHistory: [
|
||||||
{ id: 'ash9', bikeId: 'EV009', bikerId: 'u8', bikerName: 'Babul Akter', assignedAt: '2024-03-08 09:30:00', assignedBy: 'admin1', status: 'active' }
|
{ id: 'ash9', bikeId: 'EV009', bikerId: 'u8', bikerName: 'Babul Akter', assignedAt: '2024-03-08 09:30:00', assignedBy: 'admin1', status: 'active' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'EV010', model: 'Yadea DT3', brand: 'Yadea', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-5555', status: 'available', batteryLevel: 90, location: 'Uttara', purchasePrice: 68000, purchaseDate: '2024-03-10', currentRent: 0, totalEarnings: 0,
|
id: 'EV010', model: 'Yadea DT3', brand: 'Yadea', image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400', plateNumber: 'Dhaka Metro Cha-5555', status: 'available', batteryLevel: 90, location: 'Uttara', purchasePrice: 68000, purchaseDate: '2024-03-10', currentRent: 0, totalEarnings: 0,
|
||||||
assignmentHistory: []
|
assignmentHistory: []
|
||||||
},
|
},
|
||||||
@@ -239,7 +240,7 @@ export const transactions: Transaction[] = [
|
|||||||
{ id: 't2', userId: 'u1', type: 'rental_payment', amount: 350, status: 'completed', description: 'Daily Rental - Mar 20', createdAt: '2024-03-20' },
|
{ id: 't2', userId: 'u1', type: 'rental_payment', amount: 350, status: 'completed', description: 'Daily Rental - Mar 20', createdAt: '2024-03-20' },
|
||||||
{ id: 't3', userId: 'u1', type: 'deposit', amount: 5000, status: 'completed', description: 'Security Deposit Paid', createdAt: '2024-03-01' },
|
{ id: 't3', userId: 'u1', type: 'deposit', amount: 5000, status: 'completed', description: 'Security Deposit Paid', createdAt: '2024-03-01' },
|
||||||
{ id: 't4', userId: 'u1', type: 'topup', amount: 2000, status: 'completed', description: 'Wallet Top Up', createdAt: '2024-03-15' },
|
{ id: 't4', userId: 'u1', type: 'topup', amount: 2000, status: 'completed', description: 'Wallet Top Up', createdAt: '2024-03-15' },
|
||||||
|
|
||||||
// Investor 1 (inv1) - Hasan Mahmud - Multiple investment transactions
|
// Investor 1 (inv1) - Hasan Mahmud - Multiple investment transactions
|
||||||
{ id: 'invt1', investorId: 'inv1', type: 'investment', amount: 85000, status: 'completed', description: 'Investment - Etron ET50 (Gold Plan)', paymentMethod: 'bank', referenceNumber: 'INV/2024/001', createdAt: '2024-01-15', processedAt: '2024-01-15' },
|
{ id: 'invt1', investorId: 'inv1', type: 'investment', amount: 85000, status: 'completed', description: 'Investment - Etron ET50 (Gold Plan)', paymentMethod: 'bank', referenceNumber: 'INV/2024/001', createdAt: '2024-01-15', processedAt: '2024-01-15' },
|
||||||
{ id: 'invt2', investorId: 'inv1', type: 'investment', amount: 65000, status: 'completed', description: 'Investment - Yadea DT3 (Gold Plan)', paymentMethod: 'mobile', referenceNumber: 'INV/2024/002', createdAt: '2024-01-20', processedAt: '2024-01-20' },
|
{ id: 'invt2', investorId: 'inv1', type: 'investment', amount: 65000, status: 'completed', description: 'Investment - Yadea DT3 (Gold Plan)', paymentMethod: 'mobile', referenceNumber: 'INV/2024/002', createdAt: '2024-01-20', processedAt: '2024-01-20' },
|
||||||
@@ -253,7 +254,7 @@ export const transactions: Transaction[] = [
|
|||||||
{ id: 'invt10', investorId: 'inv1', type: 'withdrawal', amount: 3000, status: 'pending', description: 'Withdrawal Request - Bkash', paymentMethod: 'mobile', referenceNumber: 'WDL/2024/035', createdAt: '2024-03-20' },
|
{ id: 'invt10', investorId: 'inv1', type: 'withdrawal', amount: 3000, status: 'pending', description: 'Withdrawal Request - Bkash', paymentMethod: 'mobile', referenceNumber: 'WDL/2024/035', createdAt: '2024-03-20' },
|
||||||
{ id: 'invt11', investorId: 'inv1', type: 'referral_bonus', amount: 1500, status: 'completed', description: 'Referral Bonus - New Investor Signup', createdAt: '2024-02-01', processedAt: '2024-02-01' },
|
{ id: 'invt11', investorId: 'inv1', type: 'referral_bonus', amount: 1500, status: 'completed', description: 'Referral Bonus - New Investor Signup', createdAt: '2024-02-01', processedAt: '2024-02-01' },
|
||||||
{ id: 'invt12', investorId: 'inv1', type: 'referral_bonus', amount: 1000, status: 'completed', description: 'Referral Bonus - New Investor Signup', createdAt: '2024-03-05', processedAt: '2024-03-05' },
|
{ id: 'invt12', investorId: 'inv1', type: 'referral_bonus', amount: 1000, status: 'completed', description: 'Referral Bonus - New Investor Signup', createdAt: '2024-03-05', processedAt: '2024-03-05' },
|
||||||
|
|
||||||
// Investor 2 (inv2) - Ahmed Khan - Platinum Plan
|
// Investor 2 (inv2) - Ahmed Khan - Platinum Plan
|
||||||
{ id: 'invt13', investorId: 'inv2', type: 'investment', amount: 95000, status: 'completed', description: 'Investment - AIMA Lightning (Platinum Plan)', paymentMethod: 'bank', referenceNumber: 'INV/2023/089', createdAt: '2023-11-05', processedAt: '2023-11-05' },
|
{ id: 'invt13', investorId: 'inv2', type: 'investment', amount: 95000, status: 'completed', description: 'Investment - AIMA Lightning (Platinum Plan)', paymentMethod: 'bank', referenceNumber: 'INV/2023/089', createdAt: '2023-11-05', processedAt: '2023-11-05' },
|
||||||
{ id: 'invt14', investorId: 'inv2', type: 'investment', amount: 72000, status: 'completed', description: 'Investment - TVS iQube (Platinum Plan)', paymentMethod: 'bank', referenceNumber: 'INV/2023/095', createdAt: '2023-12-01', processedAt: '2023-12-01' },
|
{ id: 'invt14', investorId: 'inv2', type: 'investment', amount: 72000, status: 'completed', description: 'Investment - TVS iQube (Platinum Plan)', paymentMethod: 'bank', referenceNumber: 'INV/2023/095', createdAt: '2023-12-01', processedAt: '2023-12-01' },
|
||||||
@@ -277,14 +278,14 @@ export const transactions: Transaction[] = [
|
|||||||
{ id: 'invt32', investorId: 'inv2', type: 'withdrawal', amount: 25000, status: 'completed', description: 'Withdrawal via Nagad', paymentMethod: 'mobile', referenceNumber: 'WDL/2024/025', createdAt: '2024-03-12', processedAt: '2024-03-12' },
|
{ id: 'invt32', investorId: 'inv2', type: 'withdrawal', amount: 25000, status: 'completed', description: 'Withdrawal via Nagad', paymentMethod: 'mobile', referenceNumber: 'WDL/2024/025', createdAt: '2024-03-12', processedAt: '2024-03-12' },
|
||||||
{ id: 'invt33', investorId: 'inv2', type: 'referral_bonus', amount: 2500, status: 'completed', description: 'Referral Bonus - Investor Referral Program', createdAt: '2024-01-10', processedAt: '2024-01-10' },
|
{ id: 'invt33', investorId: 'inv2', type: 'referral_bonus', amount: 2500, status: 'completed', description: 'Referral Bonus - Investor Referral Program', createdAt: '2024-01-10', processedAt: '2024-01-10' },
|
||||||
{ id: 'invt34', investorId: 'inv2', type: 'referral_bonus', amount: 5000, status: 'completed', description: 'Referral Bonus - Multiple Referrals Bonus', createdAt: '2024-02-20', processedAt: '2024-02-20' },
|
{ id: 'invt34', investorId: 'inv2', type: 'referral_bonus', amount: 5000, status: 'completed', description: 'Referral Bonus - Multiple Referrals Bonus', createdAt: '2024-02-20', processedAt: '2024-02-20' },
|
||||||
|
|
||||||
// Investor 3 (inv3) - Sadia Islam - Silver Plan
|
// Investor 3 (inv3) - Sadia Islam - Silver Plan
|
||||||
{ id: 'invt35', investorId: 'inv3', type: 'investment', amount: 75000, status: 'completed', description: 'Investment - Okinawa Praise (Silver Plan)', paymentMethod: 'bank', referenceNumber: 'INV/2024/012', createdAt: '2024-02-10', processedAt: '2024-02-10' },
|
{ id: 'invt35', investorId: 'inv3', type: 'investment', amount: 75000, status: 'completed', description: 'Investment - Okinawa Praise (Silver Plan)', paymentMethod: 'bank', referenceNumber: 'INV/2024/012', createdAt: '2024-02-10', processedAt: '2024-02-10' },
|
||||||
{ id: 'invt36', investorId: 'inv3', type: 'bike_earning', bikeId: 'b7', amount: 1585, status: 'completed', description: 'Monthly Earnings - Bike b7 (Okinawa Praise)', createdAt: '2024-03-15', processedAt: '2024-03-15' },
|
{ id: 'invt36', investorId: 'inv3', type: 'bike_earning', bikeId: 'b7', amount: 1585, status: 'completed', description: 'Monthly Earnings - Bike b7 (Okinawa Praise)', createdAt: '2024-03-15', processedAt: '2024-03-15' },
|
||||||
{ id: 'invt37', investorId: 'inv3', type: 'investment_return', amount: 4500, status: 'completed', description: 'Investment Return - Q1 2024', paymentMethod: 'bank', referenceNumber: 'RET/2024/Q1/001', createdAt: '2024-03-31', processedAt: '2024-03-31' },
|
{ id: 'invt37', investorId: 'inv3', type: 'investment_return', amount: 4500, status: 'completed', description: 'Investment Return - Q1 2024', paymentMethod: 'bank', referenceNumber: 'RET/2024/Q1/001', createdAt: '2024-03-31', processedAt: '2024-03-31' },
|
||||||
{ id: 'invt38', investorId: 'inv3', type: 'withdrawal', amount: 5000, status: 'pending', description: 'Withdrawal Request - Bkash', paymentMethod: 'mobile', referenceNumber: 'WDL/2024/032', createdAt: '2024-03-19' },
|
{ id: 'invt38', investorId: 'inv3', type: 'withdrawal', amount: 5000, status: 'pending', description: 'Withdrawal Request - Bkash', paymentMethod: 'mobile', referenceNumber: 'WDL/2024/032', createdAt: '2024-03-19' },
|
||||||
{ id: 'invt39', investorId: 'inv3', type: 'withdrawal', amount: 15000, status: 'completed', description: 'Withdrawal via Bank Transfer', paymentMethod: 'bank', referenceNumber: 'WDL/2024/008', createdAt: '2024-03-05', processedAt: '2024-03-06' },
|
{ id: 'invt39', investorId: 'inv3', type: 'withdrawal', amount: 15000, status: 'completed', description: 'Withdrawal via Bank Transfer', paymentMethod: 'bank', referenceNumber: 'WDL/2024/008', createdAt: '2024-03-05', processedAt: '2024-03-06' },
|
||||||
|
|
||||||
// Adjustment transactions
|
// Adjustment transactions
|
||||||
{ id: 'adj1', investorId: 'inv1', type: 'adjustment', amount: -500, status: 'completed', description: 'Bike Maintenance Deduction', createdAt: '2024-02-10', processedAt: '2024-02-10' },
|
{ id: 'adj1', investorId: 'inv1', type: 'adjustment', amount: -500, status: 'completed', description: 'Bike Maintenance Deduction', createdAt: '2024-02-10', processedAt: '2024-02-10' },
|
||||||
{ id: 'adj2', investorId: 'inv2', type: 'adjustment', amount: -300, status: 'completed', description: 'Service Charge Deduction', createdAt: '2024-01-20', processedAt: '2024-01-20' },
|
{ id: 'adj2', investorId: 'inv2', type: 'adjustment', amount: -300, status: 'completed', description: 'Service Charge Deduction', createdAt: '2024-01-20', processedAt: '2024-01-20' },
|
||||||
@@ -292,12 +293,12 @@ export const transactions: Transaction[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const investors: Investor[] = [
|
export const investors: Investor[] = [
|
||||||
{
|
{
|
||||||
id: 'inv1',
|
id: 'inv1',
|
||||||
userId: 'u7',
|
userId: 'u7',
|
||||||
name: 'Md. Hasan Mahmud',
|
name: 'Md. Hasan Mahmud',
|
||||||
email: 'hasan.mahmud@email.com',
|
email: 'hasan.mahmud@email.com',
|
||||||
phone: '01712345678',
|
phone: '01712345678',
|
||||||
phoneAlt: '01812345678',
|
phoneAlt: '01812345678',
|
||||||
address: 'House 12, Road 5, Dhanmondi, Dhaka 1205',
|
address: 'House 12, Road 5, Dhanmondi, Dhaka 1205',
|
||||||
dateOfBirth: '1985-03-15',
|
dateOfBirth: '1985-03-15',
|
||||||
@@ -317,13 +318,13 @@ export const investors: Investor[] = [
|
|||||||
emergencyContactName: 'Fatema Begum',
|
emergencyContactName: 'Fatema Begum',
|
||||||
emergencyContactRelation: 'Wife',
|
emergencyContactRelation: 'Wife',
|
||||||
emergencyContactPhone: '01712345679',
|
emergencyContactPhone: '01712345679',
|
||||||
totalInvested: 150000,
|
totalInvested: 150000,
|
||||||
totalEarnings: 14250,
|
totalEarnings: 14250,
|
||||||
activeBikes: 2,
|
activeBikes: 2,
|
||||||
withdrawalPending: 3000,
|
withdrawalPending: 3000,
|
||||||
totalWithdrawn: 45000,
|
totalWithdrawn: 45000,
|
||||||
pendingEarnings: 4625,
|
pendingEarnings: 4625,
|
||||||
roi: 19,
|
roi: 19,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
notes: 'Long-term investor, reliable payment history',
|
notes: 'Long-term investor, reliable payment history',
|
||||||
createdAt: '2024-01-15',
|
createdAt: '2024-01-15',
|
||||||
@@ -344,12 +345,12 @@ export const investors: Investor[] = [
|
|||||||
{ id: 'ip2', investorId: 'inv1', planName: 'Gold City Commuter', planType: 'gold', bikeIds: ['b2'], totalInvestment: 65000, monthlyReturn: 2125, expectedRoi: 18, actualEarnings: 4250, startDate: '2024-01-20', endDate: '2025-01-19', status: 'active', paymentMethod: 'mobile', transactionId: 'invt2', createdAt: '2024-01-20' }
|
{ id: 'ip2', investorId: 'inv1', planName: 'Gold City Commuter', planType: 'gold', bikeIds: ['b2'], totalInvestment: 65000, monthlyReturn: 2125, expectedRoi: 18, actualEarnings: 4250, startDate: '2024-01-20', endDate: '2025-01-19', status: 'active', paymentMethod: 'mobile', transactionId: 'invt2', createdAt: '2024-01-20' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'inv2',
|
id: 'inv2',
|
||||||
userId: 'u8',
|
userId: 'u8',
|
||||||
name: 'Ahmed Khan',
|
name: 'Ahmed Khan',
|
||||||
email: 'ahmed.khan@email.com',
|
email: 'ahmed.khan@email.com',
|
||||||
phone: '01722345678',
|
phone: '01722345678',
|
||||||
phoneAlt: '01922345678',
|
phoneAlt: '01922345678',
|
||||||
address: 'Flat 3B, House 45, Gulshan Avenue, Dhaka 1212',
|
address: 'Flat 3B, House 45, Gulshan Avenue, Dhaka 1212',
|
||||||
dateOfBirth: '1978-07-22',
|
dateOfBirth: '1978-07-22',
|
||||||
@@ -370,13 +371,13 @@ export const investors: Investor[] = [
|
|||||||
emergencyContactName: 'Rahima Khan',
|
emergencyContactName: 'Rahima Khan',
|
||||||
emergencyContactRelation: 'Wife',
|
emergencyContactRelation: 'Wife',
|
||||||
emergencyContactPhone: '01722345679',
|
emergencyContactPhone: '01722345679',
|
||||||
totalInvested: 290000,
|
totalInvested: 290000,
|
||||||
totalEarnings: 36250,
|
totalEarnings: 36250,
|
||||||
activeBikes: 4,
|
activeBikes: 4,
|
||||||
withdrawalPending: 0,
|
withdrawalPending: 0,
|
||||||
totalWithdrawn: 75000,
|
totalWithdrawn: 75000,
|
||||||
pendingEarnings: 10840,
|
pendingEarnings: 10840,
|
||||||
roi: 17,
|
roi: 17,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
notes: 'Premium investor with multiple bike investments',
|
notes: 'Premium investor with multiple bike investments',
|
||||||
createdAt: '2023-11-01',
|
createdAt: '2023-11-01',
|
||||||
@@ -399,11 +400,11 @@ export const investors: Investor[] = [
|
|||||||
{ id: 'ip6', investorId: 'inv2', planName: 'Platinum New Entry', planType: 'platinum', bikeIds: ['b6'], totalInvestment: 55000, monthlyReturn: 750, expectedRoi: 16, actualEarnings: 750, startDate: '2024-02-01', endDate: '2025-01-31', status: 'active', paymentMethod: 'bank', transactionId: 'invt16', createdAt: '2024-02-01' }
|
{ id: 'ip6', investorId: 'inv2', planName: 'Platinum New Entry', planType: 'platinum', bikeIds: ['b6'], totalInvestment: 55000, monthlyReturn: 750, expectedRoi: 16, actualEarnings: 750, startDate: '2024-02-01', endDate: '2025-01-31', status: 'active', paymentMethod: 'bank', transactionId: 'invt16', createdAt: '2024-02-01' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'inv3',
|
id: 'inv3',
|
||||||
userId: 'u9',
|
userId: 'u9',
|
||||||
name: 'Sadia Islam',
|
name: 'Sadia Islam',
|
||||||
email: 'sadia.islam@email.com',
|
email: 'sadia.islam@email.com',
|
||||||
phone: '01732345678',
|
phone: '01732345678',
|
||||||
phoneAlt: '01632345678',
|
phoneAlt: '01632345678',
|
||||||
address: 'Road 8, House 22, Baridhara, Dhaka 1212',
|
address: 'Road 8, House 22, Baridhara, Dhaka 1212',
|
||||||
@@ -422,13 +423,13 @@ export const investors: Investor[] = [
|
|||||||
emergencyContactName: 'Abul Hasan',
|
emergencyContactName: 'Abul Hasan',
|
||||||
emergencyContactRelation: 'Brother',
|
emergencyContactRelation: 'Brother',
|
||||||
emergencyContactPhone: '01732345679',
|
emergencyContactPhone: '01732345679',
|
||||||
totalInvested: 75000,
|
totalInvested: 75000,
|
||||||
totalEarnings: 6085,
|
totalEarnings: 6085,
|
||||||
activeBikes: 1,
|
activeBikes: 1,
|
||||||
withdrawalPending: 5000,
|
withdrawalPending: 5000,
|
||||||
totalWithdrawn: 15000,
|
totalWithdrawn: 15000,
|
||||||
pendingEarnings: 1585,
|
pendingEarnings: 1585,
|
||||||
roi: 12,
|
roi: 12,
|
||||||
status: 'pending',
|
status: 'pending',
|
||||||
notes: 'New investor, first investment',
|
notes: 'New investor, first investment',
|
||||||
createdAt: '2024-02-01',
|
createdAt: '2024-02-01',
|
||||||
|
|||||||
Reference in New Issue
Block a user