Make delivery comments read-only after reconciliation

Disables editing and displays a read-only status for delivery comments once reconciliation is validated, preventing modifications to comments on reconciled deliveries.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/yiEpJFx
This commit is contained in:
michaelschal committed 2025-09-09 13:31:42 +00:00
1 parent 9f684eeb60
commit 890430c4c0
2 files changed
+34 -15

No files matched your search

+5
View File
@@ -1356,6 +1356,11 @@ export async function registerRoutes(app: Express): Promise<Server> {
const { notes } = req.body;
// Check if delivery is reconciled (read-only)
if (delivery.reconciled) {
return res.status(403).json({ message: "Impossible de modifier le commentaire d'une livraison réconciliée" });
}
// Validate notes length
if (notes && notes.length > 500) {
return res.status(400).json({ message: "Commentaire trop long (maximum 500 caractères)" });