chore: discount module

This commit is contained in:
Matin
2025-02-16 16:30:17 +03:30
parent 6785b3e9d0
commit 20d6c5b294
31 changed files with 1752 additions and 141 deletions
@@ -0,0 +1,38 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID } from "class-validator";
import { FinancialMessage } from "../../../common/enums/message.enum";
import { GenderType } from "../enums/gender-type.enum";
export class CreateFinancialDto {
@ApiPropertyOptional({ enum: GenderType, description: "Gender type" })
@IsOptional()
@IsEnum(GenderType, { message: FinancialMessage.GENDER_TYPE_INVALID })
gender?: GenderType;
@ApiPropertyOptional({ description: "Economic code" })
@IsOptional()
@IsString({ message: FinancialMessage.ECONOMIC_CODE_INVALID })
economicCode?: string;
@ApiPropertyOptional({ description: "Registration ID" })
@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;
@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;
}