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
This commit is contained in:
michaelschal committed 2025-07-09 18:14:47 +00:00
1 parent cddfee5d09
commit 973256f8d0
3 files changed
+9 -7

No files matched your search

+4 -4
View File
@@ -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 }) => (
<FormItem>
<FormLabel>Autorité de délivrance</FormLabel>
<FormLabel>Autorité de délivrance <span className="text-destructive">*</span></FormLabel>
<FormControl>
<Input placeholder="Préfecture, Mairie, etc." {...field} />
</FormControl>
@@ -437,7 +437,7 @@ export default function NewSaleForm({ onSaveSale }: NewSaleFormProps) {
name="dateDelivrance"
render={({ field }) => (
<FormItem>
<FormLabel>Date de délivrance</FormLabel>
<FormLabel>Date de délivrance <span className="text-destructive">*</span></FormLabel>
<FormControl>
<Input type="date" {...field} />
</FormControl>
+3 -1
View File
@@ -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
+2 -2
View File
@@ -21,8 +21,8 @@ export interface Sale {
// Identité
typeIdentite: string;
numeroIdentite: string;
autoriteDelivrance?: string;
dateDelivrance?: string;
autoriteDelivrance: string;
dateDelivrance: string;
// Photos
photoRecto?: string;