From 20971e53c0e54b01690d4bccab862994f9ce562c Mon Sep 17 00:00:00 2001 From: Guillermo Pages Date: Sat, 8 Nov 2025 22:31:00 +0100 Subject: [PATCH] fix(api): update policies type and materialisation endpoint URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per Backend Brooke messages: - Made BookingDetail.policies required (commit 75c8edf deployed) - Fixed materialisation endpoint: /materialisation-trigger → /slot-materialize - CORS headers fix deploying on backend (X-Idempotency-Key, If-Match, If-None-Match) Artifacts: src/types/bookings.ts:69-73, src/lib/api/materialisation.ts:91 --- src/lib/api/materialisation.ts | 2 +- src/types/bookings.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/api/materialisation.ts b/src/lib/api/materialisation.ts index 39d7a02..36f6888 100644 --- a/src/lib/api/materialisation.ts +++ b/src/lib/api/materialisation.ts @@ -88,7 +88,7 @@ export async function triggerMaterialisation( } try { - const response = await fetch(`${API_BASE_URL}/admin/clubs/${clubId}/materialisation-trigger`, { + const response = await fetch(`${API_BASE_URL}/admin/clubs/${clubId}/slot-materialize`, { method: 'POST', credentials: 'include', headers: { diff --git a/src/types/bookings.ts b/src/types/bookings.ts index 4ea71c0..02f5429 100644 --- a/src/types/bookings.ts +++ b/src/types/bookings.ts @@ -66,11 +66,10 @@ export interface BookingDetail { updated_at: string; // ISO 8601 provider?: ProviderInfo; etag?: string; // from ETag response header - // Optional policy fields (if backend adds them) - policies?: { - cancel_grace_minutes?: number; - cancel_grace_anchor?: 'start' | 'end'; - move_window_days?: number; + policies: { + cancel_grace_minutes: number; // default: 15 + cancel_grace_anchor: 'start' | 'end'; // current: 'start' + move_window_days: number; // default: 14, 0 = no limit }; }