fix: bug in thre login process

This commit is contained in:
mahyargdz
2025-03-02 16:28:07 +03:30
parent 4d0344c376
commit 28486d64ee
21 changed files with 606 additions and 588 deletions
+26 -25
View File
@@ -1,37 +1,38 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsEnum, IsNotEmpty, IsOptional, IsString } from "class-validator";
import { ApiProperty } from "@nestjs/swagger";
import { IsEnum, IsInt, IsNotEmpty, IsNumberString, IsString } from "class-validator";
import { FinancialMessage } from "../../../common/enums/message.enum";
import { GenderType } from "../enums/gender-type.enum";
import { GenderEnum } from "../enums/gender-type.enum";
import { NationalityEnum } from "../enums/nationality.enum";
export class CreateRealUserDto {
@ApiPropertyOptional({ enum: GenderType, description: "Gender type" })
@IsOptional()
@IsEnum(GenderType, { message: FinancialMessage.GENDER_TYPE_INVALID })
gender?: GenderType;
@IsNotEmpty({ message: FinancialMessage.GENDER_TYPE_REQUIRED })
@IsEnum(GenderEnum)
@ApiProperty({ enum: GenderEnum, description: "Gender type", example: GenderEnum.MALE })
gender: GenderEnum;
@ApiPropertyOptional({ description: "Father name" })
@IsOptional()
@IsNotEmpty({ message: FinancialMessage.FATHER_NAME_REQUIRED })
@IsString({ message: FinancialMessage.FATHER_NAME_INVALID })
fatherName?: string;
@ApiProperty({ description: "Father name" })
fatherName: string;
@ApiPropertyOptional({ description: "nationality" })
@IsOptional()
@IsString({ message: FinancialMessage.NATIONALITY_INVALID })
nationality?: string;
@IsNotEmpty({ message: FinancialMessage.NATIONALITY_REQUIRED })
@IsEnum(NationalityEnum)
@ApiProperty({ description: "Nationality" })
nationality: string;
@ApiPropertyOptional({ description: "Address" })
@IsOptional()
@IsString({ message: FinancialMessage.ADDRESS_ID_INVALID })
address?: string;
@IsNotEmpty({ message: FinancialMessage.ADDRESS_REQUIRED })
@IsString({ message: FinancialMessage.ADDRESS_STRING })
@ApiProperty({ description: "Address" })
address: string;
@ApiPropertyOptional({ description: "PostalCode" })
@IsOptional()
@IsString({ message: FinancialMessage.ADDRESS_ID_INVALID })
postalCode?: string;
@IsNotEmpty({ message: FinancialMessage.POSTAL_CODE_REQUIRED })
@IsNumberString({ no_symbols: true }, { message: FinancialMessage.POSTAL_CODE_NUMBER_STRING })
@ApiProperty({ description: "Postal code", example: "1234567890" })
postalCode: string;
@ApiPropertyOptional({ description: "City id", example: "1" })
@IsOptional()
@IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED })
cityId: string;
@IsInt({ message: FinancialMessage.CITY_ID_INVALID })
@ApiProperty({ description: "City ID", example: "1" })
cityId: number;
}