From ee9c73476b1d42a95ee12faf8b7d40606833bd5d Mon Sep 17 00:00:00 2001 From: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> Date: Mon, 3 Mar 2025 18:03:32 +0200 Subject: [PATCH] chore: add docs to /v2/organizations/:orgId/organizations endpoints (#19668) Co-authored-by: Somay Chauhan --- .../organizations-organizations.controller.ts | 30 +++++++++++++++---- apps/api/v2/swagger/documentation.json | 5 ++++ docs/api-reference/v2/openapi.json | 5 ++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/apps/api/v2/src/modules/organizations/organizations/organizations-organizations.controller.ts b/apps/api/v2/src/modules/organizations/organizations/organizations-organizations.controller.ts index 4a1afc74bd..2fa6d8ba3a 100644 --- a/apps/api/v2/src/modules/organizations/organizations/organizations-organizations.controller.ts +++ b/apps/api/v2/src/modules/organizations/organizations/organizations-organizations.controller.ts @@ -46,7 +46,11 @@ export class OrganizationsOrganizationsController { @Post() @Roles("ORG_ADMIN") @PlatformPlan(SCALE) - @ApiOperation({ summary: "Create an organization within an organization" }) + @ApiOperation({ + summary: "Create an organization within an organization", + description: + "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", + }) async createOrganization( @Param("orgId", ParseIntPipe) managerOrganizationId: number, @GetUser() authUser: ApiAuthGuardUser, @@ -67,7 +71,11 @@ export class OrganizationsOrganizationsController { @Roles("ORG_ADMIN") @PlatformPlan(SCALE) @Get("/:managedOrganizationId") - @ApiOperation({ summary: "Get an organization within an organization" }) + @ApiOperation({ + summary: "Get an organization within an organization", + description: + "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", + }) @UseGuards(IsManagedOrgInManagerOrg) async getOrganization( @Param("managedOrganizationId", ParseIntPipe) managedOrganizationId: number @@ -82,7 +90,11 @@ export class OrganizationsOrganizationsController { @Roles("ORG_ADMIN") @PlatformPlan(SCALE) @Get("/") - @ApiOperation({ summary: "Get all organizations within an organization" }) + @ApiOperation({ + summary: "Get all organizations within an organization", + description: + "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", + }) async getOrganizations( @Param("orgId", ParseIntPipe) managerOrganizationId: number ): Promise { @@ -98,7 +110,11 @@ export class OrganizationsOrganizationsController { @Roles("ORG_ADMIN") @PlatformPlan(SCALE) @Patch("/:managedOrganizationId") - @ApiOperation({ summary: "Update an organization within an organization" }) + @ApiOperation({ + summary: "Update an organization within an organization", + description: + "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", + }) @UseGuards(IsManagedOrgInManagerOrg) @HttpCode(HttpStatus.OK) async updateOrganization( @@ -119,7 +135,11 @@ export class OrganizationsOrganizationsController { @Roles("ORG_ADMIN") @PlatformPlan(SCALE) @Delete("/:managedOrganizationId") - @ApiOperation({ summary: "Delete an organization within an organization" }) + @ApiOperation({ + summary: "Delete an organization within an organization", + description: + "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", + }) @UseGuards(IsManagedOrgInManagerOrg) async deleteOrganization( @Param("managedOrganizationId", ParseIntPipe) managedOrganizationId: number diff --git a/apps/api/v2/swagger/documentation.json b/apps/api/v2/swagger/documentation.json index b4ca0a7a3e..b8eb08086f 100644 --- a/apps/api/v2/swagger/documentation.json +++ b/apps/api/v2/swagger/documentation.json @@ -1717,6 +1717,7 @@ "post": { "operationId": "OrganizationsOrganizationsController_createOrganization", "summary": "Create an organization within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "orgId", @@ -1756,6 +1757,7 @@ "get": { "operationId": "OrganizationsOrganizationsController_getOrganizations", "summary": "Get all organizations within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "orgId", @@ -1787,6 +1789,7 @@ "get": { "operationId": "OrganizationsOrganizationsController_getOrganization", "summary": "Get an organization within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "managedOrganizationId", @@ -1816,6 +1819,7 @@ "patch": { "operationId": "OrganizationsOrganizationsController_updateOrganization", "summary": "Update an organization within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "orgId", @@ -1863,6 +1867,7 @@ "delete": { "operationId": "OrganizationsOrganizationsController_deleteOrganization", "summary": "Delete an organization within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "managedOrganizationId", diff --git a/docs/api-reference/v2/openapi.json b/docs/api-reference/v2/openapi.json index 7481434565..6cab980f2b 100644 --- a/docs/api-reference/v2/openapi.json +++ b/docs/api-reference/v2/openapi.json @@ -1635,6 +1635,7 @@ "post": { "operationId": "OrganizationsOrganizationsController_createOrganization", "summary": "Create an organization within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "orgId", @@ -1672,6 +1673,7 @@ "get": { "operationId": "OrganizationsOrganizationsController_getOrganizations", "summary": "Get all organizations within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "orgId", @@ -1701,6 +1703,7 @@ "get": { "operationId": "OrganizationsOrganizationsController_getOrganization", "summary": "Get an organization within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "managedOrganizationId", @@ -1728,6 +1731,7 @@ "patch": { "operationId": "OrganizationsOrganizationsController_updateOrganization", "summary": "Update an organization within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "orgId", @@ -1773,6 +1777,7 @@ "delete": { "operationId": "OrganizationsOrganizationsController_deleteOrganization", "summary": "Delete an organization within an organization", + "description": "Requires the user to have at least the 'ORG_ADMIN' role within the organization. Additionally, for platform, the plan must be 'SCALE' or higher to access this endpoint.", "parameters": [ { "name": "managedOrganizationId",