26 lines
887 B
TypeScript
26 lines
887 B
TypeScript
import type { WorkflowConfig, WorkflowEntity } from '~/types/workflow'
|
|
|
|
export const shipmentConfig: WorkflowConfig = {
|
|
entityName: 'shipment',
|
|
apiResource: 'shipments',
|
|
steps: [
|
|
{ label: 'Expédition' },
|
|
{ label: 'Pesée à vide', weighingMode: 'tare' },
|
|
{ label: 'Chargement' },
|
|
{ label: 'Pesée à plein', weighingMode: 'gross', isFinal: true }
|
|
],
|
|
weighingLabels: {
|
|
gross: 'Pesée à plein',
|
|
tare: 'Pesée à vide'
|
|
},
|
|
buildReceiptFilename: (entity: WorkflowEntity) => {
|
|
const ship = entity as any
|
|
return `${ship.identificationNumber ?? ship.id}_${ship.customer?.label ?? 'client'}_${ship.licensePlate ?? 'immat'}.pdf`
|
|
},
|
|
routePrefix: '/shipment',
|
|
toastPrefix: 'shipment',
|
|
dateField: 'shipmentDate'
|
|
}
|
|
|
|
export const SHIPMENT_STEP_LABELS = shipmentConfig.steps.map(s => s.label)
|