- Backend : champ Reception.validatedAt (timestamp) avec PreUpdate + helpers
isFullyConfirmed/tryValidate ; sync EDNOTIF déclenche tryValidate sur
les receptions impactées ; expose Supplier.name dans le groupe bovine:read.
- Migration : ajout colonne validated_at sans backfill (les receptions
remontent en attente jusqu'au prochain sync).
- Front /entry-exit : remplace Historique par 'Entrées validées' (filtre
exists[validatedAt]=true), ajoute filtres et colonne Statut sur les
deux tableaux, retire Fournisseur, layout 2x2 (entrées + sorties).
- Front /entry-exit/entry/{id} : mode consultation quand entryCompleted=true
(formulaire + actions masqués, colonne EDNOTIF par bovin) ; ajoute
colonnes Vendeur et Cause dans le récap.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
111 lines
3.1 KiB
TypeScript
111 lines
3.1 KiB
TypeScript
import type { ReceptionTypeData } from '~/services/dto/reception-type-data'
|
|
import type { MerchandiseTypeData } from '~/services/dto/merchandise-type-data'
|
|
import type { BuildingData } from '~/services/dto/building-data'
|
|
import type { ReceptionPelletBuildingData } from '~/services/dto/reception-pellet-building-data'
|
|
import type { UserData } from '~/services/dto/user-data'
|
|
import type { SupplierData } from '~/services/dto/supplier-data'
|
|
import type { AddressData } from '~/services/dto/address-data'
|
|
import type { TruckData } from '~/services/dto/truck-data'
|
|
import type { CarrierData } from '~/services/dto/carrier-data'
|
|
import type { DriverData } from '~/services/dto/driver-data'
|
|
import type {BovineTypeData} from "~/services/dto/bovine-type-data";
|
|
|
|
export interface ReceptionData {
|
|
id: number
|
|
identificationNumber?: string | null
|
|
licensePlate: string | null
|
|
weights?: WeightEntryData[] | null
|
|
receptionDate: string
|
|
currentStep: number
|
|
isValid: boolean
|
|
entryCompleted?: boolean
|
|
validatedAt?: string | null
|
|
registeredBovineCount?: number
|
|
confirmedBovineCount?: number
|
|
declaredBovineCount?: number
|
|
receptionType?: ReceptionTypeData | null
|
|
merchandiseType?: MerchandiseTypeData | null
|
|
merchandiseDetail?: string | null
|
|
bovineDetail?: string | null
|
|
buildings?: BuildingData[] | null
|
|
bovinesTypes?: BovineTypeData[] | null
|
|
pelletBuildings?: ReceptionPelletBuildingData[] | null
|
|
user?: UserData | null
|
|
supplier?: SupplierData | null
|
|
address?: AddressData | null
|
|
truck?: TruckData | null
|
|
carrier?: CarrierData | null
|
|
driver?: DriverData | null
|
|
}
|
|
|
|
export interface WeightEntryData {
|
|
id?: number
|
|
type: 'gross' | 'tare'
|
|
dsd: number | null
|
|
weight: number | null
|
|
weighedAt: string | null
|
|
}
|
|
|
|
export interface MerchandiseEntryData {
|
|
merchandiseTypeId: string
|
|
merchandiseDetail: string
|
|
selectedBuildingIds: string[]
|
|
selectedPelletBuildingIds: Record<string, string[]>
|
|
}
|
|
|
|
export interface WeightFormData {
|
|
id: number
|
|
weight: number
|
|
weighedAt : string
|
|
dsd: number
|
|
type: 'gross' | 'tare'
|
|
}
|
|
|
|
|
|
|
|
export type ReceptionPayload = {
|
|
licensePlate?: string | null
|
|
receptionDate?: string
|
|
currentStep?: number
|
|
isValid?: boolean
|
|
entryCompleted?: boolean
|
|
receptionType?: string | null
|
|
merchandiseType?: string | null
|
|
merchandiseDetail?: string | null
|
|
bovineDetail?: string | null
|
|
buildings?: string[] | null
|
|
bovinesTypes?: string[] | null
|
|
user?: string | null
|
|
supplier?: string | null
|
|
address?: string | null
|
|
truck?: string | null
|
|
carrier?: string | null
|
|
driver?: string | null
|
|
}
|
|
|
|
export type ReceptionFormData = {
|
|
identificationNumber?: null|string,
|
|
licensePlate: string
|
|
receptionDate: string
|
|
receptionTypeId: string
|
|
userId: string
|
|
supplierId: string
|
|
addressId: string
|
|
truckId: string
|
|
carrierId: string
|
|
driverId: string
|
|
vehicleId: string
|
|
weight?: ReceptionFormWeight | null
|
|
}
|
|
|
|
export type ReceptionFormWeight = {
|
|
weights: WeightFormData[]
|
|
}
|
|
|
|
export interface ReceptionUpdatePayload {
|
|
weights: {
|
|
id: number
|
|
weight: number
|
|
}[]
|
|
}
|