feat: Add rescheduledBy & canceledBy fields in the DB (#15337)
* feat: Add rescheduledBy & canceledBy fields in the DB * fix: type check * fix: type check * fix: use session user email for reschedule * fix: unit test * feat: db field email validation * feat: rescheduledBy and cancelledBy in webhooks * revert unrelated changes. * make session user secondary, default to Anonymous * if condition not required * Make cancelledBy optional Co-authored-by: Syed Ali Shahbaz <[email protected]> * update cancel booking type * fix: update cancelledBy in db when requesting reschedule * remove default value for fields * fix: type check * feat: manage fields via api v1 * fix: add fields in booking read api v1 * test: expand to cover new fields * fix: use cancelledBy param on booking page --------- Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Syed Ali Shahbaz <[email protected]> Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
28 files changed
+139
-20
No files matched your search
+3
@@ -0,0 +1,3 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Booking" ADD COLUMN "cancelledBy" TEXT,
|
||||
ADD COLUMN "rescheduledBy" TEXT;
|
||||
@@ -596,6 +596,10 @@ model Booking {
|
||||
ratingFeedback String?
|
||||
noShowHost Boolean? @default(false)
|
||||
scheduledTriggers WebhookScheduledTriggers[]
|
||||
/// @zod.email()
|
||||
cancelledBy String?
|
||||
/// @zod.email()
|
||||
rescheduledBy String?
|
||||
|
||||
@@index([eventTypeId])
|
||||
@@index([userId])
|
||||
|
||||
@@ -235,6 +235,7 @@ export const bookingCreateBodySchema = z.object({
|
||||
eventTypeSlug: z.string().optional(),
|
||||
rescheduleUid: z.string().optional(),
|
||||
recurringEventId: z.string().optional(),
|
||||
rescheduledBy: z.string().email({ message: "Invalid email" }).optional(),
|
||||
start: z.string(),
|
||||
timeZone: z.string().refine((value: string) => isSupportedTimeZone(value), { message: "Invalid timezone" }),
|
||||
user: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
@@ -319,6 +320,7 @@ export const schemaBookingCancelParams = z.object({
|
||||
allRemainingBookings: z.boolean().optional(),
|
||||
cancellationReason: z.string().optional(),
|
||||
seatReferenceUid: z.string().optional(),
|
||||
cancelledBy: z.string().email({ message: "Invalid email" }).optional(),
|
||||
});
|
||||
|
||||
export const vitalSettingsUpdateSchema = z.object({
|
||||
|
||||
Reference in new issue
Block a user