Merged in feat(SW-1274)-modify-date-my-stay (pull request #1528)

Feat(SW-1274) modify date my stay

* feat(SW-1676): Modify guest details step 1

* feat(SW-1676) Integration to api to update guest details

* feat(SW-1676) Reuse of old modal

* feat(SW-1676) updated modify guest

* feat(SW-1676) cleanup

* feat(SW-1274) modify stay modal and datepicker

* feat(SW-1274) DatePicker from modify dates

* feat(SW-1274) Modify dates fixes and merge conflicts

* feat(SW-1274) handle modify for multiroom

* feat(SW-1274) update manage stay

* feat(SW-1274) fixed some comments

* feat(SW-1274) use Modal instead

* feat(SW-1274) fixed formatChildBedPreferences

* feat(SW-1274) removed any as prop

* feat(SW-1274) fix rebase conflicts

* feat(SW-1274) fix flicker on modify modal

* feat(SW-1274) CalendarButton

* feat(SW-1274) fixed gap variable

* feat(SW-1274) simplified code

* feat(SW-1274) Split up DatePicker on mode

* feat(SW-1274) Updated file structure for datepicker


Approved-by: Arvid Norlin
This commit is contained in:
Pontus Dreij
2025-03-19 13:11:03 +00:00
parent b0aea68ee5
commit fb321cdb13
54 changed files with 1986 additions and 321 deletions

View File

@@ -1,17 +1,27 @@
import { Lang } from "@/constants/languages"
import type { Locale } from "date-fns"
import type { DateRange } from "react-day-picker"
import type { Lang } from "@/constants/languages"
export interface DatePickerFormProps {
name?: string
}
type LangWithoutEn = Lang.da | Lang.de | Lang.fi | Lang.no | Lang.sv
export interface DatePickerProps {
interface DatePickerProps {
close: () => void
handleOnSelect: (selected: Date) => void
locales: Record<LangWithoutEn, Locale>
selectedDate: DateRange | Date
startMonth?: Date
hideHeader?: boolean
}
export interface DatePickerRangeProps extends DatePickerProps {
selectedDate: DateRange
}
export interface DatePickerSingleProps extends DatePickerProps {
selectedDate: Date
}

View File

@@ -18,10 +18,9 @@ export interface CancelStayProps {
hotel: Hotel
setBookingStatus: () => void
handleCloseModal: () => void
handleBackToManageStay: () => void
}
export type FormValues = z.infer<typeof cancelStaySchema>
export type CancelStayFormValues = z.infer<typeof cancelStaySchema>
export interface RoomDetails {
id: string

View File

@@ -0,0 +1,42 @@
import { z } from "zod"
import { Lang } from "@/constants/languages"
import type { BookingConfirmation } from "@/types/trpc/routers/booking/confirmation"
import type { User } from "@/types/user"
export const modifyDateSchema = z.object({
checkInDate: z.string(),
checkOutDate: z.string(),
})
export type ModifyDateSchema = z.infer<typeof modifyDateSchema>
export interface QueryInput {
hotelId: string
roomStayStartDate: string
roomStayEndDate: string
adults: number
children: string
bookingCode: string
rateCode: string
roomTypeCode: string
lang: Lang
}
export const DEFAULT_QUERY_INPUT: QueryInput = {
hotelId: "",
roomStayStartDate: "",
roomStayEndDate: "",
adults: 1,
children: "",
bookingCode: "",
rateCode: "",
roomTypeCode: "",
lang: Lang.en,
}
export interface ModifyStayProps {
booking: BookingConfirmation["booking"]
user: User | null
}