Commit Graph
20 Commits
Author SHA1 Message Date
Claude a5785f0244 perf(serveur): réponses API allégées, compression, cache des assets et index
- Fichiers statiques servis avant la session (plus de requêtes SQL par
  asset), /assets en cache immuable 1 an, index.html en no-cache, et
  compression gzip/brotli des réponses (dépendance compression, externe
  dans le bundle esbuild du Dockerfile).
- req.user (déjà chargé par deserializeUser) réutilisé dans les handlers
  au lieu de relire l'utilisateur et ses magasins à chaque appel ;
  GET /api/user ne refait plus de requête.
- Listes : le magasin joint est réduit aux champs lus par l'interface
  (plus de logo base64 ni de configuration SMTP/NocoDB dans chaque ligne),
  plus aucune empreinte de mot de passe dans les créateurs/auteurs ni dans
  /api/users.
- N+1 supprimés (/api/users, annonces, historique SAV, caches de
  vérification des factures), requêtes indépendantes en parallèle (stats,
  analytics, météo, getDelivery, getUserWithGroups), jointure
  multiplicative des statistiques par magasin corrigée.
- Échéancier limité au magasin demandé ; filtre status sur
  GET /api/deliveries.
- Index de performance créés en arrière-plan au démarrage
  (CREATE INDEX CONCURRENTLY, reliquats invalides purgés sans verrou
  exclusif).
- La connexion n'attend plus la sauvegarde quotidienne ; purge du cache
  des factures active en production ; logs volumineux retirés des
  chemins chauds ; NODE_ENV fixé dans l'image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MsDJjQrAggcJwbbBtKhgyb
2026-10-03 04:29:51 +00:00
Claude 4220131432 fix(types): bring real code to zero TypeScript errors, fix three latent bugs
Continues the cleanup from 164 errors down to 88, all of which now sit in
MemStorage — the in-memory dev mock — documented as known debt. Production
server code and the entire client are at zero errors.

Three genuine defects surfaced by the types and fixed:
- deleteAnnouncement returned void while routes check the result and answer
  404 "not found" on falsy: deleting an announcement succeeded in DB but the
  API reported failure on the fallback paths; it now returns a real boolean
- AnnouncementMemoryStorage declared getAnnouncement twice; the first
  implementation was dead at runtime (second definition wins) and is removed
- one route called storage.getDeliveryById(), a method that does not exist,
  crashing with a TypeError whenever hit; it now calls getDelivery()

Everything else is type-level only (annotations, null-to-undefined for
inline styles, honest signatures for markClientCalled's comment parameter
and the invoice verification result's invoiceAmountTTC field), verified
behavior-neutral: client build, production server bundle and the SMTP
end-to-end test all pass unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FHdE9nEh8zHhQNGpCgrtYe
2026-08-14 16:42:24 +00:00
michaelschal da6ec893d2 Add total invoice amount for verification and delivery processing
Update invoice verification service and database storage to include and process `invoiceAmountTTC` (total invoice amount). Modify routes to conditionally save TTC amount and adjust related schemas and cache definitions. Remove commented-out code and unused imports related to SAV ticket history.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 87886fa2-6eb3-432f-a67f-dd9d21591981
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/5hnOUe4
2025-11-04 09:13:12 +00:00
michaelschal c669c4eba9 Update invoice reconciliation to fix display issues
Introduce detailed logging and data type conversions in invoice verification service and client-side reconciliation page to address discrepancies in displayed invoice amounts and due dates.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 41ed310d-8033-46c7-bb26-e56560b56490
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/gTQvEeF
2025-11-04 05:30:12 +00:00
michaelschal 09c873eb06 Add due date tracking to invoice verification and delivery data
Updates InvoiceVerificationService to include dueDate, modifies routes.ts to fetch deliveries with due dates from storage instead of NocoDB, and adds dueDate to the deliveries schema in shared/schema.ts.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 45962ece-1470-4431-936b-016ef39720d8
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/G9gVBac
2025-11-03 16:28:41 +00:00
michaelschal 8dec1c46ba Improve reconciliation process by skipping already validated deliveries
Update client-side logic in BLReconciliation to exclude deliveries with a 'reconciled' status from automatic verification. Modify server-side InvoiceVerificationService to implement permanent caching for reconciled invoices, preventing redundant checks.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: daf3525c-b971-454a-b0c0-7a9845e786cc
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-31 07:56:20 +00:00
michaelschal 9ed380a279 Improve task management by optimizing cache updates for reconciled invoices
Add new functionality to update invoice verification cache to permanent status after reconciliation. Introduce a new API endpoint for admins to trigger bulk updates of existing reconciled caches, addressing potential performance issues with repeated checks on verified items.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: daf3525c-b971-454a-b0c0-7a9845e786cc
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-31 07:49:05 +00:00
michaelschal 97b63b61e8 Improve invoice verification caching with permanent storage for reconciled items
Introduce adaptive caching durations for invoice verification: permanent caching for reconciled invoices, temporary caching for found invoices, and longer temporary caching for not-found invoices.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: daf3525c-b971-454a-b0c0-7a9845e786cc
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-31 07:39:11 +00:00
michaelschal 8339afd4cf Improve invoice verification cache with in-memory storage and logging
Implement in-memory caching for invoice verification results with enhanced logging and expiration handling in MemStorage.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce/6kmwY2j
2025-08-17 16:08:53 +00:00
michaelschal c6c9369fcb Allow invoice verification using delivery's bill of lading number
Update the invoice verification process to accept either a direct invoice reference or a bill of lading number. This change enables the system to correctly identify and process invoices when only the bill of lading information is available, ensuring that all relevant deliveries are reconciled. The backend service has been enhanced to search for invoices using the bill of lading and supplier name, with improved caching and error handling for missing configurations.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a3de0820-9397-41b2-b000-7931ee9c29de
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/a3de0820-9397-41b2-b000-7931ee9c29de/AO4neXk
2025-08-16 07:00:46 +00:00
michaelschal 8eb0458ce2 Improve invoice verification stability and error handling
Enhance InvoiceVerificationService to cache API errors and "not found" results, preventing repetitive calls. Add validation for NocoDB search parameters and improve error logging for production stability.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: d43bd811-9372-45a7-8ac9-4a954c0538e1
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/d43bd811-9372-45a7-8ac9-4a954c0538e1/IhbIRSa
2025-08-15 11:13:31 +00:00
michaelschal 80ca426a33 Improve invoice verification caching with conflict resolution and error handling
Implement unique constraint on invoice verification cache key and handle duplicate entries gracefully in the backend.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: d43bd811-9372-45a7-8ac9-4a954c0538e1
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/d43bd811-9372-45a7-8ac9-4a954c0538e1/g5c0JYM
2025-08-15 09:48:29 +00:00
michaelschal 7fb037bf53 Improve invoice verification by adding caching and manual refresh functionality
Implement an invoice verification cache to avoid redundant checks, introduce a manual refresh button to trigger verification on demand, and modify the API to accept a forceRefresh parameter.

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/Sh7jLhH
2025-08-13 13:46:11 +00:00
michaelschal 87c111741b Update invoice verification to use specific NocoDB table IDs
Refactor invoice verification service to correctly utilize `nocodbTableId` for NocoDB API calls, defaulting to 'mrr733dfb8wtt9b' if not provided. Updates column names for invoice and delivery slip searches to 'RefFacture' and 'Numero_BL' respectively. Also, corrects NocoDB configuration URLs and project IDs for production environments.

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/t34W525
2025-08-13 13:30:44 +00:00
michaelschal d128c721e8 Enable invoice verification using NocoDB for production environments
Implement actual NocoDB integration for invoice verification, including error handling and configuration loading, and adjust test data to reflect production-like structures.

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/cH9Kvea
2025-08-13 12:54:17 +00:00
michaelschal e4ad3539c7 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
2025-08-13 12:11:18 +00:00
michaelschal 4cf7a5c602 Automatically verify invoices upon page load for improved efficiency
Introduces automatic invoice verification on page load using useEffect hook, refactors invoice verification service to fetch active NocoDB configuration, and updates routes to accept invoice reference and group ID.

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/CltQiuj
2025-08-13 11:37:57 +00:00
michaelschal 7ebd84e0e1 Integrate NocoDB configuration directly into store settings for invoice verification
Refactor invoice verification to use group-specific NocoDB configuration, removing the global `nocodbConfig` table and cache, and updating UI to reflect these changes.

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/ehBF9El
2025-08-13 11:14:47 +00:00
michaelschal 19ed96e48c Improve NocoDB invoice verification and error handling
Enhance NocoDB invoice verification logic in the client and server to handle missing configurations and provide better debugging information. Update schema definitions to reflect changes in NocoDB configuration handling.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-13 11:02:33 +00:00
michaelschal 967f34ae7f Add NocoDB invoice verification to reconcile deliveries automatically
Integrate NocoDB for automated invoice verification against delivery records, supporting both invoice reference and Bill of Lading number matching, with caching and improved UI feedback.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d
Replit-Commit-Checkpoint-Type: full_checkpoint
2025-08-13 10:18:51 +00:00