feat(SW-1273): find my booking page with rudimentary validation and redirect
This commit is contained in:
@@ -10,7 +10,12 @@ import {
|
||||
} from "@/server/trpc"
|
||||
|
||||
import { getHotel } from "../hotels/query"
|
||||
import { bookingConfirmationInput, getBookingStatusInput } from "./input"
|
||||
import encryptValue from "../utils/encryptValue"
|
||||
import {
|
||||
bookingConfirmationInput,
|
||||
createRefIdInput,
|
||||
getBookingStatusInput,
|
||||
} from "./input"
|
||||
import { bookingConfirmationSchema, createBookingSchema } from "./output"
|
||||
import { getBookedHotelRoom } from "./utils"
|
||||
|
||||
@@ -228,4 +233,14 @@ export const bookingQueryRouter = router({
|
||||
|
||||
return verifiedData.data
|
||||
}),
|
||||
createRefId: serviceProcedure
|
||||
.input(createRefIdInput)
|
||||
.mutation(async function ({ input }) {
|
||||
const { confirmationNumber, lastName } = input
|
||||
const encryptedRefId = encryptValue(`${confirmationNumber},${lastName}`)
|
||||
|
||||
return {
|
||||
refId: encryptedRefId,
|
||||
}
|
||||
}),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user