mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-23 15:08:22 +02:00
3 files changed
+13
-10
No files matched your search
@@ -51,14 +51,14 @@ externalPort = 5000
|
|||||||
localPort = 41343
|
localPort = 41343
|
||||||
externalPort = 3001
|
externalPort = 3001
|
||||||
|
|
||||||
[[ports]]
|
|
||||||
localPort = 41815
|
|
||||||
externalPort = 8099
|
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 43315
|
localPort = 43315
|
||||||
externalPort = 6000
|
externalPort = 6000
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 43783
|
||||||
|
externalPort = 9000
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 44549
|
localPort = 44549
|
||||||
externalPort = 5173
|
externalPort = 5173
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
+9
-6
@@ -1920,6 +1920,7 @@ export class DatabaseStorage implements IStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const results = await query.orderBy(asc(dlcProducts.expiryDate));
|
const results = await query.orderBy(asc(dlcProducts.expiryDate));
|
||||||
|
|
||||||
return results.map((row: any) => ({
|
return results.map((row: any) => ({
|
||||||
...row.dlcProduct,
|
...row.dlcProduct,
|
||||||
dlcDate: row.dlcProduct.expiryDate, // ✅ Mapping expiryDate vers dlcDate pour frontend
|
dlcDate: row.dlcProduct.expiryDate, // ✅ Mapping expiryDate vers dlcDate pour frontend
|
||||||
@@ -2076,6 +2077,9 @@ export class DatabaseStorage implements IStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Version rétrocompatible - fonctionne avec ou sans les nouveaux champs
|
// Version rétrocompatible - fonctionne avec ou sans les nouveaux champs
|
||||||
|
// IMPORTANT: Ne PAS filtrer sur processedUntilExpiry car cela crée une incohérence
|
||||||
|
// entre getDlcProducts (qui ne filtre pas) et getDlcStats (qui filtrait)
|
||||||
|
// Les produits expirés sont expirés, qu'ils aient été traités ou non
|
||||||
try {
|
try {
|
||||||
// Essayer d'abord avec les nouveaux champs
|
// Essayer d'abord avec les nouveaux champs
|
||||||
const [stats] = await db
|
const [stats] = await db
|
||||||
@@ -2084,12 +2088,10 @@ export class DatabaseStorage implements IStorage {
|
|||||||
expiringSoon: sql<number>`COUNT(CASE
|
expiringSoon: sql<number>`COUNT(CASE
|
||||||
WHEN ${dlcProducts.expiryDate} BETWEEN ${today.toISOString().split('T')[0]} AND ${alertDate.toISOString().split('T')[0]}
|
WHEN ${dlcProducts.expiryDate} BETWEEN ${today.toISOString().split('T')[0]} AND ${alertDate.toISOString().split('T')[0]}
|
||||||
AND ${dlcProducts.status} != 'valides'
|
AND ${dlcProducts.status} != 'valides'
|
||||||
AND (${dlcProducts.processedUntilExpiry} IS NULL OR ${dlcProducts.processedUntilExpiry} = false)
|
|
||||||
THEN 1 END)`,
|
THEN 1 END)`,
|
||||||
expired: sql<number>`COUNT(CASE
|
expired: sql<number>`COUNT(CASE
|
||||||
WHEN ${dlcProducts.expiryDate} <= ${today.toISOString().split('T')[0]}
|
WHEN ${dlcProducts.expiryDate} <= ${today.toISOString().split('T')[0]}
|
||||||
AND ${dlcProducts.status} != 'valides'
|
AND ${dlcProducts.status} != 'valides'
|
||||||
AND (${dlcProducts.processedUntilExpiry} IS NULL OR ${dlcProducts.processedUntilExpiry} = false)
|
|
||||||
THEN 1 END)`
|
THEN 1 END)`
|
||||||
})
|
})
|
||||||
.from(dlcProducts)
|
.from(dlcProducts)
|
||||||
@@ -4240,19 +4242,20 @@ export class MemStorage implements IStorage {
|
|||||||
products = products.filter(product => groupIds.includes(product.groupId));
|
products = products.filter(product => groupIds.includes(product.groupId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IMPORTANT: Ne PAS filtrer sur processedUntilExpiry car cela crée une incohérence
|
||||||
|
// entre getDlcProducts (qui ne filtre pas) et getDlcStats (qui filtrait)
|
||||||
|
// Les produits expirés sont expirés, qu'ils aient été traités ou non
|
||||||
return {
|
return {
|
||||||
active: products.filter(p => new Date(p.expiryDate) > today && p.status !== 'valides').length,
|
active: products.filter(p => new Date(p.expiryDate) > today && p.status !== 'valides').length,
|
||||||
expiringSoon: products.filter(p => {
|
expiringSoon: products.filter(p => {
|
||||||
const expiry = new Date(p.expiryDate);
|
const expiry = new Date(p.expiryDate);
|
||||||
const isExpiringSoon = expiry >= today && expiry <= alertDate;
|
const isExpiringSoon = expiry >= today && expiry <= alertDate;
|
||||||
const isProcessed = p.processedUntilExpiry && expiry > today;
|
return isExpiringSoon && p.status !== 'valides';
|
||||||
return isExpiringSoon && !isProcessed && p.status !== 'valides';
|
|
||||||
}).length,
|
}).length,
|
||||||
expired: products.filter(p => {
|
expired: products.filter(p => {
|
||||||
const expiry = new Date(p.expiryDate);
|
const expiry = new Date(p.expiryDate);
|
||||||
const isExpired = expiry <= today;
|
const isExpired = expiry <= today;
|
||||||
const isProcessed = p.processedUntilExpiry && expiry > today;
|
return isExpired && p.status !== 'valides';
|
||||||
return isExpired && !isProcessed && p.status !== 'valides';
|
|
||||||
}).length
|
}).length
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user