diff --git a/backend/src/db/schema.sql b/backend/src/db/schema.sql index 1dc8e241..354a294d 100644 --- a/backend/src/db/schema.sql +++ b/backend/src/db/schema.sql @@ -2794,7 +2794,7 @@ CREATE TABLE IF NOT EXISTS marketing_live_activity_settings ( cache_ttl_seconds INT NOT NULL DEFAULT 12 CHECK (cache_ttl_seconds > 0), max_synthetic_withdrawals INT NOT NULL DEFAULT 12 CHECK (max_synthetic_withdrawals >= 0 AND max_synthetic_withdrawals <= 100), synthetic_withdrawal_amounts INT[] NOT NULL DEFAULT ARRAY[20,35,50,80,100,120,200,250,300,450,500,800], - withdrawal_real_window_hours INT NOT NULL DEFAULT 48 CHECK (withdrawal_real_window_hours > 0 AND withdrawal_real_window_hours <= 720), + withdrawal_real_window_hours INT NOT NULL DEFAULT 48 CHECK (withdrawal_real_window_hours > 0), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); @@ -2839,7 +2839,19 @@ BEGIN ) THEN ALTER TABLE marketing_live_activity_settings ADD COLUMN withdrawal_real_window_hours INT NOT NULL DEFAULT 48 - CHECK (withdrawal_real_window_hours > 0 AND withdrawal_real_window_hours <= 720); + CHECK (withdrawal_real_window_hours > 0); + END IF; + -- Drop legacy upper bound (<= 720) if present so admins can set any positive hours. + IF EXISTS ( + SELECT 1 FROM pg_constraint + WHERE conrelid = 'public.marketing_live_activity_settings'::regclass + AND conname = 'marketing_live_activity_settings_withdrawal_real_window_hours_check' + ) THEN + ALTER TABLE marketing_live_activity_settings + DROP CONSTRAINT marketing_live_activity_settings_withdrawal_real_window_hours_check; + ALTER TABLE marketing_live_activity_settings + ADD CONSTRAINT marketing_live_activity_settings_withdrawal_real_window_hours_check + CHECK (withdrawal_real_window_hours > 0); END IF; END $$; diff --git a/backend/src/validation/adminResourceSchemas.ts b/backend/src/validation/adminResourceSchemas.ts index 8e8fa4a0..853d4f1b 100644 --- a/backend/src/validation/adminResourceSchemas.ts +++ b/backend/src/validation/adminResourceSchemas.ts @@ -250,7 +250,7 @@ export const marketingLiveActivitySettingsBodySchema = atLeastOneField( .min(1) .max(50) .optional(), - withdrawalRealWindowHours: z.number().int().positive().max(720).optional(), + withdrawalRealWindowHours: z.number().int().positive().optional(), }) ); diff --git a/prediqo_web/src/shared/i18n/locales/en.ts b/prediqo_web/src/shared/i18n/locales/en.ts index 704239f3..fe4b3f57 100644 --- a/prediqo_web/src/shared/i18n/locales/en.ts +++ b/prediqo_web/src/shared/i18n/locales/en.ts @@ -2189,7 +2189,7 @@ export const en = { 'Cap of fictive rows added to the withdrawals feed (0–100). Same enable/threshold as Live Activity.', withdrawalRealWindowHours: 'Real withdrawals window (hours)', withdrawalRealWindowHoursHelper: - 'Only show real completed payouts newer than this (default 48). Older ones drop out so the feed can rotate with synthetics.', + 'Only show real completed payouts newer than this many hours (default 48). No upper cap — older ones drop out so the feed can rotate with synthetics.', syntheticWithdrawalAmounts: 'Withdrawal amounts', syntheticWithdrawalAmountsHelper: 'Comma-separated display amounts (e.g. 20, 35, 50, 100). Rotated across active personas.', diff --git a/prediqo_web/src/shared/i18n/locales/fr.ts b/prediqo_web/src/shared/i18n/locales/fr.ts index 270c5592..0f975100 100644 --- a/prediqo_web/src/shared/i18n/locales/fr.ts +++ b/prediqo_web/src/shared/i18n/locales/fr.ts @@ -2209,7 +2209,7 @@ export const fr = { 'Plafond de lignes fictives ajoutées au feed retraits (0–100). Même activation/seuil que Live Activity.', withdrawalRealWindowHours: 'Fenêtre retraits réels (heures)', withdrawalRealWindowHoursHelper: - 'N’afficher que les vrais retraits completed plus récents que cette durée (défaut 48 h). Les plus anciens sortent pour laisser tourner les fictifs.', + 'N’afficher que les vrais retraits completed plus récents que ce nombre d’heures (défaut 48). Pas de plafond — les plus anciens sortent pour laisser tourner les fictifs.', syntheticWithdrawalAmounts: 'Montants de retraits', syntheticWithdrawalAmountsHelper: 'Montants affichés séparés par des virgules (ex. 20, 35, 50, 100). Rotation sur les personas actifs.',