Merged in chore/refactor-trpc-booking-routes (pull request #3510)

feat(BOOK-750): refactor booking endpoints

* WIP

* wip

* wip

* parse dates in UTC

* wip

* no more errors

* Merge branch 'master' of bitbucket.org:scandic-swap/web into chore/refactor-trpc-booking-routes

* .

* cleanup

* import named z from zod

* fix(BOOK-750): updateBooking api endpoint expects dateOnly, we passed ISO date


Approved-by: Anton Gunnarsson
This commit is contained in:
Joakim Jäderberg
2026-02-02 14:28:14 +00:00
parent 8ac2c4ba22
commit 16cc26632e
44 changed files with 1621 additions and 1041 deletions

View File

@@ -9,7 +9,7 @@ import {
import { logger } from "@scandic-hotels/common/logger"
import { getServiceToken } from "@scandic-hotels/common/tokenManager"
import { BookingErrorCodeEnum } from "@scandic-hotels/trpc/enums/bookingErrorCode"
import { getBooking } from "@scandic-hotels/trpc/routers/booking/utils"
import { getBooking } from "@scandic-hotels/trpc/services/booking/getBooking"
import { encrypt } from "@scandic-hotels/trpc/utils/encryption"
import { BookingFlowConfig } from "../bookingFlowConfig/bookingFlowConfig"
@@ -18,7 +18,7 @@ import { HandleSuccessCallback } from "../components/EnterDetails/Payment/Paymen
import { serverClient } from "../trpc"
import type { Lang } from "@scandic-hotels/common/constants/language"
import type { CreateBookingSchema } from "@scandic-hotels/trpc/routers/booking/mutation/create/schema"
import type { BookingStatus } from "@scandic-hotels/trpc/services/booking/getBookingStatus"
import type { NextSearchParams } from "../types"
@@ -99,7 +99,7 @@ export async function PaymentCallbackPage({
notFound()
}
const booking = await getBooking(confirmationNumber, lang, token)
const booking = await getBooking({ confirmationNumber, lang }, token)
const refId = booking?.refId
const caller = await serverClient()
@@ -156,7 +156,7 @@ function HandleBookingStatusError({
config,
status,
}: {
booking: CreateBookingSchema | null
booking: BookingStatus | null
confirmationNumber?: string
returnUrl: string
config: BookingFlowConfig