import { ApiProperty } from '@nestjs/swagger'; import { Transform, Type } from 'class-transformer'; import { IsBoolean, IsInt, IsNumber, Max, Min } from 'class-validator'; /** * Query params for `GET /industrial/parks/by-bbox`. * * The bbox covers the user's current Mapbox viewport. `zoom` controls * whether the response includes polygon boundaries (zoom >= 12) or just * Point centroids. */ export class IndustrialParksBboxDto { @ApiProperty({ example: 8.0, description: 'Southern (min) latitude of the viewport' }) @Type(() => Number) @IsNumber() @Min(-90) @Max(90) south!: number; @ApiProperty({ example: 102.0, description: 'Western (min) longitude of the viewport' }) @Type(() => Number) @IsNumber() @Min(-180) @Max(180) west!: number; @ApiProperty({ example: 23.5, description: 'Northern (max) latitude of the viewport' }) @Type(() => Number) @IsNumber() @Min(-90) @Max(90) north!: number; @ApiProperty({ example: 110.0, description: 'Eastern (max) longitude of the viewport' }) @Type(() => Number) @IsNumber() @Min(-180) @Max(180) east!: number; @ApiProperty({ example: 8, description: 'Mapbox zoom level (0-22)' }) @Type(() => Number) @IsInt() @Min(0) @Max(22) zoom!: number; @ApiProperty({ required: false, default: false, description: 'Include raw OSM imports (admin only). Default: false.', }) @Transform(({ value }) => value === 'true' || value === true) @IsBoolean() includeOsmRaw?: boolean = false; @ApiProperty({ required: false, default: 3000, description: 'Max features to return. Default 3000 covers the entire promoted KCN catalog at country zoom; raise to 5000 if you also include raw OSM imports.', }) @Type(() => Number) @IsInt() @Min(1) @Max(5000) limit?: number = 3000; }