diff --git a/server/src/db/repositories/_shared/reservation-accommodation.ts b/server/src/db/repositories/_shared/reservation-accommodation.ts index 1b46a7c6e..84343dead 100644 --- a/server/src/db/repositories/_shared/reservation-accommodation.ts +++ b/server/src/db/repositories/_shared/reservation-accommodation.ts @@ -1,4 +1,3 @@ -import { legacyBoundIntegerText } from '../../../nest/common/row-id'; import { integerTextEqualsKysely } from '../../dialect/kysely-functions'; import type { Platform } from '@mikro-orm/core'; @@ -37,5 +36,6 @@ export function reservationStayIs( accommodationId: StringReference, stayId: number, ): ExpressionWrapper { - return eb(accommodationId, '=', legacyBoundIntegerText(stayId)); + // The '.0' shape of row-id.ts's legacyBoundIntegerText, spelled here because src/db sits below src/nest. + return eb(eb.ref(accommodationId).$castTo(), '=', `${stayId}.0`); } diff --git a/server/tests/unit/db/types/integer-flag.type.test.ts b/server/tests/unit/db/types/integer-flag.type.test.ts index fc11ff746..1e18b901d 100644 --- a/server/tests/unit/db/types/integer-flag.type.test.ts +++ b/server/tests/unit/db/types/integer-flag.type.test.ts @@ -23,6 +23,7 @@ describe('IntegerFlagType', () => { expect(flag.convertToJSValue(0)).toBe(false); expect(flag.convertToJSValue(true)).toBe(true); expect(flag.convertToJSValue(null)).toBeNull(); + expect(flag.convertToJSValue(undefined)).toBeUndefined(); }); it('INTFLAG-003: declares the integer column of the platform, which the Postgres schema widens to bigint', () => {