mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 00:24:54 +00:00
16 lines
581 B
TypeScript
16 lines
581 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsNumber, IsString } from 'class-validator';
|
|
import { i18nValidationMessage as i18n } from 'nestjs-i18n';
|
|
export class CreateMoneyRequestDto {
|
|
@ApiProperty({ example: 300.42 })
|
|
@IsNumber(
|
|
{ maxDecimalPlaces: 3 },
|
|
{ message: i18n('validation.IsNumber', { path: 'general', property: 'moneyRequest.amount' }) },
|
|
)
|
|
amount!: number;
|
|
|
|
@ApiProperty({ example: 'For school supplies' })
|
|
@IsString({ message: i18n('validation.IsString', { path: 'general', property: 'moneyRequest.reason' }) })
|
|
reason!: string;
|
|
}
|