diff --git a/apps/edr-freight-api/src/modules/companies/companies.service.ts b/apps/edr-freight-api/src/modules/companies/companies.service.ts index a4466efb2..12fcb6238 100644 --- a/apps/edr-freight-api/src/modules/companies/companies.service.ts +++ b/apps/edr-freight-api/src/modules/companies/companies.service.ts @@ -282,6 +282,7 @@ export class CompaniesService { async findCompanyById(id: string): Promise { const company = await this.companiesRepo.findById(id); if (!company) throw new NotFoundException(`Company ${id} not found`); + company.companyProfiles = await this.companyProfilesRepo.findByCompanyId(id); return company; } diff --git a/apps/edr-freight-api/src/modules/train-scheduling/train-scheduling.service.ts b/apps/edr-freight-api/src/modules/train-scheduling/train-scheduling.service.ts index 3928376ce..239640624 100644 --- a/apps/edr-freight-api/src/modules/train-scheduling/train-scheduling.service.ts +++ b/apps/edr-freight-api/src/modules/train-scheduling/train-scheduling.service.ts @@ -2152,6 +2152,7 @@ export class TrainSchedulingService { weightTons: roundTons(Number(sb.booking?.cargoTotalWeightVgm ?? 0)), status: sb.booking?.status ?? null, schedulingStatus: sb.booking?.schedulingStatus ?? null, + freightType: sb.booking?.freightType ?? null, })) ?? [], }; } diff --git a/apps/edr-freight-web/backoffice/src/components/bookings/detail/booking-detail.styles.ts b/apps/edr-freight-web/backoffice/src/components/bookings/detail/booking-detail.styles.ts index ccee1e8cb..95fe64016 100644 --- a/apps/edr-freight-web/backoffice/src/components/bookings/detail/booking-detail.styles.ts +++ b/apps/edr-freight-web/backoffice/src/components/bookings/detail/booking-detail.styles.ts @@ -138,6 +138,8 @@ export interface BookingDetailView { priorityScore: number; cargoTotalWeightVgm: number; pnrCode?: string | null; + consolidationPartnerId?: string | null; + consolidationPartner?: (BookingNamedRefView & { reference?: string }) | null; /** End of the pay window once the booking is SELECTED_FOR_BATCH. */ paymentDeadline?: string | null; createdAt: string; diff --git a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/BookingDetailModal.tsx b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/BookingDetailModal.tsx index 2243d1650..00df4700c 100644 --- a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/BookingDetailModal.tsx +++ b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/BookingDetailModal.tsx @@ -11,7 +11,7 @@ import { import type { TrainScheduleDetail } from "@/types/trainScheduling"; import { freightBrand } from "@/theme/freight-brand"; -type Wagon = TrainScheduleDetail["trainSet"]["wagons"][number]; +type Wagon = NonNullable["wagons"][number]; export interface BookingDetailData { bookingId: string; diff --git a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/InteractiveTrainConsist.tsx b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/InteractiveTrainConsist.tsx index 297ecc48b..ee69fe145 100644 --- a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/InteractiveTrainConsist.tsx +++ b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/InteractiveTrainConsist.tsx @@ -11,7 +11,7 @@ import { import type { TrainScheduleDetail } from "@/types/trainScheduling"; import { freightBrand } from "@/theme/freight-brand"; -type Wagon = TrainScheduleDetail["trainSet"]["wagons"][number]; +type Wagon = NonNullable["wagons"][number]; type Locomotive = NonNullable["locomotive"]; interface InteractiveTrainConsistProps { diff --git a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/RemoveBookingModal.tsx b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/RemoveBookingModal.tsx index 151a796d8..4d2b1369c 100644 --- a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/RemoveBookingModal.tsx +++ b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/RemoveBookingModal.tsx @@ -1,7 +1,7 @@ import { Button, Group, Modal, Stack, Text, Badge } from "@mantine/core"; import type { TrainScheduleDetail } from "@/types/trainScheduling"; -type WagonWithAllocation = TrainScheduleDetail["trainSet"]["wagons"][number]; +type WagonWithAllocation = NonNullable["wagons"][number]; interface RemoveBookingModalProps { opened: boolean; @@ -21,7 +21,6 @@ export const RemoveBookingModal = ({ if (!wagon || !wagon.allocations?.[0]) return null; const allocation = wagon.allocations[0]; - const booking = allocation.booking; return ( @@ -32,12 +31,12 @@ export const RemoveBookingModal = ({ - Reference: {booking?.reference || "N/A"} + Reference: {allocation.bookingReference || "N/A"} Freight Type:{" "} - {booking?.freightType || "N/A"} + {allocation.loadType || "N/A"} diff --git a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/TrainConsistView.tsx b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/TrainConsistView.tsx index 2ebfbb8ff..6ece98ef2 100644 --- a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/TrainConsistView.tsx +++ b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/TrainConsistView.tsx @@ -10,7 +10,7 @@ import { useMutation } from "@tanstack/react-query"; import { api } from "@/services/api"; import { freightBrand } from "@/theme/freight-brand"; -type Wagon = TrainScheduleDetail["trainSet"]["wagons"][number]; +type Wagon = NonNullable["wagons"][number]; interface TrainConsistViewProps { scheduleDetail: TrainScheduleDetail; @@ -103,9 +103,9 @@ export const TrainConsistView = ({ diff --git a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/WagonCard.tsx b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/WagonCard.tsx index a3fb971e4..663ab2e6f 100644 --- a/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/WagonCard.tsx +++ b/apps/edr-freight-web/backoffice/src/components/trainScheduling/compositionEditor/WagonCard.tsx @@ -12,7 +12,7 @@ import type { TrainScheduleDetail } from "@/types/trainScheduling"; import { ContainerNumberInput } from "./ContainerNumberInput"; import { freightBrand } from "@/theme/freight-brand"; -type Wagon = TrainScheduleDetail["trainSet"]["wagons"][number]; +type Wagon = NonNullable["wagons"][number]; interface WagonCardProps { wagon: Wagon; diff --git a/apps/edr-freight-web/backoffice/src/components/warehouses/WarehouseInventoryTable.tsx b/apps/edr-freight-web/backoffice/src/components/warehouses/WarehouseInventoryTable.tsx index ec6f0f7d0..5598870c4 100644 --- a/apps/edr-freight-web/backoffice/src/components/warehouses/WarehouseInventoryTable.tsx +++ b/apps/edr-freight-web/backoffice/src/components/warehouses/WarehouseInventoryTable.tsx @@ -1,11 +1,12 @@ -import { useMemo } from "react"; +import { DataTable, type ColumnDef } from "@edr/ui-common"; import { ActionIcon, Badge, Button, Group, Text, Tooltip } from "@mantine/core"; import { ArrowRightLeft, ClipboardList, Coins, History } from "lucide-react"; -import { DataTable, type ColumnDef } from "@edr/ui-common"; +import { useMemo } from "react"; -import type { - InventoryAction, - WarehouseInventoryItem, +import { + INVENTORY_NEXT_ACTION, + type InventoryAction, + type WarehouseInventoryItem, } from "@/types/warehouse"; import { InventoryStatusBadge } from "./badges"; import { formatDate, formatNumber, humanizeEnum } from "./options"; @@ -54,12 +55,6 @@ export function WarehouseInventoryTable({ onHistory, onInspect, onFeePreview, - onLastMile, - selectedIds, - onToggleSelect, - onToggleSelectAll, - allSelected, - someSelected, }: WarehouseInventoryTableProps) { const columns = useMemo[]>( () => [ diff --git a/apps/edr-freight-web/backoffice/src/pages/bookings/NewBookingPage.tsx b/apps/edr-freight-web/backoffice/src/pages/bookings/NewBookingPage.tsx index b3c9db35d..735f95c07 100644 --- a/apps/edr-freight-web/backoffice/src/pages/bookings/NewBookingPage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/bookings/NewBookingPage.tsx @@ -662,7 +662,7 @@ export default function NewBookingPage() { placeholder="Select bulk cargo type" data={cargoData} value={cargoTypeId} - onChange={setCargoTypeId} + onChange={(value) => setCargoTypeId(value as string | null)} searchable disabled={isLoading} /> diff --git a/apps/edr-freight-web/backoffice/src/pages/dashboard/OverviewPage.tsx b/apps/edr-freight-web/backoffice/src/pages/dashboard/OverviewPage.tsx index 8bcec226c..427787146 100644 --- a/apps/edr-freight-web/backoffice/src/pages/dashboard/OverviewPage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/dashboard/OverviewPage.tsx @@ -93,7 +93,7 @@ const OverviewPage = () => { const getTabBadge = (tab: (typeof TAB_ITEMS)[number]) => { if (!summary?.kpis) return 0; - const group = summary.kpis[tab.kpiKey] as Record; + const group = summary.kpis[tab.kpiKey] as unknown as Record; return group[tab.metricKey] ?? 0; }; diff --git a/apps/edr-freight-web/backoffice/src/pages/fleet/FleetCrudPages.tsx b/apps/edr-freight-web/backoffice/src/pages/fleet/FleetCrudPages.tsx index cd846ada7..c8cbaa453 100644 --- a/apps/edr-freight-web/backoffice/src/pages/fleet/FleetCrudPages.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/fleet/FleetCrudPages.tsx @@ -1,49 +1,49 @@ -import { FormEvent, ReactNode, useMemo, useState } from 'react'; import { useMutation, useQuery } from '@tanstack/react-query'; import { Edit, Eye, Plus, Search, Trash2 } from 'lucide-react'; +import { FormEvent, ReactNode, useMemo, useState } from 'react'; import { api } from '@/services/api'; import { - ActionIcon, - Badge as MantineBadge, - Box, - Button as MantineButton, - Group, - Modal, - NumberInput, - Pagination, - Paper, - ScrollArea, - Select as MantineSelect, - SimpleGrid, - Stack, - Table as MantineTable, - Text, - TextInput, - Title, + ActionIcon, + Box, + Group, + Badge as MantineBadge, + Button as MantineButton, + Select as MantineSelect, + Table as MantineTable, + Modal, + NumberInput, + Pagination, + Paper, + ScrollArea, + SimpleGrid, + Stack, + Text, + TextInput, + Title, } from '@mantine/core'; +import { DeliverCargoDialog } from '@/components/cargoes/DeliverCargoDialog'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { - Dialog, - DialogContent, - DialogFooter, - DialogHeader, - DialogTitle, + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@edr/ui-common'; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'; import { useToast } from '@/hooks/use-toast'; import type { Cargo } from '@/services/cargoService'; -import { DeliverCargoDialog } from '@/components/cargoes/DeliverCargoDialog'; import type { Container } from '@/services/containerService'; import type { Locomotive } from '@/services/locomotives.service'; import type { Train } from '@/services/trains.service'; -import type { Wagon } from '@/services/wagon.service'; import type { WagonType } from '@/services/wagon-types.service'; +import type { Wagon } from '@/services/wagon.service'; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@edr/ui-common'; type FormValue = string | number | boolean | string[]; @@ -331,7 +331,7 @@ function FleetCrudPage({ {columns.map((column) => ( - {column.render ? column.render(item) : String((item as Record)[column.key] ?? '-')} + {column.render ? column.render(item) : String((item as Record)[String(column.key)] ?? '-')} ))} @@ -410,7 +410,7 @@ function FleetCrudPage({ ...current, [field.key]: selectedValue, ...(field.onValueChange?.(selectedValue, current) ?? {}), - })) + }) as Record) } > @@ -480,12 +480,6 @@ function FleetCrudPage({ const statusBadge = (status?: string) => {status ?? '-'}; -const activeBadge = (isActive?: boolean) => ( - - {isActive === false ? 'Inactive' : 'Active'} - -); - const optionLabel = (options: { value: string; label: string }[], value?: string | null) => options.find((option) => option.value === value)?.label ?? value ?? '-'; diff --git a/apps/edr-freight-web/backoffice/src/pages/fleet/FleetResourcePage.tsx b/apps/edr-freight-web/backoffice/src/pages/fleet/FleetResourcePage.tsx index 6db31e931..5be9f1e56 100644 --- a/apps/edr-freight-web/backoffice/src/pages/fleet/FleetResourcePage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/fleet/FleetResourcePage.tsx @@ -1,19 +1,10 @@ import type { ColumnDef } from "@edr/ui-common"; -import { Box, Button, Card, Group, Modal, Select, Stack, Text } from "@mantine/core"; +import { Box, Button, Card, Container, Group, Modal, Select, Stack, Text, Title } from "@mantine/core"; import { useMutation, useQuery } from "@tanstack/react-query"; import { api } from "@/services/api"; -import { - Archive, - Circle, - CircleCheck, - CircleSlash, - Layers, - Link2, - Plus, - Wrench, - type LucideIcon, -} from "lucide-react"; +import Breadcrumbs from "@/components/ui/Breadcrumbs"; +import { Plus } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; import { Navigate, useLocation } from "react-router-dom"; @@ -23,37 +14,20 @@ import FleetRecordActions from "@/components/fleet/FleetRecordActions"; import FleetToolbar from "@/components/fleet/FleetToolbar"; import { formatFleetCell, registerFleetOptionLabels } from "@/components/fleet/fleetFormat"; import { useFleetViewMode } from "@/components/fleet/useFleetViewMode"; -import { KpiStrip, PageContainer, PageHeader } from "@/components/page"; import { ruleEngineTable } from "@/components/ruleEngine/ruleEngineStyles"; import { useToast } from "@/hooks/use-toast"; import { - FLEET_SELECT_NONE, - getFleetResource, - getFleetSlugFromPath, - type FleetFormFieldDef, - type FleetResourceSlug, + FLEET_SELECT_NONE, + getFleetResource, + getFleetSlugFromPath, + type FleetFormFieldDef, + type FleetResourceSlug, } from "@/pages/fleet/config/resources"; import type { FleetListFilters, FleetRecord } from "@/services/fleet/fleet.service"; import { DataTable, DataTableFooter, usePagination } from "@edr/ui-common"; const DEFAULT_SLUG: FleetResourceSlug = "locomotives"; -const FLEET_STATUS_META: Record< - string, - { label: string; icon: LucideIcon; color: string } -> = { - AVAILABLE: { label: "Available", icon: CircleCheck, color: "edr-green" }, - ASSIGNED: { label: "Assigned", icon: Link2, color: "blue" }, - MAINTENANCE: { label: "Maintenance", icon: Wrench, color: "yellow" }, - OUT_OF_SERVICE: { label: "Out of service", icon: CircleSlash, color: "red" }, - RETIRED: { label: "Retired", icon: Archive, color: "gray" }, -}; - -const humanizeStatus = (status: string) => { - const text = status.replace(/_/g, " ").toLowerCase(); - return text.charAt(0).toUpperCase() + text.slice(1); -}; - const FleetResourcePage = () => { const location = useLocation(); const slug = getFleetSlugFromPath(location.pathname) ?? DEFAULT_SLUG; @@ -113,6 +87,9 @@ const FleetResourcePage = () => { const { data: yards = [], isLoading: yardsLoading } = useQuery( api.routes.yards.queryOptions(), ); + const { data: drivers = [] } = useQuery( + api.fleet.list.queryOptions({ input: { slug: "drivers" } }), + ); useEffect(() => { setPagination((prev) => ({ pageIndex: 0, pageSize: prev.pageSize })); @@ -301,39 +278,6 @@ const FleetResourcePage = () => { const tableStatus = isLoading ? "loading" : isError ? "error" : "success"; - const kpiItems = useMemo(() => { - const items = [ - { - label: `Total ${config?.label.toLowerCase() ?? ""}`, - value: allRows.length, - icon: Layers, - color: "edr-green", - }, - ]; - if (hasStatusColumn) { - const counts = new Map(); - for (const row of allRows) { - const status = String( - (row as unknown as Record).status ?? "", - ); - if (status) counts.set(status, (counts.get(status) ?? 0) + 1); - } - const top = [...counts.entries()] - .sort((a, b) => b[1] - a[1]) - .slice(0, 4); - for (const [status, count] of top) { - const meta = FLEET_STATUS_META[status]; - items.push({ - label: meta?.label ?? humanizeStatus(status), - value: count, - icon: meta?.icon ?? Circle, - color: meta?.color ?? "gray", - }); - } - } - return items.slice(0, 5); - }, [allRows, hasStatusColumn, config?.label]); - if (!config) { return ; } @@ -376,7 +320,7 @@ const FleetResourcePage = () => { const handleAssignDriver = async () => { if (!assigningDriver || !("id" in assigningDriver) || !selectedDriver) return; try { - const selectedDriverRecord = (drivers as Array>).find( + const selectedDriverRecord = (drivers as unknown as Array>).find( (d) => String(d.id) === selectedDriver ); if (!selectedDriverRecord) return; @@ -384,6 +328,7 @@ const FleetResourcePage = () => { const driverName = `${selectedDriverRecord.firstName} ${selectedDriverRecord.lastName}`; await update.mutateAsync({ + slug, id: String(assigningDriver.id), data: { assignedDriverId: selectedDriver, @@ -608,7 +553,7 @@ const FleetResourcePage = () => { clearable value={selectedDriver} onChange={(value) => setSelectedDriver(value || "")} - data={(drivers as Array>).map((driver) => ({ + data={(drivers as unknown as Array>).map((driver) => ({ value: String(driver.id || ""), label: `${driver.firstName} ${driver.lastName} (${driver.licenseNumber})`, }))} diff --git a/apps/edr-freight-web/backoffice/src/pages/ruleEngine/RuleEngineResourcePage.tsx b/apps/edr-freight-web/backoffice/src/pages/ruleEngine/RuleEngineResourcePage.tsx index ffb752a56..2009204a7 100644 --- a/apps/edr-freight-web/backoffice/src/pages/ruleEngine/RuleEngineResourcePage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/ruleEngine/RuleEngineResourcePage.tsx @@ -1,58 +1,56 @@ -import { useCallback, useEffect, useMemo, useState } from "react"; -import { Navigate, useLocation, useParams } from "react-router-dom"; import { useAuth } from "@/auth/useAuth"; import { canAccessRuleEngineResource } from "@/lib/permissions"; import type { ColumnDef } from "@edr/ui-common"; import { - Box, - Card, - Button, - Modal, - Stack, - Group, - Text, - List, - Loader, + Box, + Button, + Card, + Group, + List, + Loader, + Modal, + Stack, + Text, } from "@mantine/core"; import { Plus } from "lucide-react"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { Navigate, useLocation, useParams } from "react-router-dom"; import { PageContainer, PageHeader } from "@/components/page"; +import ManageRuleEngineOrderDialog from "@/components/ruleEngine/ManageRuleEngineOrderDialog"; import RuleEngineCardGrid from "@/components/ruleEngine/RuleEngineCardGrid"; import RuleEngineFormDialog from "@/components/ruleEngine/RuleEngineFormDialog"; -import ManageRuleEngineOrderDialog from "@/components/ruleEngine/ManageRuleEngineOrderDialog"; import RuleEngineOrderControls from "@/components/ruleEngine/RuleEngineOrderControls"; import RuleEngineRecordActions from "@/components/ruleEngine/RuleEngineRecordActions"; -import { getOrderItemLabel } from "@/components/ruleEngine/ruleEngineOrder.utils"; import RuleEngineToolbar from "@/components/ruleEngine/RuleEngineToolbar"; import { formatCell } from "@/components/ruleEngine/ruleEngineFormat"; +import { getOrderItemLabel } from "@/components/ruleEngine/ruleEngineOrder.utils"; import { ruleEngineTable } from "@/components/ruleEngine/ruleEngineStyles"; import { useRuleEngineViewMode } from "@/components/ruleEngine/useRuleEngineViewMode"; import { - DEFAULT_CONFIGURATION_SLUG, - DEFAULT_RULES_SLUG, - RULE_ENGINE_CATEGORY_BASE_PATH, - RULE_ENGINE_SELECT_NONE, - getRuleEngineResource, - type RuleEngineNavCategory, -} from "@/pages/ruleEngine/config/resources"; -import { - useApprovalChain, - useCargoTypeParentOptions, - useContainerTypeOptions, - useLiveRateOptions, - useRateWorkflow, - useRuleEngineList, - useRuleEngineMutations, - useRuleEngineOrderList, - useRuleEngineOrderMutations, + useApprovalChain, + useCargoTypeParentOptions, + useContainerTypeOptions, + useLiveRateOptions, + useRateWorkflow, + useRuleEngineList, + useRuleEngineMutations, + useRuleEngineOrderList, + useRuleEngineOrderMutations, } from "@/hooks/rule-engine/useRuleEngine"; +import { + DEFAULT_CONFIGURATION_SLUG, + DEFAULT_RULES_SLUG, + RULE_ENGINE_CATEGORY_BASE_PATH, + RULE_ENGINE_SELECT_NONE, + getRuleEngineResource, + type RuleEngineNavCategory, +} from "@/pages/ruleEngine/config/resources"; import type { RuleEngineRecord } from "@/types/rule-engine"; import { - DataTable, - DataTableFooter, - getCoreRowModel, - usePagination, - useReactTable, + DataTable, + DataTableFooter, + usePagination, } from "@edr/ui-common"; const pathCategory = (pathname: string): RuleEngineNavCategory | undefined => { diff --git a/apps/edr-freight-web/backoffice/src/services/customers.service.ts b/apps/edr-freight-web/backoffice/src/services/customers.service.ts index d375ad7a7..4e9c9d80e 100644 --- a/apps/edr-freight-web/backoffice/src/services/customers.service.ts +++ b/apps/edr-freight-web/backoffice/src/services/customers.service.ts @@ -24,6 +24,7 @@ function mapCompany(dto: Record): Company { const attrs = (dto.attributes as Record | null) ?? {}; return { ...(dto as unknown as Company), + companyProfiles: (dto.companyProfiles as Company["companyProfiles"]) ?? [], contactPersonName: (attrs.contactPersonName as string | null) ?? null, contactPersonPhone: (attrs.contactPersonPhone as string | null) ?? null, generalManagerName: (attrs.generalManagerName as string | null) ?? null, diff --git a/apps/edr-freight-web/backoffice/src/types/trainScheduling.ts b/apps/edr-freight-web/backoffice/src/types/trainScheduling.ts index 805e48132..db23e0de5 100644 --- a/apps/edr-freight-web/backoffice/src/types/trainScheduling.ts +++ b/apps/edr-freight-web/backoffice/src/types/trainScheduling.ts @@ -375,6 +375,7 @@ export interface TrainScheduleDetail { weightTons: number; status: string | null; schedulingStatus?: SchedulingStatus | null; + freightType?: FreightType | string | null; }>; warnings?: string[]; } diff --git a/apps/edr-freight-web/backoffice/src/utils/groupBookingsForOperationsQueue.ts b/apps/edr-freight-web/backoffice/src/utils/groupBookingsForOperationsQueue.ts index 2cdd10088..e13416c57 100644 --- a/apps/edr-freight-web/backoffice/src/utils/groupBookingsForOperationsQueue.ts +++ b/apps/edr-freight-web/backoffice/src/utils/groupBookingsForOperationsQueue.ts @@ -7,7 +7,7 @@ import { export interface OperationsQueueGroups { government: BookingListRow[]; - commercial: ThreeHourBookingBucket[]; + commercial: ThreeHourBookingBucket[]; } export function groupBookingsForOperationsQueue( diff --git a/apps/edr-freight-web/portal/src/services/auth.service.ts b/apps/edr-freight-web/portal/src/services/auth.service.ts index 856d417cc..e1de1889a 100644 --- a/apps/edr-freight-web/portal/src/services/auth.service.ts +++ b/apps/edr-freight-web/portal/src/services/auth.service.ts @@ -1,40 +1,40 @@ import { URL_CONSTANTS } from "@/constants/URLS"; +import type { + AuthUser, + GenerateVerificationCodePayload, + LoginPayload, + LoginResponse, + OtpPayload, + OtpResponse, + SetPasswordPayload, + SignupPayload, + SignupResponse, +} from "@/types/auth"; import { client } from "@/utils/api"; import { ApiResponse } from "@edr/types"; -import type { - AuthUser, - GenerateVerificationCodePayload, - LoginPayload, - LoginResponse, - OtpPayload, - OtpResponse, - SetPasswordPayload, - SignupPayload, - SignupResponse, -} from "@/types/auth"; export const authService = { login: async (body: LoginPayload) => { - const res = await client.post>( + const res = await client.post( URL_CONSTANTS.AUTH.LOGIN, body, ); - return res.data.data; + return res.data; }, createUser: async (body: SignupPayload) => { - const res = await client.post>( + const res = await client.post> ( URL_CONSTANTS.USERS.SIGN_UP, body, ); - return res.data.data; + return res.data; }, getMyInfo: async () => { - const res = await client.get>( + const res = await client.get( URL_CONSTANTS.USERS.ME, ); - return res.data.data; + return res.data; }, generateVerificationCode: async (body: GenerateVerificationCodePayload) => {