import { Storage } from '@secondcloset/types'; import { AppointmentOrShipment } from './appointment'; import { VehicleKind, VehicleType } from './vehicle'; export interface RouteItem { appointment_id: string; appointment_type: "fulfillment" | "storage"; type: AppointmentOrShipment; status: string; number: string; date: string; timerange: Storage.AppointmentSlot; sequence: number; } export interface RouteUser { user_id: string; email: string; first_name: string; last_name: string; subrole: string; assigned_role: string; delivery_partner_id?: string; delivery_partner_name?: string; } export type Route = { id: string; route_date: string; route_name: string; route_number: string; route_status: string; route_color: string; dispatch_time: string; notes: string; vehicle_id: string | null; vehicle_type: VehicleType | null; created_at: string; route_items: RouteItem[]; route_users: RouteUser[]; estimated_travel_distance_in_meters: number | null; estimated_travel_time_in_seconds: number | null; automation_job_id: string | null; route_items_updated: boolean; hub_id: string | null; published_at: string | null; recommended_route_user_count: number | null; color?: string | null; dominant_delivery_type?: string; dominant_zone_id?: string; dominant_zone_name?: string; } & RouteVehicleKind; export type RouteVehicleKind = { vehicle_kind_id: string; vehicle_kind_name: string; vehicle_kind_fuel_type: VehicleKind["fuel_type"]; } | { vehicle_kind_id: null; vehicle_kind_name: null; vehicle_kind_fuel_type: null; }; export interface InternalVehicle { id: string; type: Extract; } export interface DSPVehicle { id: null; type: Extract; } export type RouteActionReason = { name: string; notes?: string; }; export type RouteDeleteReason = RouteActionReason; export type RouteUpdateReason = RouteActionReason;