Merged in fix/refactor-currency-display (pull request #3434)
fix(SW-3616): Handle EuroBonus point type everywhere * Add tests to formatPrice * formatPrice * More work replacing config with api points type * More work replacing config with api points type * More fixing with currency * maybe actually fixed it * Fix MyStay * Clean up * Fix comments * Merge branch 'master' into fix/refactor-currency-display * Fix calculateTotalPrice for EB points + SF points + cash Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -176,7 +176,11 @@ export const bookingConfirmationSchema = z
|
||||
rateDefinition: rateDefinitionSchema,
|
||||
reservationStatus: z.string().nullable().default(""),
|
||||
roomPoints: z.number(),
|
||||
roomPointType: z.nullable(z.enum(["Scandic", "EuroBonus"])).catch(null),
|
||||
roomPointType: z
|
||||
.enum(["Scandic", "EuroBonus"])
|
||||
.nullable()
|
||||
.default(null)
|
||||
.catch(null),
|
||||
roomPrice: z.number(),
|
||||
roomTypeCode: z.string().default(""),
|
||||
totalPoints: z.number(),
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import {
|
||||
PointType,
|
||||
pointTypes,
|
||||
} from "@scandic-hotels/common/constants/pointType"
|
||||
import { RateTypeEnum } from "@scandic-hotels/common/constants/rateType"
|
||||
import { nullableNumberValidator } from "@scandic-hotels/common/utils/zod/numberValidator"
|
||||
import { nullableStringValidator } from "@scandic-hotels/common/utils/zod/stringValidator"
|
||||
@@ -22,6 +26,10 @@ export const redemptionSchema = z.object({
|
||||
currency: z.nativeEnum(CurrencyEnum).nullish(),
|
||||
pointsPerNight: nullableNumberValidator,
|
||||
pointsPerStay: nullableNumberValidator,
|
||||
pointsType: z
|
||||
.enum(pointTypes as [PointType, ...PointType[]])
|
||||
.nullish()
|
||||
.catch(PointType.SCANDIC),
|
||||
})
|
||||
|
||||
export const priceSchema = z.object({
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
"@types/react": "19.2.7",
|
||||
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
||||
"@typescript-eslint/parser": "^8.32.0",
|
||||
"@typescript/native-preview": "^7.0.0-dev.20251104.1",
|
||||
"dotenv": "^16.5.0",
|
||||
"eslint": "^9",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
|
||||
Reference in New Issue
Block a user