2026-05-24 19:51:29 +00:00
|
|
|
export interface Supplier {
|
|
|
|
|
id: string;
|
|
|
|
|
suppliername: string;
|
2026-05-24 22:47:47 +00:00
|
|
|
email: string;
|
|
|
|
|
suppliernumber: string;
|
2026-05-24 20:31:35 +00:00
|
|
|
supplieraddress: string;
|
2026-05-24 22:47:47 +00:00
|
|
|
supply_tags: string;
|
|
|
|
|
coordinates: string; // Raw coordinates text (e.g. "-33.9249, 18.4241")
|
|
|
|
|
closingtime: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Order {
|
|
|
|
|
id: string;
|
|
|
|
|
order_number: string;
|
|
|
|
|
status: string;
|
|
|
|
|
notes: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface PurchaseOrder {
|
|
|
|
|
id: string;
|
|
|
|
|
po_number: string;
|
|
|
|
|
status: string;
|
2026-05-24 19:51:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface OrderItem {
|
|
|
|
|
id: string;
|
2026-05-24 22:47:47 +00:00
|
|
|
order: string;
|
|
|
|
|
supplier: string;
|
|
|
|
|
driver: string;
|
2026-05-24 19:51:29 +00:00
|
|
|
description: string;
|
2026-05-24 22:47:47 +00:00
|
|
|
po_description: string;
|
2026-05-24 19:51:29 +00:00
|
|
|
quantity: number;
|
|
|
|
|
order_qty: number;
|
2026-05-24 22:47:47 +00:00
|
|
|
selling_price: number;
|
|
|
|
|
cost_price: number;
|
2026-05-24 19:51:29 +00:00
|
|
|
item_status: string;
|
2026-05-24 22:47:47 +00:00
|
|
|
status: string;
|
|
|
|
|
driver_status: string;
|
2026-05-24 19:51:29 +00:00
|
|
|
notes: string;
|
2026-05-24 22:47:47 +00:00
|
|
|
problem_type: string;
|
|
|
|
|
problem_flag: boolean;
|
|
|
|
|
problem_notes: string;
|
|
|
|
|
qty_collected: number;
|
|
|
|
|
collected_date: string;
|
|
|
|
|
collection_date: string;
|
|
|
|
|
is_stock_item: boolean;
|
|
|
|
|
// Expanded fields
|
2026-05-24 19:51:29 +00:00
|
|
|
expand?: {
|
2026-05-24 22:47:47 +00:00
|
|
|
supplier?: Supplier;
|
|
|
|
|
order?: Order;
|
|
|
|
|
purchase_order?: PurchaseOrder;
|
2026-05-24 19:51:29 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface DriverLocation {
|
|
|
|
|
id: string;
|
|
|
|
|
driver: string;
|
|
|
|
|
latitude: number;
|
|
|
|
|
longitude: number;
|
|
|
|
|
accuracy?: number;
|
|
|
|
|
altitude?: number;
|
|
|
|
|
speed?: number;
|
|
|
|
|
heading?: number;
|
|
|
|
|
timestamp: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface AppSettings {
|
2026-05-24 22:47:47 +00:00
|
|
|
locationInterval: number;
|
|
|
|
|
minimumAccuracy: number;
|
2026-05-24 19:51:29 +00:00
|
|
|
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;
|