import {
  IsNotEmpty,
  IsOptional,
  IsString,
  IsBoolean,
  IsEnum,
  IsNumber,
  MaxLength,
  IsIn,
} from 'class-validator';
import { CurrencyFormat } from '../../../entities/currency.entity';

export class CreateCurrencyDto {
  @IsString()
  @IsNotEmpty()
  @MaxLength(255)
  name: string;

  @IsString()
  @IsNotEmpty()
  @MaxLength(10)
  code: string;

  @IsString()
  @IsNotEmpty()
  @MaxLength(5)
  symbol: string;

  @IsNumber()
  @IsOptional()
  @IsIn([1, 5, 10, 50, 100])
  rounding?: number;

  @IsEnum(CurrencyFormat)
  @IsOptional()
  format?: CurrencyFormat;

  @IsBoolean()
  @IsOptional()
  is_active?: boolean;
}
