diff --git a/src/common/enums/message.enum.ts b/src/common/enums/message.enum.ts index ee155fe..20e9ab2 100644 --- a/src/common/enums/message.enum.ts +++ b/src/common/enums/message.enum.ts @@ -390,6 +390,8 @@ export const enum EmailMessage { export const enum FinancialMessage { GENDER_TYPE_INVALID = "نوع جنسیت باید یکی از مقادیر FEMALE یا MALE باشد", ECONOMIC_CODE_INVALID = "کد اقتصادی باید یک رشته باشد", + FATHER_NAME_INVALID = "نام پدر باید یک رشته باشد", + NATIONALITY_INVALID = "ملیت باید یک رشته باشد", REGISTRATION_ID_INVALID = "شناسه ثبت باید یک رشته باشد", ADDRESS_ID_INVALID = "ادرس باید یک رشته باشد", POSTALCODE_INVALID = "کد پستی باید یک رشته باشد", diff --git a/src/modules/users/DTO/create-legal-user.dto.ts b/src/modules/users/DTO/create-legal-user.dto.ts index 87c0479..2446dfe 100644 --- a/src/modules/users/DTO/create-legal-user.dto.ts +++ b/src/modules/users/DTO/create-legal-user.dto.ts @@ -1,5 +1,5 @@ import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; -import { IsNotEmpty, IsOptional, IsString, IsUUID } from "class-validator"; +import { IsNotEmpty, IsOptional, IsString } from "class-validator"; import { FinancialMessage } from "../../../common/enums/message.enum"; @@ -39,12 +39,6 @@ export class CreateLegalUserDto { @IsString({ message: FinancialMessage.NATIONAL_ID_INVALID }) address?: string; - @ApiPropertyOptional({ description: "User id", example: "123e4567-e89b-12d3-a456-426614174000" }) - @IsOptional() - @IsNotEmpty({ message: FinancialMessage.USER_ID_REQUIRED }) - @IsUUID("4", { message: FinancialMessage.USER_ID_SHOULD_BE_A_UUID }) - userId: string; - @ApiPropertyOptional({ description: "City id", example: "1" }) @IsOptional() @IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED }) diff --git a/src/modules/users/DTO/create-real-user.dto.ts b/src/modules/users/DTO/create-real-user.dto.ts index 6d6a66d..7caca28 100644 --- a/src/modules/users/DTO/create-real-user.dto.ts +++ b/src/modules/users/DTO/create-real-user.dto.ts @@ -1,5 +1,5 @@ import { ApiPropertyOptional } from "@nestjs/swagger"; -import { IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID } from "class-validator"; +import { IsEnum, IsNotEmpty, IsOptional, IsString } from "class-validator"; import { FinancialMessage } from "../../../common/enums/message.enum"; import { GenderType } from "../enums/gender-type.enum"; @@ -10,25 +10,15 @@ export class CreateRealUserDto { @IsEnum(GenderType, { message: FinancialMessage.GENDER_TYPE_INVALID }) gender?: GenderType; - @ApiPropertyOptional({ description: "Economic code" }) + @ApiPropertyOptional({ description: "Father name" }) @IsOptional() - @IsString({ message: FinancialMessage.ECONOMIC_CODE_INVALID }) - economicCode?: string; + @IsString({ message: FinancialMessage.FATHER_NAME_INVALID }) + fatherName?: string; - @ApiPropertyOptional({ description: "Registration ID" }) + @ApiPropertyOptional({ description: "nationality" }) @IsOptional() - @IsString({ message: FinancialMessage.REGISTRATION_ID_INVALID }) - registrationId?: string; - - @ApiPropertyOptional({ description: "number" }) - @IsOptional() - @IsString({ message: FinancialMessage.FIXED_PHONE_INVALID }) - number?: string; - - @ApiPropertyOptional({ description: "number" }) - @IsOptional() - @IsString({ message: FinancialMessage.NATIONAL_ID_INVALID }) - nationalId?: string; + @IsString({ message: FinancialMessage.NATIONALITY_INVALID }) + nationality?: string; @ApiPropertyOptional({ description: "Address" }) @IsOptional() @@ -40,12 +30,6 @@ export class CreateRealUserDto { @IsString({ message: FinancialMessage.ADDRESS_ID_INVALID }) postalCode?: string; - @ApiPropertyOptional({ description: "User id", example: "123e4567-e89b-12d3-a456-426614174000" }) - @IsOptional() - @IsNotEmpty({ message: FinancialMessage.USER_ID_REQUIRED }) - @IsUUID("4", { message: FinancialMessage.USER_ID_SHOULD_BE_A_UUID }) - userId: string; - @ApiPropertyOptional({ description: "City id", example: "1" }) @IsOptional() @IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED }) diff --git a/src/modules/users/users.module.ts b/src/modules/users/users.module.ts index c234e59..e1c9759 100644 --- a/src/modules/users/users.module.ts +++ b/src/modules/users/users.module.ts @@ -12,29 +12,24 @@ import { PermissionsRepository } from "./repositories/permissions.repository"; import { RoleRepository } from "./repositories/roles.repository"; import { UserGroupRepository } from "./repositories/user-group.repository"; import { UserRepository } from "./repositories/users.repository"; -<<<<<<< HEAD -======= -import { UsersController } from "./users.controller"; import { AddressModule } from "../address/address.module"; ->>>>>>> 5908724 (chore: create legal and real user data info) +import { AddressService } from "../address/providers/address.service"; import { UserSetting } from "../settings/entities/user-setting.entity"; import { UserSettingsService } from "../settings/providers/user-settings.service"; import { UserSettingsRepository } from "../settings/repositories/user-settings.repository"; import { WalletsModule } from "../wallets/wallets.module"; import { RealUser } from "./entities/real-user.entity"; import { RealUserRepository } from "./repositories/real-user.repository"; -<<<<<<< HEAD import { UsersController } from "./users.controller"; import { UtilsModule } from "../utils/utils.module"; @Module({ - imports: [TypeOrmModule.forFeature([User, Role, UserGroup, UserSetting, RealUser, LegalUser, Permission]), WalletsModule, UtilsModule], -======= -import { AddressService } from "../address/providers/address.service"; - -@Module({ - imports: [TypeOrmModule.forFeature([User, Role, UserGroup, UserSetting, RealUser, LegalUser]), WalletsModule, AddressModule], ->>>>>>> 5908724 (chore: create legal and real user data info) + imports: [ + TypeOrmModule.forFeature([User, Role, UserGroup, UserSetting, RealUser, LegalUser, Permission]), + WalletsModule, + UtilsModule, + AddressModule, + ], providers: [ UsersService, UserRepository,