chore: create customer
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
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 { AuthMessage, FinancialMessage } from "../../../common/enums/message.enum";
|
||||
import { AuthMessage, FinancialMessage, UserMessage } from "../../../common/enums/message.enum";
|
||||
|
||||
export class CreateCustomerDto extends PartialType(CreateLegalUserDto) {
|
||||
@IsNotEmpty({ message: AuthMessage.PHONE_NOT_EMPTY })
|
||||
@@ -84,4 +84,10 @@ export class CreateCustomerDto extends PartialType(CreateLegalUserDto) {
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: FinancialMessage.CITY_ID_REQUIRED })
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user