1
- import { API_VERSIONS_VALUES } from "@/lib/api-versions" ;
2
- import { SlotsOutputService } from "@/modules/slots/services/slots-output.service" ;
3
- import { SlotsService } from "@/modules/slots/services/slots.service" ;
1
+ import { SlotsOutputService_2024_04_15 } from "@/modules/slots/slots-2024-04-15/services/slots-output.service" ;
2
+ import { SlotsService_2024_04_15 } from "@/modules/slots/slots-2024-04-15/services/slots.service" ;
4
3
import { Query , Body , Controller , Get , Delete , Post , Req , Res } from "@nestjs/common" ;
4
+ import { ApiExcludeController as DocsExcludeController } from "@nestjs/swagger" ;
5
5
import { ApiTags as DocsTags , ApiCreatedResponse , ApiOkResponse , ApiOperation } from "@nestjs/swagger" ;
6
6
import { Response as ExpressResponse , Request as ExpressRequest } from "express" ;
7
7
8
- import { SUCCESS_STATUS } from "@calcom/platform-constants" ;
8
+ import {
9
+ SUCCESS_STATUS ,
10
+ VERSION_2024_06_14 ,
11
+ VERSION_2024_04_15 ,
12
+ VERSION_2024_06_11 ,
13
+ VERSION_2024_08_13 ,
14
+ } from "@calcom/platform-constants" ;
9
15
import { getAvailableSlots } from "@calcom/platform-libraries" ;
10
16
import type { AvailableSlotsType } from "@calcom/platform-libraries" ;
11
- import { RemoveSelectedSlotInput , ReserveSlotInput } from "@calcom/platform-types" ;
12
- import { ApiResponse , GetAvailableSlotsInput } from "@calcom/platform-types" ;
17
+ import { RemoveSelectedSlotInput_2024_04_15 , ReserveSlotInput_2024_04_15 } from "@calcom/platform-types" ;
18
+ import { ApiResponse , GetAvailableSlotsInput_2024_04_15 } from "@calcom/platform-types" ;
13
19
14
20
@Controller ( {
15
21
path : "/v2/slots" ,
16
- version : API_VERSIONS_VALUES ,
22
+ version : [ VERSION_2024_04_15 , VERSION_2024_06_11 , VERSION_2024_06_14 , VERSION_2024_08_13 ] ,
17
23
} )
18
- @DocsTags ( "Slots" )
19
- export class SlotsController {
24
+ @DocsExcludeController ( true )
25
+ export class SlotsController_2024_04_15 {
20
26
constructor (
21
- private readonly slotsService : SlotsService ,
22
- private readonly slotsOutputService : SlotsOutputService
27
+ private readonly slotsService : SlotsService_2024_04_15 ,
28
+ private readonly slotsOutputService : SlotsOutputService_2024_04_15
23
29
) { }
24
30
25
31
@Post ( "/reserve" )
@@ -40,7 +46,7 @@ export class SlotsController {
40
46
} )
41
47
@ApiOperation ( { summary : "Reserve a slot" } )
42
48
async reserveSlot (
43
- @Body ( ) body : ReserveSlotInput ,
49
+ @Body ( ) body : ReserveSlotInput_2024_04_15 ,
44
50
@Res ( { passthrough : true } ) res : ExpressResponse ,
45
51
@Req ( ) req : ExpressRequest
46
52
) : Promise < ApiResponse < string > > {
@@ -65,7 +71,7 @@ export class SlotsController {
65
71
} )
66
72
@ApiOperation ( { summary : "Delete a selected slot" } )
67
73
async deleteSelectedSlot (
68
- @Query ( ) params : RemoveSelectedSlotInput ,
74
+ @Query ( ) params : RemoveSelectedSlotInput_2024_04_15 ,
69
75
@Req ( ) req : ExpressRequest
70
76
) : Promise < ApiResponse > {
71
77
const uid = req . cookies ?. uid || params . uid ;
@@ -148,7 +154,7 @@ export class SlotsController {
148
154
} )
149
155
@ApiOperation ( { summary : "Get available slots" } )
150
156
async getAvailableSlots (
151
- @Query ( ) query : GetAvailableSlotsInput ,
157
+ @Query ( ) query : GetAvailableSlotsInput_2024_04_15 ,
152
158
@Req ( ) req : ExpressRequest
153
159
) : Promise < ApiResponse < AvailableSlotsType > > {
154
160
const isTeamEvent = await this . slotsService . checkIfIsTeamEvent ( query . eventTypeId ) ;
0 commit comments