Skip to content

Commit d6741a1

Browse files
authored
fix: rename OOO controller file to match NestJS Swagger plugin convention (calcom#28342)
* fix: rename OOO controller file to match NestJS Swagger plugin convention for type generation * fix: update organization module import * feat: generate openapi docs
1 parent b539adf commit d6741a1

3 files changed

Lines changed: 121 additions & 6 deletions

File tree

apps/api/v2/src/modules/organizations/organizations.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import { OrganizationTeamWorkflowsController } from "@/modules/organizations/tea
6060
import { OrganizationsUsersController } from "@/modules/organizations/users/index/controllers/organizations-users.controller";
6161
import { OrganizationsUsersRepository } from "@/modules/organizations/users/index/organizations-users.repository";
6262
import { OrganizationsUsersService } from "@/modules/organizations/users/index/services/organizations-users-service";
63-
import { OrganizationsUsersOOOController } from "@/modules/organizations/users/ooo/controllers/organizations-users-ooo-controller";
63+
import { OrganizationsUsersOOOController } from "@/modules/organizations/users/ooo/controllers/organizations-users-ooo.controller";
6464
import { OrgUsersOOORepository } from "@/modules/organizations/users/ooo/organizations-users-ooo.repository";
6565
import { OrgUsersOOOService } from "@/modules/organizations/users/ooo/services/organization-users-ooo.service";
6666
import { OrganizationsWebhooksController } from "@/modules/organizations/webhooks/controllers/organizations-webhooks.controller";

apps/api/v2/src/modules/organizations/users/ooo/controllers/organizations-users-ooo-controller.ts renamed to apps/api/v2/src/modules/organizations/users/ooo/controllers/organizations-users-ooo.controller.ts

File renamed without changes.

docs/api-reference/v2/openapi.json

Lines changed: 120 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8036,7 +8036,14 @@
80368036
],
80378037
"responses": {
80388038
"200": {
8039-
"description": ""
8039+
"description": "",
8040+
"content": {
8041+
"application/json": {
8042+
"schema": {
8043+
"$ref": "#/components/schemas/UserOoosOutputResponseDto"
8044+
}
8045+
}
8046+
}
80408047
}
80418048
},
80428049
"tags": ["Orgs / Users / OOO"]
@@ -8093,7 +8100,14 @@
80938100
},
80948101
"responses": {
80958102
"201": {
8096-
"description": ""
8103+
"description": "",
8104+
"content": {
8105+
"application/json": {
8106+
"schema": {
8107+
"$ref": "#/components/schemas/UserOooOutputResponseDto"
8108+
}
8109+
}
8110+
}
80978111
}
80988112
},
80998113
"tags": ["Orgs / Users / OOO"]
@@ -8160,7 +8174,14 @@
81608174
},
81618175
"responses": {
81628176
"200": {
8163-
"description": ""
8177+
"description": "",
8178+
"content": {
8179+
"application/json": {
8180+
"schema": {
8181+
"$ref": "#/components/schemas/UserOooOutputResponseDto"
8182+
}
8183+
}
8184+
}
81648185
}
81658186
},
81668187
"tags": ["Orgs / Users / OOO"]
@@ -8207,7 +8228,14 @@
82078228
],
82088229
"responses": {
82098230
"200": {
8210-
"description": ""
8231+
"description": "",
8232+
"content": {
8233+
"application/json": {
8234+
"schema": {
8235+
"$ref": "#/components/schemas/UserOooOutputResponseDto"
8236+
}
8237+
}
8238+
}
82118239
}
82128240
},
82138241
"tags": ["Orgs / Users / OOO"]
@@ -8313,7 +8341,14 @@
83138341
],
83148342
"responses": {
83158343
"200": {
8316-
"description": ""
8344+
"description": "",
8345+
"content": {
8346+
"application/json": {
8347+
"schema": {
8348+
"$ref": "#/components/schemas/UserOoosOutputResponseDto"
8349+
}
8350+
}
8351+
}
83178352
}
83188353
},
83198354
"tags": ["Orgs / Users / OOO"]
@@ -24599,6 +24634,72 @@
2459924634
}
2460024635
}
2460124636
},
24637+
"UserOooOutputDto": {
24638+
"type": "object",
24639+
"properties": {
24640+
"userId": {
24641+
"type": "number",
24642+
"description": "The ID of the user.",
24643+
"example": 2
24644+
},
24645+
"toUserId": {
24646+
"type": "number",
24647+
"description": "The ID of the user covering for the out of office period, if applicable.",
24648+
"example": 2
24649+
},
24650+
"id": {
24651+
"type": "number",
24652+
"description": "The ID of the ooo entry.",
24653+
"example": 2
24654+
},
24655+
"uuid": {
24656+
"type": "string",
24657+
"description": "The UUID of the ooo entry.",
24658+
"example": 2
24659+
},
24660+
"start": {
24661+
"format": "date-time",
24662+
"type": "string",
24663+
"description": "The start date and time of the out of office period in ISO 8601 format in UTC timezone.",
24664+
"example": "2023-05-01T00:00:00.000Z"
24665+
},
24666+
"end": {
24667+
"format": "date-time",
24668+
"type": "string",
24669+
"description": "The end date and time of the out of office period in ISO 8601 format in UTC timezone.",
24670+
"example": "2023-05-10T23:59:59.999Z"
24671+
},
24672+
"notes": {
24673+
"type": "string",
24674+
"description": "Optional notes for the out of office entry.",
24675+
"example": "Vacation in Hawaii"
24676+
},
24677+
"reason": {
24678+
"enum": ["unspecified", "vacation", "travel", "sick", "public_holiday"],
24679+
"type": "string",
24680+
"description": "the reason for the out of office entry, if applicable",
24681+
"example": "vacation"
24682+
}
24683+
},
24684+
"required": ["userId", "id", "uuid", "start", "end"]
24685+
},
24686+
"UserOoosOutputResponseDto": {
24687+
"type": "object",
24688+
"properties": {
24689+
"status": {
24690+
"type": "string",
24691+
"example": "success",
24692+
"enum": ["success", "error"]
24693+
},
24694+
"data": {
24695+
"type": "array",
24696+
"items": {
24697+
"$ref": "#/components/schemas/UserOooOutputDto"
24698+
}
24699+
}
24700+
},
24701+
"required": ["status", "data"]
24702+
},
2460224703
"CreateOutOfOfficeEntryDto": {
2460324704
"type": "object",
2460424705
"properties": {
@@ -24633,6 +24734,20 @@
2463324734
},
2463424735
"required": ["start", "end"]
2463524736
},
24737+
"UserOooOutputResponseDto": {
24738+
"type": "object",
24739+
"properties": {
24740+
"status": {
24741+
"type": "string",
24742+
"example": "success",
24743+
"enum": ["success", "error"]
24744+
},
24745+
"data": {
24746+
"$ref": "#/components/schemas/UserOooOutputDto"
24747+
}
24748+
},
24749+
"required": ["status", "data"]
24750+
},
2463624751
"UpdateOutOfOfficeEntryDto": {
2463724752
"type": "object",
2463824753
"properties": {

0 commit comments

Comments
 (0)