diff --git a/.replit b/.replit
index c7abdf5..bf3ee09 100644
--- a/.replit
+++ b/.replit
@@ -47,6 +47,10 @@ externalPort = 6000
localPort = 44549
externalPort = 5173
+[[ports]]
+localPort = 44701
+externalPort = 8000
+
[[ports]]
localPort = 44965
externalPort = 6800
diff --git a/client/src/pages/Deliveries.tsx b/client/src/pages/Deliveries.tsx
index accf271..9003aa6 100644
--- a/client/src/pages/Deliveries.tsx
+++ b/client/src/pages/Deliveries.tsx
@@ -23,7 +23,9 @@ import {
Building,
User,
Check,
- Package
+ Package,
+ AlertTriangle,
+ CheckCircle
} from "lucide-react";
import { safeFormat } from "@/lib/dateUtils";
import CreateDeliveryModal from "@/components/modals/CreateDeliveryModal";
@@ -111,6 +113,30 @@ export default function Deliveries() {
const groups = Array.isArray(groupsData) ? groupsData : [];
+ const markControlValidatedMutation = useMutation({
+ mutationFn: async (id: number) => {
+ await apiRequest(`/api/deliveries/${id}/control`, "PUT");
+ },
+ onSuccess: () => {
+ toast({
+ title: "Succès",
+ description: "Contrôle validé avec succès",
+ });
+ queryClient.invalidateQueries({ queryKey: ['/api/deliveries'] });
+ queryClient.invalidateQueries({ queryKey: [deliveriesUrl] });
+ },
+ onError: (error: any) => {
+ if (isUnauthorizedError(error)) {
+ return;
+ }
+ toast({
+ title: "Erreur",
+ description: "Impossible de valider le contrôle",
+ variant: "destructive",
+ });
+ },
+ });
+
const deleteMutation = useMutation({
mutationFn: async (id: number) => {
await apiRequest(`/api/deliveries/${id}`, "DELETE");
@@ -180,6 +206,28 @@ export default function Deliveries() {
}
};
+ const getControlBadge = (delivery: DeliveryWithRelations) => {
+ if (!delivery.supplier?.requiresControl) {
+ return null;
+ }
+
+ if (delivery.controlValidated) {
+ return (
+