forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
98
src/auth/dto/actor/profile.actor.dto.ts
Normal file
98
src/auth/dto/actor/profile.actor.dto.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import { ApiProperty, ApiSchema } 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;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiSchema({
|
||||
name: "Edit Actor Profile",
|
||||
description: "Body of the request to edit the actor's profile",
|
||||
})
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user