Files
calendar/packages/lib/bookings/SystemField.ts
T
4407a1952c feat: add booking details sheet for /bookings (#24795)
* spike: initial booking detail sheet

* rename button

* revert some changes

* remove unnecessary test

* disable booking details sheet

---------

Co-authored-by: Eunjae Lee <hey@eunjae.dev>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
2025-11-11 08:40:55 -03:00

36 lines
1.0 KiB
TypeScript

import { z } from "zod";
export const SystemField = z.enum([
"name",
"email",
"location",
"title",
"notes",
"guests",
"rescheduleReason",
"smsReminderNumber",
"attendeePhoneNumber",
"aiAgentCallPhoneNumber",
]);
export const SMS_REMINDER_NUMBER_FIELD = "smsReminderNumber";
export const CAL_AI_AGENT_PHONE_NUMBER_FIELD = "aiAgentCallPhoneNumber";
export const TITLE_FIELD = "title";
/**
* Check if a field should be displayed in custom responses section.
* System fields are filtered out except for SMS_REMINDER_NUMBER_FIELD and TITLE_FIELD
* which don't have dedicated sections in the UI.
*/
export function shouldShowFieldInCustomResponses(fieldName: string): boolean {
const isSystemField = SystemField.safeParse(fieldName);
// Filter out system fields except SMS_REMINDER_NUMBER_FIELD and TITLE_FIELD
// These don't have dedicated sections in the UI
if (isSystemField.success && fieldName !== SMS_REMINDER_NUMBER_FIELD && fieldName !== TITLE_FIELD) {
return false;
}
return true;
}