Merged in feat/sw-2864-move-hotels-router-to-trpc-package (pull request #2410)
feat (SW-2864): Move booking router to trpc package * Add env to trpc package * Add eslint to trpc package * Apply lint rules * Use direct imports from trpc package * Add lint-staged config to trpc * Move lang enum to common * Restructure trpc package folder structure * WIP first step * update internal imports in trpc * Fix most errors in scandic-web Just 100 left... * Move Props type out of trpc * Fix CategorizedFilters types * Move more schemas in hotel router * Fix deps * fix getNonContentstackUrls * Fix import error * Fix entry error handling * Fix generateMetadata metrics * Fix alertType enum * Fix duplicated types * lint:fix * Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package * Fix broken imports * Move booking router to trpc package * Merge branch 'master' into feat/sw-2864-move-hotels-router-to-trpc-package Approved-by: Linus Flood
This commit is contained in:
32
apps/scandic-web/types/auth.d.ts
vendored
32
apps/scandic-web/types/auth.d.ts
vendored
@@ -1,32 +0,0 @@
|
||||
import type { JWT } from "next-auth/jwt"
|
||||
|
||||
import type { RefreshTokenError } from "./authError"
|
||||
|
||||
// Module augmentation
|
||||
// https://authjs.dev/getting-started/typescript#popular-interfaces-to-augment
|
||||
declare module "next-auth" {
|
||||
/**
|
||||
* The shape of the account object returned in the OAuth providers' `account` callback,
|
||||
* Usually contains information about the provider being used, like OAuth tokens (`access_token`, etc).
|
||||
*/
|
||||
interface Account {}
|
||||
|
||||
/**
|
||||
* Returned by `useSession`, `auth`, contains information about the active session.
|
||||
*/
|
||||
interface Session extends RefreshTokenError {
|
||||
token: JWT
|
||||
employeeId?: string | null
|
||||
}
|
||||
|
||||
/**
|
||||
* The shape of the user object returned in the OAuth providers' `profile` callback,
|
||||
* or the second parameter of the `session` callback, when using a database.
|
||||
*/
|
||||
interface User {
|
||||
given_name: string
|
||||
sub: string
|
||||
email?: string
|
||||
login_with: string
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export interface RefreshTokenError {
|
||||
error?: "RefreshAccessTokenError"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Child } from "../hotelReservation/selectRate/selectRate"
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
|
||||
export type ChildBed = {
|
||||
label: string
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { Image } from "@scandic-hotels/trpc/types/image"
|
||||
import type { User } from "@scandic-hotels/trpc/types/user"
|
||||
|
||||
import type {
|
||||
CurrentHeaderLink,
|
||||
TopMenuHeaderLink,
|
||||
} from "@/types/requests/currentHeader"
|
||||
import type { User } from "@/types/user"
|
||||
|
||||
export type MainMenuProps = {
|
||||
frontpageLinkText: string
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { meetingRoomsSchema } from "@scandic-hotels/trpc/routers/hotels/schemas/meetingRoom"
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { meetingRoomsSchema } from "@/server/routers/hotels/schemas/meetingRoom"
|
||||
|
||||
export type MeetingRoomData = z.output<typeof meetingRoomsSchema>
|
||||
export type MeetingRooms = MeetingRoomData["data"]
|
||||
export type MeetingRoom = MeetingRooms[number]["attributes"]
|
||||
|
||||
@@ -4,24 +4,6 @@ import type {
|
||||
bedTypeFormSchema,
|
||||
bedTypeSchema,
|
||||
} from "@/components/HotelReservation/EnterDetails/BedType/schema"
|
||||
import type { BedTypeEnum, ExtraBedTypeEnum } from "@/constants/booking"
|
||||
|
||||
export type BedTypeSelection = {
|
||||
description: string
|
||||
size: {
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
value: string
|
||||
type: BedTypeEnum
|
||||
roomsLeft: number
|
||||
extraBed:
|
||||
| {
|
||||
description: string
|
||||
type: ExtraBedTypeEnum
|
||||
}
|
||||
| undefined
|
||||
}
|
||||
|
||||
export interface BedTypeFormSchema extends z.output<typeof bedTypeFormSchema> {}
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import type { productTypePointsSchema } from "@scandic-hotels/trpc/routers/hotels/schemas/productTypePrice"
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type { PackageEnum } from "@scandic-hotels/trpc/types/packages"
|
||||
import type { Product } from "@scandic-hotels/trpc/types/roomAvailability"
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { PackageEnum } from "@/types/requests/packages"
|
||||
import type { Product } from "@scandic-hotels/trpc/types/roomAvailability"
|
||||
import type { SafeUser } from "@/types/user"
|
||||
import type { getMultiroomDetailsSchema } from "@/components/HotelReservation/EnterDetails/Details/Multiroom/schema"
|
||||
import type {
|
||||
guestDetailsSchema,
|
||||
signedInDetailsSchema,
|
||||
} from "@/components/HotelReservation/EnterDetails/Details/RoomOne/schema"
|
||||
import type { productTypePointsSchema } from "@scandic-hotels/trpc/routers/hotels/schemas/productTypePrice"
|
||||
import type { BookingSearchType } from "../booking"
|
||||
import type { Price } from "../price"
|
||||
import type { Child } from "../selectRate/selectRate"
|
||||
|
||||
export type DetailsSchema = z.output<typeof guestDetailsSchema>
|
||||
export type MultiroomDetailsSchema = z.output<
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
|
||||
|
||||
import type { CreditCard } from "@/types/user"
|
||||
import type { CreditCard } from "@scandic-hotels/trpc/types/user"
|
||||
|
||||
export interface PaymentProps {
|
||||
otherPaymentOptions: PaymentMethodEnum[]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { ProductType } from "@scandic-hotels/trpc/types/availability"
|
||||
import type { Hotel } from "@scandic-hotels/trpc/types/hotel"
|
||||
import type { ProductType } from "@/types/trpc/routers/hotel/availability"
|
||||
|
||||
import type { HotelResponse } from "@/components/HotelReservation/SelectHotel/helpers"
|
||||
|
||||
export enum HotelCardListingTypeEnum {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { imageSchema } from "@scandic-hotels/trpc/routers/hotels/schemas/image"
|
||||
import type { ProductTypeCheque } from "@scandic-hotels/trpc/types/availability"
|
||||
import type { Amenities } from "@scandic-hotels/trpc/types/hotel"
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { Coordinates } from "@/types/components/maps/coordinates"
|
||||
import type { ProductTypeCheque } from "@/types/trpc/routers/hotel/availability"
|
||||
import type { HotelResponse } from "@/components/HotelReservation/SelectHotel/helpers"
|
||||
import type { CategorizedHotelFilters } from "./hotelFilters"
|
||||
import type { SelectHotelBooking } from "./selectHotel"
|
||||
|
||||
@@ -2,7 +2,7 @@ import type {
|
||||
ProductTypeCheque,
|
||||
ProductTypePrices,
|
||||
ProductTypeVoucher,
|
||||
} from "@/types/trpc/routers/hotel/availability"
|
||||
} from "@scandic-hotels/trpc/types/availability"
|
||||
|
||||
export type PriceCardProps = {
|
||||
productTypePrices: ProductTypePrices
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type { Hotel } from "@scandic-hotels/trpc/types/hotel"
|
||||
|
||||
import type { BookingSearchType } from "../booking"
|
||||
import type { Child } from "../selectRate/selectRate"
|
||||
import type { SidePeekEnum } from "../sidePeek"
|
||||
|
||||
export interface ReadMoreProps {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Package } from "@/types/requests/packages"
|
||||
import type { Package } from "@scandic-hotels/trpc/types/packages"
|
||||
import type { RoomConfiguration } from "@scandic-hotels/trpc/types/roomAvailability"
|
||||
|
||||
export type RoomListItemProps = {
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
import type { ChildBedMapEnum } from "@scandic-hotels/trpc/enums/childBedMapEnum"
|
||||
import type { RateEnum } from "@scandic-hotels/trpc/enums/rate"
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type { PackageEnum, Packages } from "@scandic-hotels/trpc/types/packages"
|
||||
import type {
|
||||
Product,
|
||||
RoomConfiguration,
|
||||
} from "@scandic-hotels/trpc/types/roomAvailability"
|
||||
|
||||
import type { PackageEnum, Packages } from "@/types/requests/packages"
|
||||
import type { BookingSearchType } from "../booking"
|
||||
|
||||
export interface Child {
|
||||
bed: ChildBedMapEnum
|
||||
age: number
|
||||
}
|
||||
|
||||
export interface Room {
|
||||
adults: number
|
||||
childrenInRoom?: Child[]
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import type { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import type { Packages } from "@/types/requests/packages"
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type { Packages } from "@scandic-hotels/trpc/types/packages"
|
||||
|
||||
import type { RoomState } from "@/types/stores/enter-details"
|
||||
import type {
|
||||
DetailsBooking,
|
||||
@@ -7,7 +9,7 @@ import type {
|
||||
RoomRate,
|
||||
} from "./enterDetails/details"
|
||||
import type { Price } from "./price"
|
||||
import type { Child, SelectRateBooking } from "./selectRate/selectRate"
|
||||
import type { SelectRateBooking } from "./selectRate/selectRate"
|
||||
|
||||
export type RoomsData = {
|
||||
rateDetails: string[] | undefined
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { User } from "@/types/user"
|
||||
import type { User } from "@scandic-hotels/trpc/types/user"
|
||||
|
||||
export interface FriendProps
|
||||
extends React.PropsWithChildren<Pick<User, "membership" | "name">> {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { User } from "@scandic-hotels/trpc/types/user"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { User } from "@/types/user"
|
||||
import type { membershipNumberVariants } from "@/components/Blocks/DynamicContent/Overview/Friend/MembershipNumber/membershipNumberVariants"
|
||||
|
||||
export interface MembershipNumberProps
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CreditCard } from "@/types/user"
|
||||
import type { CreditCard } from "@scandic-hotels/trpc/types/user"
|
||||
|
||||
export type CreditCardRowProps = {
|
||||
card: CreditCard
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { User } from "@/types/user"
|
||||
import type { User } from "@scandic-hotels/trpc/types/user"
|
||||
|
||||
export type EditFormProps = {
|
||||
user: User
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { Room } from "@/types/stores/my-stay"
|
||||
import type { CreditCard, User } from "@/types/user"
|
||||
import type {
|
||||
ancillaryPackagesSchema,
|
||||
packagesSchema,
|
||||
} from "@scandic-hotels/trpc/routers/hotels/output"
|
||||
import type { CreditCard, User } from "@scandic-hotels/trpc/types/user"
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { Room } from "@/types/stores/my-stay"
|
||||
|
||||
export type Ancillaries = z.output<typeof ancillaryPackagesSchema>
|
||||
export type Ancillary = Ancillaries[number]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { User } from "@/types/user"
|
||||
import type { User } from "@scandic-hotels/trpc/types/user"
|
||||
|
||||
import type { userQueryRouter } from "@/server/routers/user/query"
|
||||
|
||||
export type UserQueryRouter = typeof userQueryRouter
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import type { MembershipLevel } from "@scandic-hotels/common/constants/membershipLevels"
|
||||
import type { RateEnum } from "@scandic-hotels/trpc/enums/rate"
|
||||
import type { LoginType } from "@scandic-hotels/trpc/types/loginType"
|
||||
|
||||
export enum TrackingChannelEnum {
|
||||
"scandic-friends" = "scandic-friends",
|
||||
@@ -31,14 +32,6 @@ export type TrackingSDKPageData = {
|
||||
sessionId?: string | null
|
||||
}
|
||||
|
||||
export enum LoginTypeEnum {
|
||||
email = "email",
|
||||
"membership number" = "membership number",
|
||||
"email link" = "email link",
|
||||
"dtmc" = "dtmc",
|
||||
}
|
||||
export type LoginType = keyof typeof LoginTypeEnum
|
||||
|
||||
export type TrackingSDKUserData =
|
||||
| {
|
||||
loginStatus: "logged in"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Package } from "@/types/requests/packages"
|
||||
import type { Package } from "@scandic-hotels/trpc/types/packages"
|
||||
|
||||
import type { RatesState, SelectedRoom } from "@/types/stores/rates"
|
||||
|
||||
export interface RoomContextValue extends Omit<SelectedRoom, "actions"> {
|
||||
|
||||
19
apps/scandic-web/types/jwt.d.ts
vendored
19
apps/scandic-web/types/jwt.d.ts
vendored
@@ -1,19 +0,0 @@
|
||||
import type { DefaultJWT } from "next-auth/jwt"
|
||||
|
||||
import type { RefreshTokenError } from "./authError"
|
||||
import type { LoginType } from "./components/tracking"
|
||||
|
||||
// Module augmentation
|
||||
// https://authjs.dev/getting-started/typescript#popular-interfaces-to-augment
|
||||
declare module "next-auth/jwt" {
|
||||
/** Returned by the `jwt` callback and `auth`, when using JWT sessions */
|
||||
interface JWT extends DefaultJWT, RefreshTokenError {
|
||||
access_token: string
|
||||
expires_at?: number
|
||||
loginType: LoginType
|
||||
mfa_expires_at?: number
|
||||
mfa_scope?: boolean
|
||||
refresh_token?: string
|
||||
employeeId?: string
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,4 @@
|
||||
import type { RateEnum } from "@scandic-hotels/trpc/enums/rate"
|
||||
|
||||
import type { BedTypeSelection } from "@/types/components/hotelReservation/enterDetails/bedType"
|
||||
import type { RoomRate } from "@/types/components/hotelReservation/enterDetails/details"
|
||||
import type { Package } from "@/types/requests/packages"
|
||||
|
||||
export interface Room {
|
||||
bedTypes: BedTypeSelection[]
|
||||
breakfastIncluded: boolean
|
||||
cancellationRule: string
|
||||
cancellationText: string
|
||||
mustBeGuaranteed: boolean
|
||||
memberMustBeGuaranteed: boolean | undefined
|
||||
packages: Package[]
|
||||
rate: RateEnum
|
||||
rateDefinitionTitle: string
|
||||
rateDetails: string[]
|
||||
memberRateDetails: string[] | undefined
|
||||
rateTitle: string | undefined
|
||||
rateType: string
|
||||
roomRate: RoomRate
|
||||
roomType: string
|
||||
roomTypeCode: string
|
||||
isAvailable: boolean
|
||||
isFlexRate: boolean
|
||||
}
|
||||
import type { Room } from "@scandic-hotels/trpc/types/room"
|
||||
|
||||
export interface RoomProviderProps extends React.PropsWithChildren {
|
||||
idx: number
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Room } from "@/types/providers/details/room"
|
||||
import type { Room } from "@scandic-hotels/trpc/types/room"
|
||||
|
||||
import type { SafeUser } from "@/types/user"
|
||||
import type { Lang } from "@/constants/routes/hotelReservation"
|
||||
import type { BreakfastPackages } from "../components/hotelReservation/breakfast"
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import type { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast"
|
||||
import type { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
|
||||
import type {
|
||||
ancillaryPackageInputSchema,
|
||||
breakfastPackageInputSchema,
|
||||
roomPackagesInputSchema,
|
||||
} from "@scandic-hotels/trpc/routers/hotels/input"
|
||||
import type { packagesSchema } from "@scandic-hotels/trpc/routers/hotels/output"
|
||||
import type { z } from "zod"
|
||||
|
||||
export interface BreackfastPackagesInput
|
||||
extends z.input<typeof breakfastPackageInputSchema> {}
|
||||
|
||||
export interface AncillaryPackagesInput
|
||||
extends z.input<typeof ancillaryPackageInputSchema> {}
|
||||
|
||||
export interface PackagesInput
|
||||
extends z.input<typeof roomPackagesInputSchema> {}
|
||||
|
||||
export interface PackagesOutput
|
||||
extends z.output<typeof roomPackagesInputSchema> {}
|
||||
|
||||
export type Packages = z.output<typeof packagesSchema>
|
||||
export type Package = NonNullable<Packages>[number]
|
||||
|
||||
export type PackageEnum = BreakfastPackageEnum | RoomPackageCodeEnum
|
||||
@@ -1,11 +1,13 @@
|
||||
import type { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import type { BedTypeSelection } from "@scandic-hotels/trpc/types/bedTypeSelection"
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type { Packages } from "@scandic-hotels/trpc/types/packages"
|
||||
|
||||
import type {
|
||||
BreakfastPackage,
|
||||
BreakfastPackages,
|
||||
} from "@/types/components/hotelReservation/breakfast"
|
||||
import type {
|
||||
BedTypeSchema,
|
||||
BedTypeSelection,
|
||||
} from "@/types/components/hotelReservation/enterDetails/bedType"
|
||||
import type { BedTypeSchema } from "@/types/components/hotelReservation/enterDetails/bedType"
|
||||
import type {
|
||||
DetailsBooking,
|
||||
DetailsSchema,
|
||||
@@ -14,11 +16,8 @@ import type {
|
||||
RoomRate,
|
||||
SignedInDetailsSchema,
|
||||
} from "@/types/components/hotelReservation/enterDetails/details"
|
||||
import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import type { StepEnum } from "@/types/enums/step"
|
||||
import type { Price } from "../components/hotelReservation/price"
|
||||
import type { CurrencyEnum } from "../../../../packages/common/constants/currency"
|
||||
import type { Packages } from "../requests/packages"
|
||||
|
||||
export interface InitialRoomData {
|
||||
// used when there is only one bedtype to preselect it
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type {
|
||||
Hotel,
|
||||
Room as HotelRoom,
|
||||
RoomCategories,
|
||||
} from "@scandic-hotels/trpc/types/hotel"
|
||||
import type { CreditCard } from "@scandic-hotels/trpc/types/user"
|
||||
import type { IntlShape } from "react-intl"
|
||||
|
||||
import type { BreakfastPackage } from "@/types/components/hotelReservation/breakfast"
|
||||
import type { BedTypeSchema } from "@/types/components/hotelReservation/enterDetails/bedType"
|
||||
import type { RoomPrice } from "@/types/components/hotelReservation/enterDetails/details"
|
||||
import type { PriceTypeEnum } from "@/types/components/hotelReservation/myStay/myStay"
|
||||
import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import type { Packages } from "@/types/components/myPages/myStay/ancillaries"
|
||||
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
|
||||
import type { CreditCard } from "@/types/user"
|
||||
|
||||
export type Room = Omit<
|
||||
BookingConfirmation["booking"],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import type { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
|
||||
import type { Room } from "@scandic-hotels/trpc/types/hotel"
|
||||
import type { Package, PackageEnum } from "@scandic-hotels/trpc/types/packages"
|
||||
import type {
|
||||
Product,
|
||||
RoomConfiguration,
|
||||
@@ -12,7 +13,6 @@ import type {
|
||||
Room as RoomBooking,
|
||||
SelectRateBooking,
|
||||
} from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import type { Package, PackageEnum } from "@/types/requests/packages"
|
||||
import type { BookingCodeFilterEnum } from "../enums/bookingCodeFilter"
|
||||
|
||||
export interface AvailabilityError {
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
import type {
|
||||
enterDetailsRoomsAvailabilityInputSchema,
|
||||
getHotelsByHotelIdsAvailabilityInputSchema,
|
||||
hotelsAvailabilityInputSchema,
|
||||
selectRateRoomsAvailabilityInputSchema,
|
||||
} from "@scandic-hotels/trpc/routers/hotels/input"
|
||||
import type { hotelsAvailabilitySchema } from "@scandic-hotels/trpc/routers/hotels/output"
|
||||
import type { productTypeSchema } from "@scandic-hotels/trpc/routers/hotels/schemas/availability/productType"
|
||||
import type {
|
||||
productTypeCorporateChequeSchema,
|
||||
productTypePointsSchema,
|
||||
productTypePriceSchema,
|
||||
productTypeVoucherSchema,
|
||||
} from "@scandic-hotels/trpc/routers/hotels/schemas/productTypePrice"
|
||||
import type { z } from "zod"
|
||||
|
||||
export type HotelsAvailability = z.output<typeof hotelsAvailabilitySchema>
|
||||
export type HotelsAvailabilityInputSchema = z.output<
|
||||
typeof hotelsAvailabilityInputSchema
|
||||
>
|
||||
export type HotelsByHotelIdsAvailabilityInputSchema = z.output<
|
||||
typeof getHotelsByHotelIdsAvailabilityInputSchema
|
||||
>
|
||||
export type RoomsAvailabilityInputSchema = z.input<
|
||||
typeof selectRateRoomsAvailabilityInputSchema
|
||||
>
|
||||
export type RoomsAvailabilityOutputSchema = z.output<
|
||||
typeof selectRateRoomsAvailabilityInputSchema
|
||||
>
|
||||
export type RoomsAvailabilityInputRoom =
|
||||
RoomsAvailabilityInputSchema["booking"]["rooms"][number]
|
||||
export type RoomsAvailabilityExtendedInputSchema = z.input<
|
||||
typeof enterDetailsRoomsAvailabilityInputSchema
|
||||
>
|
||||
|
||||
export type ProductType = z.output<typeof productTypeSchema>
|
||||
export type ProductTypePrices = z.output<typeof productTypePriceSchema>
|
||||
export type ProductTypePoints = z.output<typeof productTypePointsSchema>
|
||||
export type ProductTypeVoucher = z.output<typeof productTypeVoucherSchema>
|
||||
export type ProductTypeCheque = z.output<
|
||||
typeof productTypeCorporateChequeSchema
|
||||
>
|
||||
|
||||
export type HotelsAvailabilityItem =
|
||||
HotelsAvailability["data"][number]["attributes"]
|
||||
@@ -1,32 +1,3 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { RouterOutput } from "@/lib/trpc/client"
|
||||
import type {
|
||||
creditCardSchema,
|
||||
friendsMembershipSchema,
|
||||
getUserSchema,
|
||||
sasMembershipSchema,
|
||||
userLoyaltySchema,
|
||||
} from "@/server/routers/user/output"
|
||||
import type { getFriendsMembership } from "@/utils/user"
|
||||
|
||||
/**
|
||||
* All extended field needs to be added by API team to response or
|
||||
* we have to get the values from elsewhere
|
||||
*/
|
||||
export interface User extends z.output<typeof getUserSchema> {}
|
||||
|
||||
export type SafeUser = RouterOutput["user"]["getSafely"]
|
||||
|
||||
export type CreditCard = z.output<typeof creditCardSchema>
|
||||
|
||||
export type UserLoyalty = z.output<typeof userLoyaltySchema>
|
||||
|
||||
export type Membership = UserLoyalty["memberships"][number]
|
||||
export type NativeFriendsMembership = z.output<typeof friendsMembershipSchema>
|
||||
export type EurobonusMembership = z.output<typeof sasMembershipSchema>
|
||||
|
||||
export type FriendsMembership = ReturnType<typeof getFriendsMembership>
|
||||
|
||||
export type EurobonusTier = EurobonusMembership["tier"]
|
||||
export type FriendsTier = NativeFriendsMembership["tier"]
|
||||
|
||||
Reference in New Issue
Block a user