feat : ajout d'une page de creation d'une expedition

This commit is contained in:
2026-02-11 16:12:33 +01:00
parent 0181d72144
commit 5f4139fde3
31 changed files with 1292 additions and 356 deletions

View File

@@ -25,6 +25,16 @@ export type ShipmentData = {
truck?: TruckData | null
customer?: CustomerData | null
bovinShipments?: BovinShipmentData[] | null
weights?: WeightShipmentEntryData[] | null
}
export interface WeightShipmentEntryData {
id?: number
type: 'gross' | 'tare'
dsd: number | null
weight: number | null
weighedAt: string | null
}
export type ShipmentFormData = {
@@ -48,4 +58,8 @@ export type ShipmentPayload = {
truck?: string | null
customer?: string | null
bovinShipments?: string[] | null
address?: string | null
user?: string | null
driver?: string | null
}

View File

@@ -9,7 +9,7 @@ export type ShipmentTypeListResponse =
export async function getShipmentTypeList(): Promise<ShipmentTypeData[]> {
const api = useApi()
const response = await api.get<ShipmentTypeListResponse>('shipment_types', {}, {
toastErrorKey: 'errors.shipment_type.list'
toastErrorKey: 'errors.shipmentType.list'
})
if (Array.isArray(response)) {

View File

@@ -32,7 +32,7 @@ export async function updateShipment(id: number, payload: ShipmentPayload) {
})
}
export async function getWeight(): Promise<WeightData> {
export async function getWeightShipment(): Promise<WeightData> {
const api = useApi()
return api.get<WeightData>('shipments/weigh', {}, {
toastErrorKey: 'errors.shipment.weigh'

View File

@@ -2,7 +2,8 @@ import { useApi } from '~/composables/useApi'
import type { WeightEntryData } from '~/services/dto/reception-data'
export type WeightPayload = {
reception: string
reception?: string
shipment?: string
type: 'gross' | 'tare'
dsd: number | null
weight: number | null