From 973256f8d0e47cf789f231f367f6c2e1db3dda42 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 9 Jul 2025 18:14:47 +0000 Subject: [PATCH] Require authority and date of issue for identity documents on sales form Make 'autoriteDelivrance' and 'dateDelivrance' mandatory fields in NewSaleForm.tsx, sale.ts and validation.ts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/efe87597-d535-4405-b5de-78081405fa4c.jpg --- client/src/components/NewSaleForm.tsx | 8 ++++---- client/src/lib/validation.ts | 4 +++- client/src/types/sale.ts | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/src/components/NewSaleForm.tsx b/client/src/components/NewSaleForm.tsx index cbea827..1a8e823 100644 --- a/client/src/components/NewSaleForm.tsx +++ b/client/src/components/NewSaleForm.tsx @@ -120,8 +120,8 @@ export default function NewSaleForm({ onSaveSale }: NewSaleFormProps) { lieuNaissance: data.lieuNaissance || undefined, typeIdentite: data.typeIdentite, numeroIdentite: data.numeroIdentite, - autoriteDelivrance: data.autoriteDelivrance || undefined, - dateDelivrance: data.dateDelivrance || undefined, + autoriteDelivrance: data.autoriteDelivrance, + dateDelivrance: data.dateDelivrance, photoRecto: photos.recto, photoVerso: photos.verso, }; @@ -424,7 +424,7 @@ export default function NewSaleForm({ onSaveSale }: NewSaleFormProps) { name="autoriteDelivrance" render={({ field }) => ( - Autorité de délivrance + Autorité de délivrance * @@ -437,7 +437,7 @@ export default function NewSaleForm({ onSaveSale }: NewSaleFormProps) { name="dateDelivrance" render={({ field }) => ( - Date de délivrance + Date de délivrance * diff --git a/client/src/lib/validation.ts b/client/src/lib/validation.ts index 0b9d0ba..1f30c2d 100644 --- a/client/src/lib/validation.ts +++ b/client/src/lib/validation.ts @@ -24,7 +24,9 @@ export function validateRequiredFields(formData: any): string[] { { key: 'prenom', label: 'Prénom' }, { key: 'dateNaissance', label: 'Date de naissance' }, { key: 'typeIdentite', label: 'Type de pièce d\'identité' }, - { key: 'numeroIdentite', label: 'Numéro de pièce d\'identité' } + { key: 'numeroIdentite', label: 'Numéro de pièce d\'identité' }, + { key: 'autoriteDelivrance', label: 'Autorité de délivrance' }, + { key: 'dateDelivrance', label: 'Date de délivrance' } ]; return requiredFields diff --git a/client/src/types/sale.ts b/client/src/types/sale.ts index 53a085b..ae3e546 100644 --- a/client/src/types/sale.ts +++ b/client/src/types/sale.ts @@ -21,8 +21,8 @@ export interface Sale { // Identité typeIdentite: string; numeroIdentite: string; - autoriteDelivrance?: string; - dateDelivrance?: string; + autoriteDelivrance: string; + dateDelivrance: string; // Photos photoRecto?: string;