1
- import { CreateEventTypeInput } from "@/ee/event-types/inputs/create-event-type.input" ;
2
- import { EventTypeIdParams } from "@/ee/event-types/inputs/event-type-id.input" ;
3
- import { GetPublicEventTypeQueryParams } from "@/ee/event-types/inputs/get-public-event-type-query-params.input" ;
4
- import { UpdateEventTypeInput } from "@/ee/event-types/inputs/update-event-type.input" ;
5
- import { CreateEventTypeOutput } from "@/ee/event-types/outputs/create-event-type.output" ;
6
- import { DeleteEventTypeOutput } from "@/ee/event-types/outputs/delete-event-type.output" ;
7
- import { GetEventTypePublicOutput } from "@/ee/event-types/outputs/get-event-type-public.output" ;
8
- import { GetEventTypeOutput } from "@/ee/event-types/outputs/get-event-type.output" ;
9
- import { GetEventTypesPublicOutput } from "@/ee/event-types/outputs/get-event-types-public.output" ;
10
- import { GetEventTypesData , GetEventTypesOutput } from "@/ee/event-types/outputs/get-event-types.output" ;
11
- import { UpdateEventTypeOutput } from "@/ee/event-types/outputs/update-event-type.output" ;
12
- import { EventTypesService } from "@/ee/event-types/services/event-types.service" ;
13
- import { API_VERSIONS_VALUES } from "@/lib/api-versions" ;
1
+ import { CreateEventTypeInput_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/inputs/create-event-type.input" ;
2
+ import { EventTypeIdParams_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/inputs/event-type-id.input" ;
3
+ import { GetPublicEventTypeQueryParams_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/inputs/get-public-event-type-query-params.input" ;
4
+ import { UpdateEventTypeInput_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/inputs/update-event-type.input" ;
5
+ import { CreateEventTypeOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/create-event-type.output" ;
6
+ import { DeleteEventTypeOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/delete-event-type.output" ;
7
+ import { GetEventTypePublicOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/get-event-type-public.output" ;
8
+ import { GetEventTypeOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/get-event-type.output" ;
9
+ import { GetEventTypesPublicOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/get-event-types-public.output" ;
10
+ import {
11
+ GetEventTypesData ,
12
+ GetEventTypesOutput ,
13
+ } from "@/ee/event-types/event-types_2024_04_15/outputs/get-event-types.output" ;
14
+ import { UpdateEventTypeOutput } from "@/ee/event-types/event-types_2024_04_15/outputs/update-event-type.output" ;
15
+ import { EventTypesService_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/services/event-types.service" ;
16
+ import { VERSION_2024_04_15_VALUE } from "@/lib/api-versions" ;
14
17
import { GetUser } from "@/modules/auth/decorators/get-user/get-user.decorator" ;
15
18
import { Permissions } from "@/modules/auth/decorators/permissions/permissions.decorator" ;
16
19
import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard" ;
@@ -42,21 +45,21 @@ import { PrismaClient } from "@calcom/prisma";
42
45
43
46
@Controller ( {
44
47
path : "/v2/event-types" ,
45
- version : API_VERSIONS_VALUES ,
48
+ version : VERSION_2024_04_15_VALUE ,
46
49
} )
47
50
@UseGuards ( PermissionsGuard )
48
51
@DocsTags ( "Event types" )
49
- export class EventTypesController {
52
+ export class EventTypesController_2024_04_15 {
50
53
constructor (
51
- private readonly eventTypesService : EventTypesService ,
54
+ private readonly eventTypesService : EventTypesService_2024_04_15 ,
52
55
private readonly prismaReadService : PrismaReadService
53
56
) { }
54
57
55
58
@Post ( "/" )
56
59
@Permissions ( [ EVENT_TYPE_WRITE ] )
57
60
@UseGuards ( ApiAuthGuard )
58
61
async createEventType (
59
- @Body ( ) body : CreateEventTypeInput ,
62
+ @Body ( ) body : CreateEventTypeInput_2024_04_15 ,
60
63
@GetUser ( ) user : UserWithProfile
61
64
) : Promise < CreateEventTypeOutput > {
62
65
const eventType = await this . eventTypesService . createUserEventType ( user , body ) ;
@@ -71,9 +74,7 @@ export class EventTypesController {
71
74
@Permissions ( [ EVENT_TYPE_READ ] )
72
75
@UseGuards ( ApiAuthGuard )
73
76
async getEventType (
74
- @Param ( ) params : EventTypeIdParams ,
75
77
@Param ( "eventTypeId" , ParseIntPipe ) eventTypeId : number ,
76
-
77
78
@GetUser ( ) user : UserWithProfile
78
79
) : Promise < GetEventTypeOutput > {
79
80
const eventType = await this . eventTypesService . getUserEventTypeForAtom ( user , Number ( eventTypeId ) ) ;
@@ -109,7 +110,7 @@ export class EventTypesController {
109
110
async getPublicEventType (
110
111
@Param ( "username" ) username : string ,
111
112
@Param ( "eventSlug" ) eventSlug : string ,
112
- @Query ( ) queryParams : GetPublicEventTypeQueryParams
113
+ @Query ( ) queryParams : GetPublicEventTypeQueryParams_2024_04_15
113
114
) : Promise < GetEventTypePublicOutput > {
114
115
try {
115
116
const event = await getPublicEvent (
@@ -149,9 +150,9 @@ export class EventTypesController {
149
150
@UseGuards ( ApiAuthGuard )
150
151
@HttpCode ( HttpStatus . OK )
151
152
async updateEventType (
152
- @Param ( ) params : EventTypeIdParams ,
153
+ @Param ( ) params : EventTypeIdParams_2024_04_15 ,
153
154
@Param ( "eventTypeId" , ParseIntPipe ) eventTypeId : number ,
154
- @Body ( ) body : UpdateEventTypeInput ,
155
+ @Body ( ) body : UpdateEventTypeInput_2024_04_15 ,
155
156
@GetUser ( ) user : UserWithProfile
156
157
) : Promise < UpdateEventTypeOutput > {
157
158
const eventType = await this . eventTypesService . updateEventType ( eventTypeId , body , user ) ;
@@ -166,7 +167,7 @@ export class EventTypesController {
166
167
@Permissions ( [ EVENT_TYPE_WRITE ] )
167
168
@UseGuards ( ApiAuthGuard )
168
169
async deleteEventType (
169
- @Param ( ) params : EventTypeIdParams ,
170
+ @Param ( ) params : EventTypeIdParams_2024_04_15 ,
170
171
@Param ( "eventTypeId" , ParseIntPipe ) eventTypeId : number ,
171
172
@GetUser ( "id" ) userId : number
172
173
) : Promise < DeleteEventTypeOutput > {
0 commit comments