WFDASHDRIVER-APP/lib/types.ts
SJCoetz b738bc7495 feat: initialize project with Next.js, TypeScript, and Tailwind CSS
- Added package.json with dependencies for Next.js, React, and Tailwind CSS.
- Created postcss.config.js for Tailwind CSS and autoprefixer integration.
- Added SVG icon for the application in public/icons/icon.svg.
- Created manifest.json for PWA support with app details and icon.
- Configured Tailwind CSS in tailwind.config.js with custom colors and animations.
- Set up TypeScript configuration in tsconfig.json for strict type checking and module resolution.
2026-05-24 21:51:29 +02:00

103 lines
2.2 KiB
TypeScript

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;