chore: create customer

This commit is contained in:
Matin
2025-02-18 12:23:09 +03:30
parent 38dc9d8e0f
commit fb0c484728
+8 -2
View File
@@ -1,8 +1,8 @@
import { ApiProperty, ApiPropertyOptional, PartialType } from "@nestjs/swagger"; import { ApiProperty, ApiPropertyOptional, PartialType } from "@nestjs/swagger";
import { IsEmail, IsMobilePhone, IsNotEmpty, IsNumberString, IsOptional, IsString, Length, MinLength } from "class-validator"; import { IsEmail, IsMobilePhone, IsNotEmpty, IsNumberString, IsOptional, IsString, IsUrl, Length, MinLength } from "class-validator";
import { CreateLegalUserDto } from "./create-legal-user.dto"; import { CreateLegalUserDto } from "./create-legal-user.dto";
import { AuthMessage, FinancialMessage } from "../../../common/enums/message.enum"; import { AuthMessage, FinancialMessage, UserMessage } from "../../../common/enums/message.enum";
export class CreateCustomerDto extends PartialType(CreateLegalUserDto) { export class CreateCustomerDto extends PartialType(CreateLegalUserDto) {
@IsNotEmpty({ message: AuthMessage.PHONE_NOT_EMPTY }) @IsNotEmpty({ message: AuthMessage.PHONE_NOT_EMPTY })
@@ -84,4 +84,10 @@ export class CreateCustomerDto extends PartialType(CreateLegalUserDto) {
@IsOptional() @IsOptional()
@IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED }) @IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED })
cityId: string; cityId: string;
@IsOptional()
@IsNotEmpty({ message: UserMessage.PROFILE_PIC_REQUIRED })
@IsUrl({ protocols: ["http", "https"], require_protocol: true }, { message: UserMessage.PROFILE_PIC_URL })
@ApiPropertyOptional({ description: "Profile picture", example: "https://www.google.com" })
profilePic: string;
} }