Files
LogiFlow/attached_assets/Pasted-ns-updatedAt-2025-07-25T23-07-17-197Z-Configuration-NocoDB-trouv-e--1755448270468_1755448270469.txt
T
michaelschal 4ff83da545 Improve invoice verification cache reliability and add expiration handling
Fix database storage to correctly check cache expiration and delete expired entries, preventing stale data from being served. Added logs for cache hits, misses, and expirations.

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:34:37 +00:00

206 lines
3.0 KiB
Plaintext

ns
updatedAt: 2025-07-25T23:07:17.197Z
}
🔧 Configuration NocoDB trouvée: {
configName: 'Nocodb',
baseUrl: 'https://nocodb.ffnancy.fr',
projectId: 'pcg4uw79ukvycxc',
hasToken: true
}
🔧 Utilisation table ID: {
groupTable: 'CommandeH',
configuredId: 'my7zunxprumahmm',
resolvedId: 'my7zunxprumahmm'
}
🔍 Recherche NocoDB: { tableId: 'my7zunxprumahmm', column: 'RefFacture' }
🔧 Configuration NocoDB active récupérée: {
id: 1,
name: 'Nocodb',
baseUrl: 'https://nocodb.ffnancy.fr',
projectId: 'pcg4uw79ukvycxc',
apiToken: 'z4BAwLo6dgoN_E7PKJSHN7PA7kdBePtKOYcsDlwQ',
description: '',
isActive: true,
createdBy: 'admin_local',
createdAt: 2025-07-22T11:12:54.971Z,
updatedAt: 2025-07-25T23:07:17.197Z
}
🔧 Configuration NocoDB trouvée: {
configName: 'Nocodb',
baseUrl: 'https://nocodb.ffnancy.fr',
projectId: 'pcg4uw79ukvycxc',
hasToken: true
}
🔧 Utilisation table ID: {
groupTable: 'CommandeF',
configuredId: 'mrr733dfb8wtt9b',
resolvedId: 'mrr733dfb8wtt9b'
}
🔍 Recherche NocoDB: { tableId: 'mrr733dfb8wtt9b', column: 'RefFacture' }
✅ [CACHE] Résultat sauvé en cache: {

,
invoiceReference: '25070526',
groupId: 1,
exists: true,
cacheKey: '1_25070526'
}
✅ Résultat vérification: {
exists: true,
matchType: 'invoice_reference',
invoiceReference: '25070526',
invoiceAmount: 920.5,
supplierName: "Cotillon d'Alasce"
}
✅ [CACHE] Résultat sauvé en cache: {

id: 16638,
invoiceReference: 'F5175811',
groupId: 1,
exists: true,
cacheKey: '1_f5175811'
}
✅ Résultat vérification: {
exists: true,
matchType: 'invoice_reference',
invoiceReference: 'F5175811',
invoiceAmount: 2812.57,
supplierName: 'JJA Atmosphera'
}
POST /api/deliveries/61/verify-invoice 200 in 2015ms
POST /api/deliveries/89/verify-invoice 200 in 1989ms
🔍 [CACHE] Résultat cache: {
found: true,
expired: true,
expiresAt: 2025-08-14T16:04:19.769Z,
currentTime: '2025-08-17T16:31:06.169Z'
}
⏰ [CACHE] Cache expiré pour: { invoiceReference: '25080486', groupId: 1 }
🔍 [INVOICE] Pas de cache, requête API...
🔧 Configuration NocoDB active récupérée: {
id: 1,
name: 'Nocodb',
baseUrl: 'https://nocodb.ffnancy.fr',
projectId: 'pcg4uw79ukvycxc',
apiToken: 'z4BAwLo6dgoN_E7PKJSHN7PA7kdBePtKOYcsDlwQ',
description: '',
isActive: true,
createdBy: 'admin_local',
createdAt: 2025-07-22T11:12:54.971Z,
updatedAt: 2025-07-25T23:07:17.197Z
}
🔧 Configuration NocoDB trouvée: {
configName: 'Nocodb',
baseUrl: 'https://nocodb.ffnancy.fr',
projectId: 'pcg4uw79ukvycxc',
hasToken: true
}
🔧 Utilisation table ID: {
groupTable: 'CommandeF',
configuredId: 'mrr733dfb8wtt9b',
resolvedId: 'mrr733dfb8wtt9b'
}