import { ApiProperty } from '@nestjs/swagger';
import { IsIn, IsNotEmpty, IsOptional, Length } from 'class-validator';

export class TimbradoEmpresaDto {
  @ApiProperty({ example: '12345678' })
  @IsNotEmpty({ message: 'Numero timbrado es obligatorio' })
  @Length(8, 8, { message: 'Numero timbrado debe tener exactamente 8 dígitos' })
  num_timbrado: string;

  @ApiProperty({ example: '2025-01-01' })
  @IsNotEmpty({ message: 'Fecha inicio es obligatoria' })
  fecha_inicio: Date;

  @ApiProperty({ example: '001' })
  @IsNotEmpty({ message: 'Id csc es obligatorio' })
  @Length(3, 4, { message: 'Id csc debe tener exactamente 3  a 4 dígitos' })
  id_csc: string;

  @ApiProperty({ example: 'ABCD0000000000000000000000000000' })
  @IsNotEmpty({ message: 'Csc es obligatorio' })
  csc: string;

  @ApiProperty({ example: 'prod' })
  @IsNotEmpty({ message: 'Ambiente es obligatorio' })
  @IsIn(['prod', 'hml'], { message: 'Ambiente debe ser prod o hml' })
  ambiente: string;

  @ApiProperty({ example: 'usuario' })
  @IsOptional()
  usuario?: string;
}
