forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
0
src/profile/dto/actor/profile.dto.ts
Normal file
0
src/profile/dto/actor/profile.dto.ts
Normal file
51
src/profile/dto/user/AddPlateDto.ts
Normal file
51
src/profile/dto/user/AddPlateDto.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { PlatesDto } from "src/plates/dto/plate.dto";
|
||||
import { Plates } from "src/Types&Enums/plate.interface";
|
||||
|
||||
export class AddPlateDto {
|
||||
plateId: string;
|
||||
@ApiProperty({ type: String, required: true })
|
||||
nationalCodeOfInsurer: string;
|
||||
|
||||
@ApiProperty({ type: String, required: true })
|
||||
nationalCodeOfDriver: string;
|
||||
|
||||
@ApiProperty({ type: String, required: true })
|
||||
insurerLicense: string;
|
||||
|
||||
@ApiProperty({ type: String, required: true })
|
||||
driverLicense: string;
|
||||
|
||||
@ApiProperty({ type: PlatesDto, required: true })
|
||||
plate: Plates;
|
||||
|
||||
@ApiProperty({ type: Boolean, required: true })
|
||||
driverIsInsurer: boolean;
|
||||
|
||||
@ApiProperty({ type: Boolean, required: true, default: false })
|
||||
isNewCar: boolean;
|
||||
|
||||
@ApiProperty({ type: Boolean, required: true })
|
||||
userNoCertificate: boolean;
|
||||
|
||||
@ApiProperty({
|
||||
type: Number,
|
||||
required: true,
|
||||
})
|
||||
insurerBirthday: number;
|
||||
@ApiProperty({
|
||||
type: String,
|
||||
required: false,
|
||||
})
|
||||
driverBirthday: string | null;
|
||||
}
|
||||
|
||||
export class AddPlateProfileDto {
|
||||
plateId: string;
|
||||
|
||||
@ApiProperty({ type: PlatesDto, required: true })
|
||||
plate: Plates;
|
||||
|
||||
@ApiProperty({ type: String, required: true })
|
||||
nationalCodeOfInsurer: string;
|
||||
}
|
||||
25
src/profile/dto/user/profile.dto.ts
Normal file
25
src/profile/dto/user/profile.dto.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { UserModel } from "src/users/entities/schema/user.schema";
|
||||
|
||||
export class ProfileUserRq {
|
||||
@ApiProperty({ required: true })
|
||||
id: string;
|
||||
}
|
||||
|
||||
export class ProfileUserRs extends UserModel {
|
||||
userId: string;
|
||||
fullName: string;
|
||||
constructor(profile: UserModel, carDetail) {
|
||||
super();
|
||||
this.userId = profile["_id"];
|
||||
this.fullName = profile.fullName;
|
||||
this.mobile = profile.mobile;
|
||||
this.plates = profile.plates || null;
|
||||
this.nationalCode = profile.nationalCode;
|
||||
this.birthDay = profile.birthDay;
|
||||
this.gender = profile.gender;
|
||||
this.plates = profile.plates;
|
||||
this.city = profile.city;
|
||||
// this.carDetail
|
||||
}
|
||||
}
|
||||
31
src/profile/dto/user/update-profile.dto.ts
Normal file
31
src/profile/dto/user/update-profile.dto.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { ApiProperty, ApiSchema } from "@nestjs/swagger";
|
||||
import { IsDateString } from "class-validator";
|
||||
|
||||
@ApiSchema({
|
||||
name: "Update user profile",
|
||||
description: "Users updates their profile via this API.",
|
||||
})
|
||||
export class UpdateUserProfileDtoRq {
|
||||
// @ApiProperty({})
|
||||
// mobile: string;
|
||||
@ApiProperty({
|
||||
type: "string",
|
||||
description: "Birth date of the user",
|
||||
example: "1999-03-05",
|
||||
nullable: true,
|
||||
})
|
||||
@IsDateString()
|
||||
birthDay: string;
|
||||
|
||||
@ApiProperty()
|
||||
gender?: "male" | "female";
|
||||
|
||||
@ApiProperty()
|
||||
city: string;
|
||||
|
||||
@ApiProperty()
|
||||
state: string;
|
||||
|
||||
@ApiProperty()
|
||||
address: string;
|
||||
}
|
||||
Reference in New Issue
Block a user