chore: create legal and real user data info

This commit is contained in:
Matin
2025-02-17 16:01:31 +03:30
parent 8b8ddb693e
commit 0cd59e0212
4 changed files with 17 additions and 42 deletions
+2
View File
@@ -390,6 +390,8 @@ export const enum EmailMessage {
export const enum FinancialMessage { export const enum FinancialMessage {
GENDER_TYPE_INVALID = "نوع جنسیت باید یکی از مقادیر FEMALE یا MALE باشد", GENDER_TYPE_INVALID = "نوع جنسیت باید یکی از مقادیر FEMALE یا MALE باشد",
ECONOMIC_CODE_INVALID = "کد اقتصادی باید یک رشته باشد", ECONOMIC_CODE_INVALID = "کد اقتصادی باید یک رشته باشد",
FATHER_NAME_INVALID = "نام پدر باید یک رشته باشد",
NATIONALITY_INVALID = "ملیت باید یک رشته باشد",
REGISTRATION_ID_INVALID = "شناسه ثبت باید یک رشته باشد", REGISTRATION_ID_INVALID = "شناسه ثبت باید یک رشته باشد",
ADDRESS_ID_INVALID = "ادرس باید یک رشته باشد", ADDRESS_ID_INVALID = "ادرس باید یک رشته باشد",
POSTALCODE_INVALID = "کد پستی باید یک رشته باشد", POSTALCODE_INVALID = "کد پستی باید یک رشته باشد",
@@ -1,5 +1,5 @@
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; 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"; import { FinancialMessage } from "../../../common/enums/message.enum";
@@ -39,12 +39,6 @@ export class CreateLegalUserDto {
@IsString({ message: FinancialMessage.NATIONAL_ID_INVALID }) @IsString({ message: FinancialMessage.NATIONAL_ID_INVALID })
address?: string; 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" }) @ApiPropertyOptional({ description: "City id", example: "1" })
@IsOptional() @IsOptional()
@IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED }) @IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED })
+7 -23
View File
@@ -1,5 +1,5 @@
import { ApiPropertyOptional } from "@nestjs/swagger"; 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 { FinancialMessage } from "../../../common/enums/message.enum";
import { GenderType } from "../enums/gender-type.enum"; import { GenderType } from "../enums/gender-type.enum";
@@ -10,25 +10,15 @@ export class CreateRealUserDto {
@IsEnum(GenderType, { message: FinancialMessage.GENDER_TYPE_INVALID }) @IsEnum(GenderType, { message: FinancialMessage.GENDER_TYPE_INVALID })
gender?: GenderType; gender?: GenderType;
@ApiPropertyOptional({ description: "Economic code" }) @ApiPropertyOptional({ description: "Father name" })
@IsOptional() @IsOptional()
@IsString({ message: FinancialMessage.ECONOMIC_CODE_INVALID }) @IsString({ message: FinancialMessage.FATHER_NAME_INVALID })
economicCode?: string; fatherName?: string;
@ApiPropertyOptional({ description: "Registration ID" }) @ApiPropertyOptional({ description: "nationality" })
@IsOptional() @IsOptional()
@IsString({ message: FinancialMessage.REGISTRATION_ID_INVALID }) @IsString({ message: FinancialMessage.NATIONALITY_INVALID })
registrationId?: string; nationality?: 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;
@ApiPropertyOptional({ description: "Address" }) @ApiPropertyOptional({ description: "Address" })
@IsOptional() @IsOptional()
@@ -40,12 +30,6 @@ export class CreateRealUserDto {
@IsString({ message: FinancialMessage.ADDRESS_ID_INVALID }) @IsString({ message: FinancialMessage.ADDRESS_ID_INVALID })
postalCode?: string; 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" }) @ApiPropertyOptional({ description: "City id", example: "1" })
@IsOptional() @IsOptional()
@IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED }) @IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED })
+7 -12
View File
@@ -12,29 +12,24 @@ import { PermissionsRepository } from "./repositories/permissions.repository";
import { RoleRepository } from "./repositories/roles.repository"; import { RoleRepository } from "./repositories/roles.repository";
import { UserGroupRepository } from "./repositories/user-group.repository"; import { UserGroupRepository } from "./repositories/user-group.repository";
import { UserRepository } from "./repositories/users.repository"; import { UserRepository } from "./repositories/users.repository";
<<<<<<< HEAD
=======
import { UsersController } from "./users.controller";
import { AddressModule } from "../address/address.module"; 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 { UserSetting } from "../settings/entities/user-setting.entity";
import { UserSettingsService } from "../settings/providers/user-settings.service"; import { UserSettingsService } from "../settings/providers/user-settings.service";
import { UserSettingsRepository } from "../settings/repositories/user-settings.repository"; import { UserSettingsRepository } from "../settings/repositories/user-settings.repository";
import { WalletsModule } from "../wallets/wallets.module"; import { WalletsModule } from "../wallets/wallets.module";
import { RealUser } from "./entities/real-user.entity"; import { RealUser } from "./entities/real-user.entity";
import { RealUserRepository } from "./repositories/real-user.repository"; import { RealUserRepository } from "./repositories/real-user.repository";
<<<<<<< HEAD
import { UsersController } from "./users.controller"; import { UsersController } from "./users.controller";
import { UtilsModule } from "../utils/utils.module"; import { UtilsModule } from "../utils/utils.module";
@Module({ @Module({
imports: [TypeOrmModule.forFeature([User, Role, UserGroup, UserSetting, RealUser, LegalUser, Permission]), WalletsModule, UtilsModule], imports: [
======= TypeOrmModule.forFeature([User, Role, UserGroup, UserSetting, RealUser, LegalUser, Permission]),
import { AddressService } from "../address/providers/address.service"; WalletsModule,
UtilsModule,
@Module({ AddressModule,
imports: [TypeOrmModule.forFeature([User, Role, UserGroup, UserSetting, RealUser, LegalUser]), WalletsModule, AddressModule], ],
>>>>>>> 5908724 (chore: create legal and real user data info)
providers: [ providers: [
UsersService, UsersService,
UserRepository, UserRepository,