feat : ajout d'une page de creation d'une expedition
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user