fix: Standardize email field editable to system-but-optional (#24416)

Change email booking field's editable property from 'system' to
'system-but-optional' across all code paths. This allows email field
to be optional when phone field is required instead.

- Updated systemBeforeFieldEmail in API v2024_06_14 transformers
- Fixed explicit override in API v2024_04_15 service
- Updated test utility to match production behavior
- Ensures consistency with validation logic that requires either
  email OR phone to be visible and required

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Anik Dhabal BabuandDevin AI authored and GitHub committed 2025-10-13 09:19:59 +00:00
1 parent 35d140e0a7
commit b881e025f6
3 files changed
+7 -3

No files matched your search

@@ -137,7 +137,11 @@ export class EventTypesService_2024_04_15 {
!bookingFields.find((field) => field.type === "email") &&
!bookingFields.find((field) => field.type === "phone")
) {
bookingFields.push({ ...systemBeforeFieldEmail, type: BaseField.email, editable: Editable.system });
bookingFields.push({
...systemBeforeFieldEmail,
type: BaseField.email,
editable: Editable.systemButOptional,
});
}
await updateEventType({
@@ -556,7 +556,7 @@ export const systemBeforeFieldEmail: EmailSystemField = {
type: "email",
name: "email",
required: true,
editable: "system",
editable: "system-but-optional",
sources: [
{
label: "Default",