Improve invoice verification and error handling for deliveries

Fix JSON parsing errors, create a missing invoice verification service with development simulation, and align PostgreSQL schemas with production types.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/7c468936-2a88-4686-ac0a-84921a45222d/DT38biO
This commit is contained in:
michaelschal committed 2025-08-13 12:11:18 +00:00
1 parent 5ac9c97e23
commit e4ad3539c7
7 files changed
+153 -151

No files matched your search

+8 -9
View File
@@ -70,17 +70,16 @@ export default function BLReconciliation() {
// Fonction de vérification de facture
const verifyInvoiceMutation = useMutation({
mutationFn: async ({ deliveryId, invoiceReference, blNumber }: { deliveryId: number; invoiceReference?: string; blNumber?: string }) => {
const response = await apiRequest(`/api/deliveries/${deliveryId}/verify-invoice`, 'POST', {
invoiceReference,
blNumber
});
if (!response.ok) {
const error = await response.json();
try {
const result = await apiRequest(`/api/deliveries/${deliveryId}/verify-invoice`, 'POST', {
invoiceReference,
blNumber
});
return result;
} catch (error: any) {
console.error('Erreur API vérification:', error);
throw new Error(error.message || 'Erreur de vérification');
}
return response.json();
},
onSuccess: (result, variables) => {
setVerificationResults(prev => ({