diff --git a/libs/common/src/constants/controller-route.ts b/libs/common/src/constants/controller-route.ts new file mode 100644 index 0000000..a1e43ee --- /dev/null +++ b/libs/common/src/constants/controller-route.ts @@ -0,0 +1,11 @@ +export class ControllerRoute { + static REGION = class { + public static readonly ROUTE = 'region'; + static ACTIONS = class { + public static readonly GET_REGIONS_SUMMARY = 'Get list of all regions'; + + public static readonly GET_REGIONS_DESCRIPTION = + 'Retrieve the list of all regions registered in Syncrow.'; + }; + }; +} diff --git a/src/region/controllers/region.controller.ts b/src/region/controllers/region.controller.ts index d914642..8df4a11 100644 --- a/src/region/controllers/region.controller.ts +++ b/src/region/controllers/region.controller.ts @@ -1,16 +1,21 @@ import { Controller, Get, HttpException, HttpStatus } from '@nestjs/common'; import { RegionService } from '../services/region.service'; -import { ApiTags } from '@nestjs/swagger'; +import { ApiTags, ApiOperation } from '@nestjs/swagger'; +import { ControllerRoute } from '@app/common/constants/controller-route'; @ApiTags('Region Module') @Controller({ version: '1', - path: 'region', + path: ControllerRoute.REGION.ROUTE, }) export class RegionController { constructor(private readonly regionService: RegionService) {} @Get() + @ApiOperation({ + summary: ControllerRoute.REGION.ACTIONS.GET_REGIONS_SUMMARY, + description: ControllerRoute.REGION.ACTIONS.GET_REGIONS_DESCRIPTION, + }) async getAllRegions() { try { return await this.regionService.getAllRegions();