This commit is contained in:
ocroguennec committed 2026-07-12 19:38:41 +02:00
1 parent 47c5ad34fa
commit 316a86c95a
6 files changed
+21 -9

No files matched your search

+3 -1
View File
@@ -102,7 +102,9 @@ router.post('/generate', (req, res, next) => {
const { investissement_id, replace = true } = req.body;
if (!investissement_id) throw new HttpError(400, 'investissement_id required');
const inv = assertOwnedInvestissement(Number(investissement_id), req.user.id);
if (!inv.taux_interet || !inv.duree_mois) {
// taux_interet peut légitimement valoir 0 (ex. révision suite à un arrêt de production) —
// ne pas confondre avec "non renseigné" (null/undefined).
if (inv.taux_interet == null || !inv.duree_mois) {
throw new HttpError(400, 'Investissement requires taux_interet and duree_mois');
}