diff --git a/server/storage.ts b/server/storage.ts index 079b2bd..3da8d40 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -494,8 +494,11 @@ class MemStorage implements IStorage { timestamp: new Date(), lieuNaissance: sale.lieuNaissance || null, autoriteDelivrance: sale.autoriteDelivrance || null, - documentType: sale.documentType || null, - documentNumber: sale.documentNumber || null, + // Map typeIdentite to documentType field for historical reasons + documentType: sale.typeIdentite || null, + // Map numeroIdentite to documentNumber field + documentNumber: sale.numeroIdentite || null, + // Ensure adresse is properly mapped adresse: sale.adresse || null, photoRecto: sale.photoRecto || null, photoVerso: sale.photoVerso || null, diff --git a/shared/schema.ts b/shared/schema.ts index 2ab5107..582a931 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -74,6 +74,13 @@ export const sales = pgTable("sales", { autoriteDelivrance: varchar("autorite_delivrance", { length: 255 }), dateDelivrance: varchar("date_delivrance", { length: 10 }).notNull(), + // Adresse - ajout du champ manquant + adresse: text("adresse"), + + // Champs legacy pour compatibilité historique + documentType: varchar("document_type", { length: 50 }), + documentNumber: varchar("document_number", { length: 100 }), + // Photos photo_recto: text("photo_recto"), photo_verso: text("photo_verso"),