update: remove birthday and national code
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { ApiProperty, PickType } from "@nestjs/swagger";
|
||||
import { IsEnum, IsInt, IsNotEmpty, IsNumberString, IsString } from "class-validator";
|
||||
import { IsEnum, IsInt, IsNotEmpty, IsNumberString, IsString, Length } from "class-validator";
|
||||
|
||||
import { FinancialMessage } from "../../../common/enums/message.enum";
|
||||
import { IsNationalCode } from "../../../common/decorators/is-national-code.decorator";
|
||||
import { AuthMessage, FinancialMessage } from "../../../common/enums/message.enum";
|
||||
import { CompleteRegistrationDto } from "../../auth/DTO/complete-register.dto";
|
||||
import { GenderEnum } from "../enums/gender-type.enum";
|
||||
import { NationalityEnum } from "../enums/nationality.enum";
|
||||
|
||||
export class CreateRealUserDto extends PickType(CompleteRegistrationDto, ["firstName", "lastName", "birthDate", "nationalCode", "phone"]) {
|
||||
export class CreateRealUserDto extends PickType(CompleteRegistrationDto, ["firstName", "lastName", "phone"]) {
|
||||
@IsNotEmpty({ message: FinancialMessage.GENDER_TYPE_REQUIRED })
|
||||
@IsEnum(GenderEnum)
|
||||
@ApiProperty({ enum: GenderEnum, description: "Gender type", example: GenderEnum.MALE })
|
||||
@@ -22,6 +23,18 @@ export class CreateRealUserDto extends PickType(CompleteRegistrationDto, ["first
|
||||
@ApiProperty({ description: "Nationality" })
|
||||
nationality: NationalityEnum;
|
||||
|
||||
@IsNotEmpty({ message: AuthMessage.BIRTH_DATE_NOT_EMPTY })
|
||||
@IsString({ message: AuthMessage.BIRTH_DATE_NOT_EMPTY })
|
||||
@ApiProperty({ description: "Birth date", example: "1403/01/01" })
|
||||
birthDate: string;
|
||||
|
||||
@IsNotEmpty({ message: AuthMessage.NATIONAL_NOT_EMPTY })
|
||||
@IsNumberString({ no_symbols: true }, { message: AuthMessage.NATIONAL_CODE_INCORRECT })
|
||||
@Length(10, 10, { message: AuthMessage.NATIONAL_CODE_INCORRECT })
|
||||
@IsNationalCode({ message: AuthMessage.NATIONAL_CODE_INVALID })
|
||||
@ApiProperty({ description: "iranian format (10 char)", example: "4569852169" })
|
||||
nationalCode: string;
|
||||
|
||||
//for address entity
|
||||
@IsNotEmpty({ message: FinancialMessage.ADDRESS_REQUIRED })
|
||||
@IsString({ message: FinancialMessage.ADDRESS_STRING })
|
||||
|
||||
Reference in New Issue
Block a user