mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Fix issues with creating new entries and improve data validation
Update server route error handling and Zod schemas for optional fields to resolve creation errors. 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/p0qYuko
This commit is contained in:
1 parent
070daf71ac
commit
b3eb0644e0
3 files changed
+208
-3
No files matched your search
+2
-2
@@ -585,8 +585,8 @@ export const insertAvoirSchema = createInsertSchema(avoirs).omit({
|
||||
processedAt: true,
|
||||
}).extend({
|
||||
status: z.enum(["En attente de demande", "Demandé", "Reçu"]).default("En attente de demande"),
|
||||
amount: z.coerce.number().positive(), // Montant doit être positif
|
||||
invoiceReference: z.string().min(1, "La référence facture est obligatoire"),
|
||||
amount: z.coerce.number().positive().optional(), // Montant optionnel et positif si présent
|
||||
invoiceReference: z.string().optional(), // Référence facture optionnelle
|
||||
comment: z.string().optional(),
|
||||
commercialProcessed: z.boolean().default(false),
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user