mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 00:54:54 +00:00
feat: create card for children
This commit is contained in:
@ -1,6 +1,16 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsDateString, IsEmail, IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';
|
||||
import {
|
||||
IsDateString,
|
||||
IsEmail,
|
||||
IsEnum,
|
||||
IsNotEmpty,
|
||||
IsNumberString,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
} from 'class-validator';
|
||||
import { i18nValidationMessage as i18n } from 'nestjs-i18n';
|
||||
import { CardColors } from '~/card/enums';
|
||||
import { Gender } from '~/customer/enums';
|
||||
import { Relationship } from '~/junior/enums';
|
||||
export class CreateJuniorRequestDto {
|
||||
@ -30,6 +40,14 @@ export class CreateJuniorRequestDto {
|
||||
@IsEnum(Relationship, { message: i18n('validation.IsEnum', { path: 'general', property: 'junior.relationship' }) })
|
||||
relationship!: Relationship;
|
||||
|
||||
@ApiProperty({ enum: CardColors })
|
||||
@IsEnum(CardColors, { message: i18n('validation.IsEnum', { path: 'general', property: 'junior.cardColor' }) })
|
||||
cardColor!: CardColors;
|
||||
|
||||
@ApiProperty({ example: '1234' })
|
||||
@IsNumberString({}, { message: i18n('validation.IsEnum', { path: 'general', property: 'junior.cardPin' }) })
|
||||
cardPin!: string;
|
||||
|
||||
@ApiProperty({ example: '123e4567-e89b-12d3-a456-426614174000' })
|
||||
@IsUUID('4', { message: i18n('validation.IsUUID', { path: 'general', property: 'customer.profilePictureId' }) })
|
||||
@IsOptional()
|
||||
|
||||
Reference in New Issue
Block a user