// /media/hf/data/projects/Dawinder/transport/types/index.ts
export type Role = 'transport_admin' | 'admin_staff';

export type VehicleStatus = 'active' | 'idle' | 'in_trip' | 'maintenance' | 'inactive';

export type TripStatus = 
  | 'created' | 'assigned' | 'started' | 'reached_pickup' 
  | 'loaded' | 'in_transit' | 'reached_destination' 
  | 'pod_uploaded' | 'completed' | 'cancelled';

export type ExpenseCategory = 
  | 'fuel' | 'toll' | 'food' | 'loading_unloading' | 'maintenance' | 'other';

export type AdvanceType = 'salary' | 'trip';

export interface Vehicle {
  id: string;
  registrationNumber: string;
  status: VehicleStatus;
  rcExpiry: string;
  insuranceExpiry: string;
  permitExpiry: string;
  assignedDriverId?: string;
}

export interface Driver {
  id: string;
  name: string;
  phone: string;
  licenseNumber: string;
  licenseExpiry: string;
  aadhaarNumber: string;
  walletBalance: number;
  advanceBalance: number;
  assignedVehicleId?: string;
  activeTripId?: string;
  status: 'active' | 'inactive' | 'on_leave';
}

export interface Trip {
  id: string;
  route: string;
  origin: string;
  destination: string;
  status: TripStatus;
  vehicleId: string;
  driverId: string;
  freightAmount: number;
  startDate: string;
  expectedEndDate: string;
  completedDate?: string;
}

export interface Expense {
  id: string;
  tripId: string;
  driverId: string;
  category: ExpenseCategory;
  amount: number;
  description: string;
  status: 'pending' | 'approved' | 'rejected';
  date: string;
}

export interface Advance {
  id: string;
  driverId: string;
  type: AdvanceType;
  amount: number;
  note: string;
  date: string;
  status: 'pending' | 'settled';
}

export interface Settlement {
  id: string;
  driverId: string;
  date: string;
  totalAdvances: number;
  totalExpenses: number;
  salaryComponent: number;
  finalAmount: number;
  status: 'pending' | 'completed';
}

export interface LedgerEntry {
  id: string;
  driverId: string;
  date: string;
  type: 'credit' | 'debit';
  amount: number;
  description: string;
  referenceId?: string;
}

export interface Notification {
  id: string;
  type: 'compliance' | 'financial' | 'trip';
  message: string;
  date: string;
  isRead: boolean;
  link?: string;
}
