chore: change the real user abd legal user data
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { ApiProperty, PickType } from "@nestjs/swagger";
|
||||
import { IsEnum, IsInt, IsNotEmpty, IsNumberString, IsString } from "class-validator";
|
||||
|
||||
import { 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 {
|
||||
export class CreateRealUserDto extends PickType(CompleteRegistrationDto, ["firstName", "lastName", "birthDate", "nationalCode", "phone"]) {
|
||||
@IsNotEmpty({ message: FinancialMessage.GENDER_TYPE_REQUIRED })
|
||||
@IsEnum(GenderEnum)
|
||||
@ApiProperty({ enum: GenderEnum, description: "Gender type", example: GenderEnum.MALE })
|
||||
@@ -19,8 +20,9 @@ export class CreateRealUserDto {
|
||||
@IsNotEmpty({ message: FinancialMessage.NATIONALITY_REQUIRED })
|
||||
@IsEnum(NationalityEnum)
|
||||
@ApiProperty({ description: "Nationality" })
|
||||
nationality: string;
|
||||
nationality: NationalityEnum;
|
||||
|
||||
//for address entity
|
||||
@IsNotEmpty({ message: FinancialMessage.ADDRESS_REQUIRED })
|
||||
@IsString({ message: FinancialMessage.ADDRESS_STRING })
|
||||
@ApiProperty({ description: "Address" })
|
||||
|
||||
Reference in New Issue
Block a user