From d616621bb6ed09266930a486f66429324c40487d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 12 Aug 2026 16:54:09 -0400 Subject: [PATCH] =?UTF-8?q?The=20issue=20was=20the=20serializer=E2=80=99s?= =?UTF-8?q?=20return=20type=20claimed=20it=20returned=20the=20original=20g?= =?UTF-8?q?eneric=20T,=20but=20the=20implementation=20intentionally=20remo?= =?UTF-8?q?ves=20reviewToken=20and=20rewrites=20customer.licenseImageUrl.?= =?UTF-8?q?=20I=20updated=20the=20return=20type=20to=20model=20the=20actua?= =?UTF-8?q?l=20serialized=20dashboard=20payload:=20Omit=20plus=20the=20normalized=20customer=20and?= =?UTF-8?q?=20computed=20fields.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reservations/reservation.presenter.ts | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/apps/api/src/modules/reservations/reservation.presenter.ts b/apps/api/src/modules/reservations/reservation.presenter.ts index b7c651c..d11cae2 100644 --- a/apps/api/src/modules/reservations/reservation.presenter.ts +++ b/apps/api/src/modules/reservations/reservation.presenter.ts @@ -124,6 +124,25 @@ export function buildBookingRequestProgress(reservation: { } } +type DashboardReservationCustomer = { + id: string + driverLicense?: string | null + dateOfBirth?: Date | null + address?: unknown + licenseImageUrl?: string | null + licenseValidationStatus?: string | null +} + +type SerializedDashboardReservation = Omit & { + customer?: DashboardReservationCustomer | null + paymentMode: string | null + spareWheel: boolean + radioCd: boolean + contractFields: Record + workflow: ReturnType + bookingRequest: ReturnType +} + export function serializeReservationForDashboard(reservation: T): T & { - paymentMode: string | null - spareWheel: boolean - radioCd: boolean - contractFields: Record - workflow: ReturnType - bookingRequest: ReturnType -} { + customer?: DashboardReservationCustomer | null +}>(reservation: T): SerializedDashboardReservation { const extras = parseReservationExtras(reservation.extras) const contractFields = serializeContractFields(extras.contractFields) const customer = @@ -160,10 +165,14 @@ export function serializeReservationForDashboard), ...(customer !== undefined ? { customer } : {}), paymentMode: typeof extras.paymentMode === 'string' ? extras.paymentMode : null, spareWheel: typeof extras.spareWheel === 'boolean' ? extras.spareWheel : false,