feat: implement automated double-entry accounting for investments and add transaction details modal

This commit is contained in:
sazzadulalambd
2026-04-26 14:56:12 +06:00
parent ae94ce0427
commit 7457b997ef
16 changed files with 8809 additions and 201 deletions

View File

@@ -3,12 +3,12 @@
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { useState } from 'react';
import {
Bike,
Settings,
Wallet,
Store,
Zap,
import {
Bike,
Settings,
Wallet,
Store,
Zap,
Battery,
Menu,
X,
@@ -20,16 +20,20 @@ import {
Shield,
Truck,
ChevronDown,
LogOut
LogOut,
Calculator,
Wrench
} from 'lucide-react';
const adminNavItems = [
{ label: 'Dashboard', href: '/admin', icon: BarChart3 },
{ label: 'KYC Requests', href: '/admin/kyc', icon: Shield },
{ label: 'Rentals', href: '/admin/rentals', icon: FileText },
{ label: 'Bikers', href: '/admin/bikers', icon: Users },
{ label: 'Investors', href: '/admin/investors', icon: Wallet },
{ label: 'Fleet Management', href: '/admin/fleet', icon: Bike },
{ label: 'KYC Requests', href: '/admin/kyc', icon: Shield },
{ label: 'Rentals', href: '/admin/rentals', icon: FileText },
{ label: 'Damage & Maintenance', href: '/admin/maintenance', icon: Wrench },
{ label: 'Accounting', href: '/admin/accounting', icon: Calculator },
{ label: 'Revenue', href: '/admin/revenue', icon: CreditCard },
{ label: 'Reports', href: '/admin/reports', icon: BarChart3 },
{ label: 'Geofences', href: '/admin/geofence', icon: MapPin },
@@ -61,10 +65,10 @@ export default function Sidebar() {
const isAdmin = pathname.startsWith('/admin');
const isInvestor = pathname.startsWith('/investor');
const isShop = pathname.startsWith('/shop');
const navItems = isAdmin ? adminNavItems :
isInvestor ? investorNavItems :
isShop ? shopNavItems : bikerNavItems;
const navItems = isAdmin ? adminNavItems :
isInvestor ? investorNavItems :
isShop ? shopNavItems : bikerNavItems;
const toggleMenu = (label: string) => {
setExpandedMenu(expandedMenu === label ? null : label);
@@ -107,8 +111,8 @@ export default function Sidebar() {
onClick={() => setMobileOpen(false)}
className={`
flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200
${isActive
? 'bg-accent text-white shadow-sm'
${isActive
? 'bg-accent text-white shadow-sm'
: 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'
}
`}
@@ -141,7 +145,7 @@ export default function Sidebar() {
</aside>
{mobileOpen && (
<div
<div
className="lg:hidden fixed inset-0 bg-black/30 z-30"
onClick={() => setMobileOpen(false)}
/>