feat(server): endpoints swagger docs

This commit is contained in:
Ahmed Bouhuolia
2025-06-30 16:30:55 +02:00
parent 83e698acf3
commit 9f6e9e85a5
23 changed files with 1248 additions and 23 deletions

View File

@@ -4,6 +4,9 @@ import {
ApiResponse,
ApiBody,
ApiOkResponse,
ApiExtraModels,
getSchemaPath,
ApiParam,
} from '@nestjs/swagger';
import {
Controller,
@@ -29,11 +32,13 @@ import {
OrganizationBuildResponseExample,
OrganizationBuiltResponseExample,
} from './Organization.swagger';
import { GetCurrentOrganizationResponseDto } from './dtos/GetCurrentOrganizationResponse.dto';
@ApiTags('Organization')
@Controller('organization')
@IgnoreTenantInitializedRoute()
@IgnoreTenantSeededRoute()
@ApiExtraModels(GetCurrentOrganizationResponseDto)
export class OrganizationController {
constructor(
private readonly buildOrganizationService: BuildOrganizationService,
@@ -68,6 +73,12 @@ export class OrganizationController {
}
@Get('build/:buildJobId')
@ApiParam({
name: 'buildJobId',
required: true,
type: Number,
description: 'The build job id',
})
@HttpCode(200)
@ApiOperation({ summary: 'Gets the organization build job details' })
async buildJob(@Param('buildJobId') buildJobId: string) {
@@ -80,12 +91,15 @@ export class OrganizationController {
@ApiResponse({
status: 200,
description: 'Returns the current organization',
schema: {
$ref: getSchemaPath(GetCurrentOrganizationResponseDto),
},
})
async currentOrganization() {
const organization =
await this.getCurrentOrgService.getCurrentOrganization();
return { organization };
return organization;
}
@Get('base-currency-mutate')