refactor: v2 event-types (#15457)

* refactor: UserAvatarGroupWithOrg.tsx remove unecessary profile prop

* chore: define event-type types in platform/types

* feat: event-type transformes in lib and re-exported through platform-libraries

* chore: define user types in platform/types

* chore: add users endpoint to platform-constants

* refactor: app-store use narrowed down booker event type

* chore: version old event-types module

* fix: old event-types e2e test

* fix: libraries add missing export

* fix: reset libraries version to 0

* feat: new event-types module and users endpoints

* feat: make booker atom work with v2 event-types

* updating event type

* refactor: remove guard for get event-types

* refactor: move private hook to public

* Revert "refactor: remove guard for get event-types"

This reverts commit d41204069f1d5bb1305b388ce53399f9175f4249.

* Revert "refactor: move private hook to public"

This reverts commit 09322e8fba102e57104959f79ed6bfa9a677dc9d.

* refactor: get by username and slug in /event-types

* remove console log

* feat: locations handle displayEventPublicly

* test e2e event-types

* revert: user output from types

* refactor: event-types hooks have private and public folders

* refactor: require event-type.slug in input

* refactor: demand that all labels of booking fields are unique

* refactor: remove unused import

* refactor: only have email and name by default in booker

* refactor: add booking field slug

* fix: display event-type location publicly / hide it in booker

* fix: display event-type location publicly / hide it in booker

* fix: packages/lib tests

* fix: typescript in e2e test

* fix: dynamic event types input

* refactor: use IsIn instead of IsEnum

* refactor: simplify getEventTypes

* fix: use ApiAuthGuard instead of AccessTokenGuard

* chore: export more stuff from libraries

* refactor: SchedulingTypeEnum and Type

---------

Co-authored-by: Morgan <[email protected]>
This commit is contained in:
Lauris SkraucisandMorgan authored and GitHub committed 2024-06-21 10:49:12 +00:00
1 parent c7a96e1b43
commit 0072aba55d
122 files changed
+4738 -523

No files matched your search

+324 -16
View File
@@ -577,14 +577,14 @@
},
"/v2/event-types": {
"post": {
"operationId": "EventTypesController_createEventType",
"operationId": "EventTypesController_2024_04_15_createEventType",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateEventTypeInput"
"$ref": "#/components/schemas/CreateEventTypeInput_2024_04_15"
}
}
}
@@ -606,7 +606,7 @@
]
},
"get": {
"operationId": "EventTypesController_getEventTypes",
"operationId": "EventTypesController_2024_04_15_getEventTypes",
"parameters": [],
"responses": {
"200": {
@@ -627,7 +627,7 @@
},
"/v2/event-types/{eventTypeId}": {
"get": {
"operationId": "EventTypesController_getEventType",
"operationId": "EventTypesController_2024_04_15_getEventType",
"parameters": [
{
"name": "eventTypeId",
@@ -655,7 +655,7 @@
]
},
"patch": {
"operationId": "EventTypesController_updateEventType",
"operationId": "EventTypesController_2024_04_15_updateEventType",
"parameters": [
{
"name": "eventTypeId",
@@ -671,7 +671,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateEventTypeInput"
"$ref": "#/components/schemas/UpdateEventTypeInput_2024_04_15"
}
}
}
@@ -693,7 +693,7 @@
]
},
"delete": {
"operationId": "EventTypesController_deleteEventType",
"operationId": "EventTypesController_2024_04_15_deleteEventType",
"parameters": [
{
"name": "eventTypeId",
@@ -723,7 +723,7 @@
},
"/v2/event-types/{username}/{eventSlug}/public": {
"get": {
"operationId": "EventTypesController_getPublicEventType",
"operationId": "EventTypesController_2024_04_15_getPublicEventType",
"parameters": [
{
"name": "username",
@@ -778,7 +778,7 @@
},
"/v2/event-types/{username}/public": {
"get": {
"operationId": "EventTypesController_getPublicEventTypes",
"operationId": "EventTypesController_2024_04_15_getPublicEventTypes",
"parameters": [
{
"name": "username",
@@ -2146,7 +2146,179 @@
"refreshToken"
]
},
"EventTypeLocation": {
"CreateEventTypeInput_2024_06_14": {
"type": "object",
"properties": {
"lengthInMinutes": {
"type": "number",
"example": 60
},
"title": {
"type": "string",
"example": "Learn the secrets of masterchief!"
},
"description": {
"type": "string",
"example": "Discover the culinary wonders of the Argentina by making the best flan ever!"
}
},
"required": [
"lengthInMinutes",
"title",
"description"
]
},
"EventTypeOutput_2024_06_14": {
"type": "object",
"properties": {
"id": {
"type": "number",
"example": 1
}
},
"required": [
"id"
]
},
"CreateEventTypeOutput_2024_06_14": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
},
"data": {
"$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
}
},
"required": [
"status",
"data"
]
},
"GetEventTypeOutput_2024_06_14": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
},
"data": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
}
]
}
},
"required": [
"status",
"data"
]
},
"GetEventTypesOutput_2024_06_14": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
}
}
},
"required": [
"status",
"data"
]
},
"UpdateEventTypeInput_2024_06_14": {
"type": "object",
"properties": {}
},
"UpdateEventTypeOutput_2024_06_14": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
},
"data": {
"$ref": "#/components/schemas/EventTypeOutput_2024_06_14"
}
},
"required": [
"status",
"data"
]
},
"DeleteData_2024_06_14": {
"type": "object",
"properties": {
"id": {
"type": "number",
"example": 1
},
"lengthInMinutes": {
"type": "number",
"example": 60
},
"title": {
"type": "string",
"example": "Learn the secrets of masterchief!"
},
"slug": {
"type": "string"
}
},
"required": [
"id",
"lengthInMinutes",
"title",
"slug"
]
},
"DeleteEventTypeOutput_2024_06_14": {
"type": "object",
"properties": {
"status": {
"type": "string",
"example": "success",
"enum": [
"success",
"error"
]
},
"data": {
"$ref": "#/components/schemas/DeleteData_2024_06_14"
}
},
"required": [
"status",
"data"
]
},
"EventTypeLocation_2024_04_15": {
"type": "object",
"properties": {
"type": {
@@ -2162,7 +2334,7 @@
"type"
]
},
"CreateEventTypeInput": {
"CreateEventTypeInput_2024_04_15": {
"type": "object",
"properties": {
"length": {
@@ -2185,7 +2357,7 @@
"locations": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventTypeLocation"
"$ref": "#/components/schemas/EventTypeLocation_2024_04_15"
}
},
"disableGuests": {
@@ -2242,7 +2414,7 @@
"nullable": true,
"type": "array",
"items": {
"$ref": "#/components/schemas/EventTypeLocation"
"$ref": "#/components/schemas/EventTypeLocation_2024_04_15"
}
}
},
@@ -2864,7 +3036,143 @@
"data"
]
},
"UpdateEventTypeInput": {
"Option": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"value",
"label"
]
},
"VariantsConfig": {
"type": "object",
"properties": {
"variants": {
"type": "object"
}
},
"required": [
"variants"
]
},
"View": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"id",
"label"
]
},
"BookingField_2024_04_15": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"number",
"boolean",
"address",
"name",
"text",
"textarea",
"email",
"phone",
"multiemail",
"select",
"multiselect",
"checkbox",
"radio",
"radioInput"
]
},
"name": {
"type": "string"
},
"options": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Option"
}
},
"label": {
"type": "string"
},
"labelAsSafeHtml": {
"type": "string"
},
"defaultLabel": {
"type": "string"
},
"placeholder": {
"type": "string"
},
"required": {
"type": "boolean"
},
"getOptionsAt": {
"type": "string"
},
"optionsInputs": {
"type": "object"
},
"variant": {
"type": "string"
},
"variantsConfig": {
"$ref": "#/components/schemas/VariantsConfig"
},
"views": {
"type": "array",
"items": {
"$ref": "#/components/schemas/View"
}
},
"hideWhenJustOneOption": {
"type": "boolean"
},
"hidden": {
"type": "boolean"
},
"editable": {
"type": "string",
"enum": [
"system",
"system-but-optional",
"system-but-hidden",
"user",
"user-readonly"
]
},
"sources": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Source"
}
}
},
"required": [
"type",
"name"
]
},
"UpdateEventTypeInput_2024_04_15": {
"type": "object",
"properties": {
"length": {
@@ -2886,13 +3194,13 @@
"locations": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EventTypeLocation"
"$ref": "#/components/schemas/EventTypeLocation_2024_04_15"
}
},
"bookingFields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BookingField"
"$ref": "#/components/schemas/BookingField_2024_04_15"
}
},
"disableGuests": {