26 tests covering: full pipeline flow for 3 report types + generic fallback, status polling (GENERATING → READY/FAILED transitions), quota enforcement and user scoping, error handling (PDF failure, AI failure, auth checks), delete cleanup flow, and temp file lifecycle. Co-Authored-By: Paperclip <noreply@paperclip.ing>
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { IsBoolean, IsEnum, IsNumber, IsOptional, IsString, Max, Min } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
const INDUSTRIAL_PROPERTY_TYPES = [
|
|
'industrial_land',
|
|
'ready_built_factory',
|
|
'ready_built_warehouse',
|
|
'logistics_center',
|
|
'office_in_park',
|
|
'data_center',
|
|
] as const;
|
|
|
|
export class EstimateIndustrialRentDto {
|
|
@ApiProperty({ example: 'Bình Dương', description: 'Tỉnh/thành phố' })
|
|
@IsString()
|
|
province!: string;
|
|
|
|
@ApiProperty({
|
|
example: 'ready_built_factory',
|
|
enum: INDUSTRIAL_PROPERTY_TYPES,
|
|
description: 'Loại BĐS công nghiệp',
|
|
})
|
|
@IsEnum(INDUSTRIAL_PROPERTY_TYPES)
|
|
property_type!: (typeof INDUSTRIAL_PROPERTY_TYPES)[number];
|
|
|
|
@ApiProperty({ example: 5000, description: 'Diện tích yêu cầu (m²)' })
|
|
@IsNumber()
|
|
@Type(() => Number)
|
|
@Min(1)
|
|
area_m2!: number;
|
|
|
|
@ApiProperty({ example: 10, description: 'Thời hạn thuê (năm)' })
|
|
@IsNumber()
|
|
@Type(() => Number)
|
|
@Min(1)
|
|
@Max(70)
|
|
lease_duration_years!: number;
|
|
|
|
@ApiPropertyOptional({ example: 'VSIP Bình Dương', description: 'Tên KCN cụ thể' })
|
|
@IsOptional()
|
|
@IsString()
|
|
park_name?: string;
|
|
|
|
@ApiPropertyOptional({ example: false, description: 'Yêu cầu cầu trục' })
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@Type(() => Boolean)
|
|
requires_crane?: boolean;
|
|
|
|
@ApiPropertyOptional({ example: 500, description: 'Công suất điện yêu cầu (KVA)' })
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Type(() => Number)
|
|
required_power_kva?: number;
|
|
|
|
@ApiPropertyOptional({ example: false, description: 'Yêu cầu xử lý nước thải' })
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@Type(() => Boolean)
|
|
requires_wastewater?: boolean;
|
|
}
|