import { IsString, IsNumber, IsOptional, Min } from 'class-validator';

export class CreateCurrencyDto {
  @IsString()
  code: string;

  @IsString()
  name: string;

  @IsString()
  symbol: string;

  @IsString()
  @IsOptional()
  baseCurrencyCode?: string;

  @IsNumber()
  @Min(0.0001)
  exchangeRate: number;
}

export class UpdateCurrencyDto {
  @IsString()
  @IsOptional()
  name?: string;

  @IsString()
  @IsOptional()
  symbol?: string;

  @IsNumber()
  @IsOptional()
  @Min(0.0001)
  exchangeRate?: number;
}

export class CurrencyResponseDto {
  id: string;
  code: string;
  name: string;
  symbol: string;
  baseCurrencyCode: string;
  exchangeRate: number;
  isActive: boolean;
  createdAt: Date;
  updatedAt: Date;
}
