test(reports): add E2E pipeline integration tests for report generation

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>
This commit is contained in:
Ho Ngoc Hai
2026-04-16 17:24:52 +07:00
parent 8f2d325d60
commit ac4191cdf0
9 changed files with 1164 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsNumber, IsOptional, IsString, Max, Min } from 'class-validator';
import { Type } from 'class-transformer';
export class AnalyzeIndustrialLocationDto {
@ApiProperty({ example: 10.9, description: 'Vĩ độ' })
@IsNumber()
@Type(() => Number)
@Min(-90)
@Max(90)
latitude!: number;
@ApiProperty({ example: 106.8, description: 'Kinh độ' })
@IsNumber()
@Type(() => Number)
@Min(-180)
@Max(180)
longitude!: number;
@ApiPropertyOptional({ example: 'VSIP Bình Dương', description: 'Tên KCN cần phân tích' })
@IsOptional()
@IsString()
park_name?: string;
@ApiPropertyOptional({ example: 'electronics', description: 'Ngành mục tiêu' })
@IsOptional()
@IsString()
target_industry?: string;
}