miinventario-backend-v2/src/modules/exports/dto/export-request.dto.ts
rckrdmrd 5a1c966ed2 Migración desde miinventario/backend - Estándar multi-repo v2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:12:15 -06:00

78 lines
1.6 KiB
TypeScript

import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import {
IsEnum,
IsOptional,
IsString,
IsBoolean,
IsDateString,
} from 'class-validator';
import { ExportFormat, ExportType } from '../entities/export-job.entity';
export class ExportInventoryDto {
@ApiProperty({
description: 'Formato de exportación',
enum: ExportFormat,
example: ExportFormat.CSV,
})
@IsEnum(ExportFormat)
format: ExportFormat;
@ApiPropertyOptional({
description: 'Filtrar por categoría',
example: 'Bebidas',
})
@IsOptional()
@IsString()
category?: string;
@ApiPropertyOptional({
description: 'Solo items con stock bajo',
example: false,
})
@IsOptional()
@IsBoolean()
lowStockOnly?: boolean;
}
export class ExportReportDto {
@ApiProperty({
description: 'Tipo de reporte',
enum: ExportType,
example: ExportType.REPORT_VALUATION,
})
@IsEnum(ExportType)
type: ExportType;
@ApiProperty({
description: 'Formato de exportación',
enum: ExportFormat,
example: ExportFormat.EXCEL,
})
@IsEnum(ExportFormat)
format: ExportFormat;
@ApiPropertyOptional({
description: 'Fecha de inicio del periodo',
example: '2024-01-01',
})
@IsOptional()
@IsDateString()
startDate?: string;
@ApiPropertyOptional({
description: 'Fecha de fin del periodo',
example: '2024-01-31',
})
@IsOptional()
@IsDateString()
endDate?: string;
}
export class ExportJobResponseDto {
@ApiProperty({ description: 'ID del trabajo de exportación' })
jobId: string;
@ApiProperty({ description: 'Mensaje informativo' })
message: string;
}