forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
48
src/client/dto/create-client.dto.ts
Normal file
48
src/client/dto/create-client.dto.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { Types } from "mongoose";
|
||||
|
||||
class ClientName {
|
||||
@ApiProperty({})
|
||||
persian: string;
|
||||
|
||||
@ApiProperty({})
|
||||
english: string;
|
||||
}
|
||||
class Property {
|
||||
@ApiProperty({})
|
||||
smsApiKey: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class ClientDto {
|
||||
@ApiProperty({ required: true })
|
||||
clientName: ClientName;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
clientCode: number;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
property: Property;
|
||||
|
||||
@ApiProperty({ examples: ["legal", "genuine"] })
|
||||
useExpertMode: "legal" | "genuine";
|
||||
}
|
||||
export class ClientDtoRs {
|
||||
persian: string;
|
||||
english: string;
|
||||
clientId: Types.ObjectId;
|
||||
useExpertsMode: string;
|
||||
constructor(readonly client) {
|
||||
this.persian = client.clientName.persian;
|
||||
}
|
||||
}
|
||||
|
||||
export class ClientLists {
|
||||
name: string;
|
||||
id: Types.ObjectId;
|
||||
constructor(client: ClientDto) {
|
||||
this.name = client.clientName.persian;
|
||||
this.id = client["_id"];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user