export interface Supplier { id: string; suppliername: string; address: string; latitude: number; longitude: number; collection?: string; } export interface OrderItem { id: string; description: string; quantity: number; order_qty: number; unit: string; selling_price?: number; order?: string; purchase_order?: string; item_status: string; expand?: { order?: { order_number: string }; purchase_order?: { po_number: string }; }; } export interface Collection { id: string; order_item: string; supplier: string; driver: string; status: 'pending' | 'assigned' | 'collected' | 'problem'; quantity: number; planned_date: string; actual_date: string; received_qty: number; notes: string; created_at: string; updated_at: string; is_manual: boolean; description: string; unit: string; // Expanded fields expand?: { order_item?: OrderItem; supplier?: Supplier; driver?: Driver; }; } export interface CollectionProblem { id: string; collection: string; problem_type: 'out_of_stock' | 'partial_stock' | 'quality_issue' | 'wrong_item' | 'other'; description: string; photo?: string; reported_at: string; } export interface Driver { id: string; email: string; name: string; username: string; } export interface DriverLocation { id: string; driver: string; latitude: number; longitude: number; accuracy?: number; altitude?: number; speed?: number; heading?: number; timestamp: string; battery_level?: number; } export interface AppSettings { locationInterval: number; // in seconds minimumAccuracy: number; // in meters enableHighAccuracy: boolean; darkMode: boolean; fontSize: 'small' | 'normal' | 'large'; offlineMode: boolean; } export const DEFAULT_SETTINGS: AppSettings = { locationInterval: 60, minimumAccuracy: 50, enableHighAccuracy: true, darkMode: false, fontSize: 'normal', offlineMode: false, }; export const PROBLEM_TYPES = [ { value: 'out_of_stock', label: 'Out of Stock' }, { value: 'partial_stock', label: 'Partial Stock' }, { value: 'quality_issue', label: 'Quality Issue' }, { value: 'wrong_item', label: 'Wrong Item' }, { value: 'other', label: 'Other' }, ] as const;