feat(api): add OpenAPI/Swagger documentation for all API endpoints

Install @nestjs/swagger, configure Swagger UI at /api/docs with JWT bearer
auth, and add ApiTags/ApiOperation/ApiResponse/ApiProperty decorators to
all 8 controllers (50+ endpoints) and 31 DTOs across auth, listings,
search, payments, subscriptions, admin, notifications, and analytics modules.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-08 04:08:11 +07:00
parent 325cd4c421
commit 8e7672694b
42 changed files with 531 additions and 3 deletions

View File

@@ -1,9 +1,12 @@
import { IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
export class GetDistrictStatsDto {
@ApiProperty({ description: 'City name' })
@IsString()
city!: string;
@ApiProperty({ description: 'Time period' })
@IsString()
period!: string;
}

View File

@@ -1,9 +1,12 @@
import { IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
export class GetHeatmapDto {
@ApiProperty({ description: 'City name' })
@IsString()
city!: string;
@ApiProperty({ description: 'Time period' })
@IsString()
period!: string;
}

View File

@@ -1,13 +1,17 @@
import { IsEnum, IsOptional, IsString } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { PropertyType } from '@prisma/client';
export class GetMarketReportDto {
@ApiProperty({ description: 'City name' })
@IsString()
city!: string;
@ApiProperty({ description: 'Time period' })
@IsString()
period!: string;
@ApiPropertyOptional({ enum: PropertyType, description: 'Property type filter' })
@IsOptional()
@IsEnum(PropertyType)
propertyType?: PropertyType;

View File

@@ -1,17 +1,22 @@
import { IsArray, IsEnum, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { PropertyType } from '@prisma/client';
export class GetPriceTrendDto {
@ApiProperty({ description: 'District name' })
@IsString()
district!: string;
@ApiProperty({ description: 'City name' })
@IsString()
city!: string;
@ApiProperty({ enum: PropertyType, description: 'Property type' })
@IsEnum(PropertyType)
propertyType!: PropertyType;
@ApiProperty({ description: 'Comma-separated list of periods', type: [String] })
@IsArray()
@IsString({ each: true })
@Transform(({ value }) => (typeof value === 'string' ? value.split(',') : value))