Files
yara724api/src/auth/dto/actor/profile.actor.dto.ts

97 lines
2.1 KiB
TypeScript

import { ApiProperty } from "@nestjs/swagger";
import { IsMobilePhone, IsString, Length } from "class-validator";
import { DamageExpertModel } from "src/users/entities/schema/damage-expert.schema";
export class ProfileActor {
public email: string;
public fullName: string;
public nationalCode: string;
public insuActivityCo: string;
public userType: string;
public mobile: string;
public address: string;
public state: string;
public city: string;
public phone?: string;
constructor(Profile: DamageExpertModel) {
this.email = Profile?.email;
this.fullName = `${Profile?.firstName} ${Profile?.lastName}`;
this.nationalCode = Profile?.nationalCode;
this.insuActivityCo = Profile?.insuActivityCo;
this.userType = Profile?.userType;
this.mobile = Profile?.mobile;
this.address = Profile?.address;
this.state = Profile?.state;
this.city = Profile?.city;
this.phone = Profile?.phone;
}
}
export class ActorEditUserProfileDto {
@ApiProperty({
type: "string",
description: "First name of the actor",
example: "heshmat",
nullable: true,
})
@IsString()
@Length(2, 40)
firstName?: string;
@ApiProperty({
type: "string",
description: "Last name of the actor",
example: "Heshmati",
nullable: true,
})
@IsString()
@Length(1, 10)
lastName?: string;
@ApiProperty({
type: "string",
description: "Mobile phone of the actor",
example: "09123456789",
nullable: true,
})
@IsMobilePhone("fa-IR")
mobile?: string;
@ApiProperty({
type: "string",
description: "تلفن خط ثابت",
example: "02122222222",
nullable: true,
})
@IsString()
phone?: string;
@ApiProperty({
type: "string",
description: "City of the user",
example: "استان",
nullable: true,
})
@IsString()
city?: string;
@ApiProperty({
type: "string",
description: "State of the user",
example: "شهر",
nullable: true,
})
@IsString()
state?: string;
@ApiProperty({
type: "string",
description: "Address of the user",
example: "آدرس",
nullable: true,
})
@IsString()
address?: string;
}