mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-08-26 05:49:39 +00:00

* fix: commission device API * task: add create booking API * add get All api for dashboard & mobile * add Find APIs for bookings * implement sending email updates on update bookable space * move email interfaces to separate files
89 lines
1.3 KiB
TypeScript
89 lines
1.3 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { Expose, Transform, Type } from 'class-transformer';
|
|
|
|
export class BookingUserResponseDto {
|
|
@ApiProperty()
|
|
@Expose()
|
|
uuid: string;
|
|
|
|
@ApiProperty()
|
|
@Expose()
|
|
firstName: string;
|
|
|
|
@ApiProperty()
|
|
@Expose()
|
|
lastName: string;
|
|
|
|
@ApiProperty({
|
|
type: String,
|
|
nullable: true,
|
|
})
|
|
@Expose()
|
|
email: string;
|
|
|
|
@ApiProperty({
|
|
type: String,
|
|
nullable: true,
|
|
})
|
|
@Expose()
|
|
@Transform(({ obj }) => obj.inviteUser?.companyName || null)
|
|
companyName: string;
|
|
|
|
@ApiProperty({
|
|
type: String,
|
|
nullable: true,
|
|
})
|
|
@Expose()
|
|
phoneNumber: string;
|
|
}
|
|
|
|
export class BookingSpaceResponseDto {
|
|
@ApiProperty()
|
|
@Expose()
|
|
uuid: string;
|
|
|
|
@ApiProperty()
|
|
@Expose()
|
|
spaceName: string;
|
|
}
|
|
|
|
export class BookingResponseDto {
|
|
@ApiProperty()
|
|
@Expose()
|
|
uuid: string;
|
|
|
|
@ApiProperty({
|
|
type: Date,
|
|
})
|
|
@Expose()
|
|
date: Date;
|
|
|
|
@ApiProperty()
|
|
@Expose()
|
|
startTime: string;
|
|
|
|
@ApiProperty()
|
|
@Expose()
|
|
endTime: string;
|
|
|
|
@ApiProperty({
|
|
type: Number,
|
|
})
|
|
@Expose()
|
|
cost: number;
|
|
|
|
@ApiProperty({
|
|
type: BookingUserResponseDto,
|
|
})
|
|
@Type(() => BookingUserResponseDto)
|
|
@Expose()
|
|
user: BookingUserResponseDto;
|
|
|
|
@ApiProperty({
|
|
type: BookingSpaceResponseDto,
|
|
})
|
|
@Type(() => BookingSpaceResponseDto)
|
|
@Expose()
|
|
space: BookingSpaceResponseDto;
|
|
}
|