chore: change the real user abd legal user data

This commit is contained in:
mahyargdz
2025-03-02 17:59:02 +03:30
parent c559fdb9e8
commit 0da12b89eb
13 changed files with 203 additions and 187 deletions
@@ -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" })