Save reminderPhone to DB
parent
17e025f3c2
commit
46d893768d
|
@ -215,6 +215,7 @@ const BookingPage = (props: BookingPageProps) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const bookEvent = (booking: BookingFormValues) => {
|
const bookEvent = (booking: BookingFormValues) => {
|
||||||
|
console.log("🚀 ~ file: BookingPage.tsx ~ line 218 ~ bookEvent ~ booking", booking);
|
||||||
telemetry.withJitsu((jitsu) =>
|
telemetry.withJitsu((jitsu) =>
|
||||||
jitsu.track(telemetryEventTypes.bookingConfirmed, collectPageParameters())
|
jitsu.track(telemetryEventTypes.bookingConfirmed, collectPageParameters())
|
||||||
);
|
);
|
||||||
|
@ -481,7 +482,7 @@ const BookingPage = (props: BookingPageProps) => {
|
||||||
<PhoneInput
|
<PhoneInput
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
control={bookingForm.control}
|
control={bookingForm.control}
|
||||||
name="phone"
|
name="reminderPhone"
|
||||||
placeholder={t("enter_phone_number")}
|
placeholder={t("enter_phone_number")}
|
||||||
id="reminderPhone"
|
id="reminderPhone"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -55,6 +55,7 @@ export interface CalendarEvent {
|
||||||
destinationCalendar?: DestinationCalendar | null;
|
destinationCalendar?: DestinationCalendar | null;
|
||||||
cancellationReason?: string | null;
|
cancellationReason?: string | null;
|
||||||
rejectionReason?: string | null;
|
rejectionReason?: string | null;
|
||||||
|
reminderPhone?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IntegrationCalendar extends Ensure<Partial<SelectedCalendar>, "externalId"> {
|
export interface IntegrationCalendar extends Ensure<Partial<SelectedCalendar>, "externalId"> {
|
||||||
|
|
|
@ -50,6 +50,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
const reqBody = req.body as BookingConfirmBody;
|
const reqBody = req.body as BookingConfirmBody;
|
||||||
|
console.log("🚀 ~ file: confirm.ts ~ line 53 ~ handler ~ reqBody", reqBody);
|
||||||
const bookingId = reqBody.id;
|
const bookingId = reqBody.id;
|
||||||
|
|
||||||
if (!bookingId) {
|
if (!bookingId) {
|
||||||
|
|
|
@ -232,6 +232,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
currency: true,
|
currency: true,
|
||||||
metadata: true,
|
metadata: true,
|
||||||
destinationCalendar: true,
|
destinationCalendar: true,
|
||||||
|
attendeeReminders: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -342,6 +343,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
location: reqBody.location, // Will be processed by the EventManager later.
|
location: reqBody.location, // Will be processed by the EventManager later.
|
||||||
/** For team events, we will need to handle each member destinationCalendar eventually */
|
/** For team events, we will need to handle each member destinationCalendar eventually */
|
||||||
destinationCalendar: eventType.destinationCalendar || users[0].destinationCalendar,
|
destinationCalendar: eventType.destinationCalendar || users[0].destinationCalendar,
|
||||||
|
reminderPhone: reqBody.reminderPhone,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (eventType.schedulingType === SchedulingType.COLLECTIVE) {
|
if (eventType.schedulingType === SchedulingType.COLLECTIVE) {
|
||||||
|
@ -406,6 +408,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
connect: { id: evt.destinationCalendar.id },
|
connect: { id: evt.destinationCalendar.id },
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
reminderPhone: evt.reminderPhone,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,6 +254,7 @@ model Booking {
|
||||||
cancellationReason String?
|
cancellationReason String?
|
||||||
rejectionReason String?
|
rejectionReason String?
|
||||||
reminderPhone String?
|
reminderPhone String?
|
||||||
|
attendeeReminder AttendeeReminder?
|
||||||
}
|
}
|
||||||
|
|
||||||
model Schedule {
|
model Schedule {
|
||||||
|
@ -325,6 +326,16 @@ model EventTypeAttendeeReminder {
|
||||||
time Int
|
time Int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model AttendeeReminder {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
bookingId Int @unique
|
||||||
|
booking Booking @relation(fields: [bookingId], references: [id])
|
||||||
|
method String
|
||||||
|
referenceId Int
|
||||||
|
scheduledFor DateTime
|
||||||
|
sent Boolean
|
||||||
|
}
|
||||||
|
|
||||||
model ResetPasswordRequest {
|
model ResetPasswordRequest {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
|
|
Loading…
Reference in New Issue