chore: update referral logic

This commit is contained in:
mahyargdz
2025-04-15 15:50:31 +03:30
parent bd4d9dbf0d
commit fb8f16deb4
19 changed files with 234 additions and 262 deletions
@@ -1,26 +1,33 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsEmail, IsNotEmpty, IsString } from "class-validator";
import { IsEmail, IsMobilePhone, IsNotEmpty, IsString, Length } from "class-validator";
import { ContactUsMessage } from "../../../common/enums/message.enum";
import { AuthMessage, ContactUsMessage } from "../../../common/enums/message.enum";
export class CreateContactUsDto {
@IsNotEmpty({ message: ContactUsMessage.FULLNAME_IS_REQUIRED })
@IsString({ message: ContactUsMessage.FULLNAME_STRING })
@ApiProperty({ description: "full name of person need to create contact us", example: "متین جمشیدی" })
@ApiProperty({ description: "Full name of the person creating the contact request", example: "mahyar gdz" })
fullName: string;
@IsNotEmpty({ message: ContactUsMessage.FULLNAME_STRING })
@IsEmail()
@ApiProperty({ description: "email of person need to contact us", example: "matin@gmail.com" })
@IsNotEmpty({ message: AuthMessage.EMAIL_NOT_EMPTY })
@IsEmail({}, { message: AuthMessage.INVALID_EMAIL_FORMAT })
@ApiProperty({ description: "Email address", example: "ma@gmail.com" })
email: string;
@IsNotEmpty({ message: ContactUsMessage.TITLE_IS_REQUIRED })
@IsString({ message: ContactUsMessage.TITLE_STRING })
@ApiProperty({ description: "title of contact us", example: "عنوان پیام" })
title: string;
@IsNotEmpty({ message: AuthMessage.PHONE_NOT_EMPTY })
@IsMobilePhone("fa-IR", {}, { message: AuthMessage.INVALID_PHONE_FORMAT })
@Length(11, 11, { message: AuthMessage.PHONE_SHOULD_BE_11_DIGIT })
@ApiProperty({ description: "Phone number", default: "09922320740" })
phone: string;
@IsNotEmpty({ message: ContactUsMessage.BUSINESS_NAME_IS_REQUIRED })
@IsString({ message: ContactUsMessage.BUSINESS_NAME_STRING })
@Length(2, 100, { message: ContactUsMessage.BUSINESS_NAME_LENGTH })
@ApiProperty({ description: "Business name", example: "Tech Corp" })
businessName: string;
@IsNotEmpty({ message: ContactUsMessage.CONTENT_IS_REQUIRED })
@IsString({ message: ContactUsMessage.CONTENT_STRING })
@ApiProperty({ description: "content of contact us", example: "متن پیام" })
@ApiProperty({ description: "Content of the contact request", example: "متن پیام" })
content: string;
}