From 27896ed136e941e1037ba576e7281ec71d11a06b Mon Sep 17 00:00:00 2001 From: counterweight Date: Tue, 23 Dec 2025 10:54:04 +0100 Subject: [PATCH] refactor: use shared constants for MIN/MAX_ADVANCE_DAYS - Import constants from shared/constants.json in exchange page - Remove hardcoded values for minAdvanceDays and maxAdvanceDays --- frontend/app/exchange/page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/exchange/page.tsx b/frontend/app/exchange/page.tsx index db94b3a..f93e938 100644 --- a/frontend/app/exchange/page.tsx +++ b/frontend/app/exchange/page.tsx @@ -12,15 +12,15 @@ import { components } from "../generated/api"; import { formatDate, formatTime, getDateRange } from "../utils/date"; import { formatEur } from "../utils/exchange"; import { layoutStyles, typographyStyles, bannerStyles, buttonStyles } from "../styles/shared"; +import constants from "../../../shared/constants.json"; type ExchangePriceResponse = components["schemas"]["ExchangePriceResponse"]; type ExchangeResponse = components["schemas"]["ExchangeResponse"]; type BookableSlot = components["schemas"]["BookableSlot"]; type AvailableSlotsResponse = components["schemas"]["AvailableSlotsResponse"]; -// Constants from shared config (will be fetched from API) -const MIN_ADVANCE_DAYS = 1; -const MAX_ADVANCE_DAYS = 30; +// Constants from shared config +const { minAdvanceDays: MIN_ADVANCE_DAYS, maxAdvanceDays: MAX_ADVANCE_DAYS } = constants.exchange; type Direction = "buy" | "sell"; type WizardStep = "details" | "booking";