93 lines
1.9 KiB
TypeScript
93 lines
1.9 KiB
TypeScript
// src/modules/host/dto/host.dto.ts
|
|
import { IsInt, IsOptional, IsString, IsBoolean, IsEmail } from 'class-validator';
|
|
|
|
export class CreateHostDto {
|
|
@IsString()
|
|
firstName: string;
|
|
|
|
@IsString()
|
|
lastName: string;
|
|
|
|
@IsEmail()
|
|
emailAddress: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
isdCode?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
mobileNumber?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
userPassword?: string;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
roleXid?: number;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isActive?: boolean;
|
|
}
|
|
|
|
export class UpdateHostDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
firstName?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
lastName?: string;
|
|
|
|
@IsOptional()
|
|
@IsEmail()
|
|
emailAddress?: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isActive?: boolean;
|
|
}
|
|
|
|
export class GetHostLoginResponseDTO {
|
|
id: number;
|
|
firstName: string | null;
|
|
lastName: string | null;
|
|
emailAddress: string;
|
|
mobileNumber: string | null;
|
|
isActive: boolean;
|
|
roleXid: number;
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
|
|
constructor(user: any, accessToken: string, refreshToken: string) {
|
|
this.id = user.id;
|
|
this.firstName = user.firstName;
|
|
this.lastName = user.lastName;
|
|
this.emailAddress = user.emailAddress;
|
|
this.mobileNumber = user.mobileNumber;
|
|
this.isActive = user.isActive;
|
|
this.roleXid = user.roleXid;
|
|
this.accessToken = accessToken;
|
|
this.refreshToken = refreshToken;
|
|
}
|
|
}
|
|
|
|
export class AddPaymentDetailsDTO {
|
|
bankXid: number;
|
|
bankBranchXid: number;
|
|
accountNumber: string;
|
|
accountHolderName: string;
|
|
ifscCode: string;
|
|
hostXid: number;
|
|
|
|
constructor(bankXid: number, bankBranchXid: number, accountNumber: string, accountHolderName: string, ifscCode: string, hostXid: number) {
|
|
this.bankXid = bankXid;
|
|
this.bankBranchXid = bankBranchXid;
|
|
this.accountNumber = accountNumber;
|
|
this.accountHolderName = accountHolderName;
|
|
this.ifscCode = ifscCode;
|
|
this.hostXid = hostXid;
|
|
}
|
|
} |