refactor: v2 and atoms booking fields (#16685)

* refactor: define inputs and outputs by separating default and custom fields

* refactor: event type api <-> internal transformers

* refactor: v2 use refactored libraries to transform input and output booking fields

* refactor: dont allow custom slugs with default reserved slugs

* refactor: input service store only specific default system fields

* refactor: atoms display only specific default system fields

* refactor: delete unused system field constants

* fix: tests

* fix: old event types

* fix: imports

* fix: import

* chore: release libraries and use v2 with them

* fix: unit tests

* refactor: push email in case of missing phone

* refactor: satisfies check for event-type locations
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2024-09-18 13:59:31 +02:00
1 parent 2b43d9a716
commit 5b5a42e72d
34 files changed
+7108 -1187

No files matched your search

+3
View File
@@ -1,3 +1,6 @@
## 0.0.36
Released to support PR https://github.com/calcom/cal.com/pull/16685
## 0.0.31
PR https://github.com/calcom/cal.com/pull/16414 fixed issue of deleting and rescheduling recurring events.
+20 -11
View File
@@ -94,22 +94,31 @@ export { eventTypeBookingFields, eventTypeLocations } from "@calcom/prisma/zod-u
export { EventTypeMetaDataSchema, userMetadata } from "@calcom/prisma/zod-utils";
export {
transformApiEventTypeBookingFields,
transformApiEventTypeIntervalLimits,
transformApiEventTypeLocations,
getResponseEventTypeLocations,
getResponseEventTypeBookingFields,
// note(Lauris): Api to internal
transformBookingFieldsApiToInternal,
transformLocationsApiToInternal,
transformIntervalLimitsApiToInternal,
transformFutureBookingLimitsApiToInternal,
transformRecurrenceApiToInternal,
// note(Lauris): Internal to api
transformBookingFieldsInternalToApi,
transformLocationsInternalToApi,
transformIntervalLimitsInternalToApi,
transformFutureBookingLimitsInternalToApi,
transformRecurrenceInternalToApi,
// note(Lauris): schemas
TransformedLocationsSchema,
BookingFieldsSchema,
getResponseEventTypeIntervalLimits,
getResponseEventTypeFutureBookingLimits,
transformApiEventTypeFutureBookingLimits,
transformApiEventTypeRecurrence,
getResponseEventTypeRecurrence,
// note(Lauris): constants
systemBeforeFieldName,
systemBeforeFieldEmail,
systemBeforeFieldLocation,
systemAfterFieldRescheduleReason,
} from "@calcom/lib/event-types/transformers";
export type { SystemField, CustomField } from "@calcom/lib/event-types/transformers";
export { parseBookingLimit } from "@calcom/lib";
export type { SystemField, UserField } from "@calcom/lib/event-types/transformers";
export { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
export { dynamicEvent } from "@calcom/lib/defaultEvents";