Make delivery validation require a mandatory delivery note number

Enforce the requirement for a delivery note number (blNumber) during delivery validation on both the delivery and calendar modules. This change updates the frontend validation schema to make blNumber a required field with a minimum length, modifies the backend logic to reject validations without a blNumber, and integrates a new modal component for handling this validation process within the Deliveries page.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 98f01874-e00c-4bbe-9d71-b0b338001848
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/98f01874-e00c-4bbe-9d71-b0b338001848/yaZkPAT
This commit is contained in:
michaelschal committed 2025-09-01 11:57:55 +00:00
1 parent 6dca340c45
commit c09388c0aa
3 files changed
+34 -60

No files matched your search

+8 -7
View File
@@ -1113,13 +1113,14 @@ export async function registerRoutes(app: Express): Promise<Server> {
const { blNumber, blAmount } = req.body;
// BL data is optional - delivery can be validated without it
let blData: any = undefined;
if (blNumber) {
blData = { blNumber };
if (blAmount !== undefined && blAmount !== null && blAmount !== '') {
blData.blAmount = blAmount;
}
// Le numéro de BL est maintenant obligatoire pour valider une livraison
if (!blNumber || !blNumber.trim()) {
return res.status(400).json({ message: "Le numéro de bon de livraison est obligatoire pour valider une livraison" });
}
let blData: any = { blNumber: blNumber.trim() };
if (blAmount !== undefined && blAmount !== null && blAmount !== '') {
blData.blAmount = blAmount;
}
await storage.validateDelivery(id, blData);