75 lines
1.7 KiB
TypeScript
75 lines
1.7 KiB
TypeScript
import { IsString, IsOptional, IsBoolean, IsDecimal, IsArray, ValidateNested, IsNotEmpty } from 'class-validator';
|
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class PaqueteLoteItemDto {
|
|
@ApiProperty({ example: 'Juan Pérez' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
nombreCliente: string;
|
|
|
|
@ApiProperty({ example: '591' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
codigoPaisCliente: string;
|
|
|
|
@ApiProperty({ example: '70123456' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
whatsappCliente: string;
|
|
|
|
@ApiPropertyOptional({ example: 'uuid-categoria' })
|
|
@IsString()
|
|
@IsOptional()
|
|
idCategoria?: string;
|
|
|
|
@ApiPropertyOptional({ example: 'uuid-zona' })
|
|
@IsString()
|
|
@IsOptional()
|
|
idZonaAlmacenamiento?: string;
|
|
|
|
@ApiPropertyOptional({ example: '/uploads/paquetes/abc.jpg' })
|
|
@IsString()
|
|
@IsOptional()
|
|
fotoUrl?: string;
|
|
|
|
@ApiPropertyOptional({ example: false })
|
|
@IsBoolean()
|
|
@IsOptional()
|
|
@Type(() => Boolean)
|
|
paquetePagado?: boolean;
|
|
|
|
@ApiPropertyOptional({ example: false })
|
|
@IsBoolean()
|
|
@IsOptional()
|
|
@Type(() => Boolean)
|
|
saldo?: boolean;
|
|
|
|
@ApiPropertyOptional({ example: 0 })
|
|
@IsDecimal()
|
|
@IsOptional()
|
|
saldoPendiente?: number;
|
|
}
|
|
|
|
export class CrearLoteDto {
|
|
@ApiProperty({ example: 'uuid-sucursal' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
idSucursal: string;
|
|
|
|
@ApiPropertyOptional({ example: 'uuid-emprendimiento' })
|
|
@IsString()
|
|
@IsOptional()
|
|
idEmprendimiento?: string;
|
|
|
|
@ApiPropertyOptional({ example: 'uuid-usuario' })
|
|
@IsString()
|
|
@IsOptional()
|
|
idUsuarioRecepcion?: string;
|
|
|
|
@ApiProperty({ type: [PaqueteLoteItemDto] })
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => PaqueteLoteItemDto)
|
|
paquetes: PaqueteLoteItemDto[];
|
|
}
|