From b9ae743ffb6ccc30ecd4041cd0fb2dfa41923c3d Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 6 Aug 2025 11:18:45 +0000 Subject: [PATCH] Update sales records to include address and identification details Correctly map `typeIdentite` to `documentType` and `numeroIdentite` to `documentNumber` in sales storage, and add the `adresse` field to the PostgreSQL schema for comprehensive record-keeping. Replit-Commit-Author: Agent Replit-Commit-Session-Id: a388004f-01c5-42b1-b1d1-f18daf8bdd0c Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/a388004f-01c5-42b1-b1d1-f18daf8bdd0c/rtjaOGR --- server/storage.ts | 7 +++++-- shared/schema.ts | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) 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"),