mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 19:30:57 +00:00
13 lines
703 B
TypeScript
13 lines
703 B
TypeScript
import { IsEnum, IsNumber, IsPositive, IsOptional, IsString } from 'class-validator';
|
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { Type } from 'class-transformer';
|
|
import { Currency } from '@prisma/client';
|
|
|
|
export class UpsertExchangeRateDto {
|
|
@ApiProperty({ enum: Currency, example: 'ETB' }) @IsEnum(Currency) fromCurrency: Currency;
|
|
@ApiProperty({ enum: Currency, example: 'DJF' }) @IsEnum(Currency) toCurrency: Currency;
|
|
@ApiProperty({ example: 3.25 }) @Type(() => Number) @IsNumber() @IsPositive() rate: number;
|
|
@ApiPropertyOptional({ example: 'MANUAL', description: 'Source label e.g. MANUAL, EXTERNAL_API' })
|
|
@IsOptional() @IsString() source?: string;
|
|
}
|