mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 08:34:55 +00:00
feat: money requests
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user