mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
booking flow,summtion, approval, contract, mock payemnt and integration to back office, and also add permissions
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class BookingListSummaryMetricsDto {
|
||||
@ApiProperty({ example: 42 })
|
||||
inQueue!: number;
|
||||
|
||||
@ApiProperty({ example: 10 })
|
||||
onThisPage!: number;
|
||||
|
||||
@ApiProperty({ example: 8 })
|
||||
needsAction!: number;
|
||||
|
||||
@ApiProperty({ example: 3 })
|
||||
urgent!: number;
|
||||
}
|
||||
|
||||
export class BookingListSummaryTabsDto {
|
||||
@ApiProperty() all!: number;
|
||||
@ApiProperty() intake!: number;
|
||||
@ApiProperty() in_approval!: number;
|
||||
@ApiProperty() approved_contract!: number;
|
||||
@ApiProperty() payment!: number;
|
||||
@ApiProperty() operations!: number;
|
||||
@ApiProperty() completed!: number;
|
||||
@ApiProperty() closed!: number;
|
||||
}
|
||||
|
||||
export class BookingListSummaryDto {
|
||||
@ApiProperty({ type: BookingListSummaryMetricsDto })
|
||||
metrics!: BookingListSummaryMetricsDto;
|
||||
|
||||
@ApiProperty({ type: BookingListSummaryTabsDto })
|
||||
tabs!: BookingListSummaryTabsDto;
|
||||
}
|
||||
@@ -14,6 +14,18 @@ export class FilterBookingDto {
|
||||
@IsIn([...BOOKING_STATUSES])
|
||||
status?: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
'Filter by statuses: comma-separated (PENDING_APPROVAL,APPROVED) or repeated query params. Overrides status when set.',
|
||||
})
|
||||
@IsOptional()
|
||||
@Transform(({ value }) => {
|
||||
if (value === undefined || value === null || value === '') return undefined;
|
||||
if (Array.isArray(value)) return value.map(String).join(',');
|
||||
return String(value);
|
||||
})
|
||||
statuses?: string;
|
||||
|
||||
// @ApiPropertyOptional({ format: 'uuid' })
|
||||
// @IsOptional()
|
||||
// @IsUUID()
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class InAppPaymentReceiptDto {
|
||||
@ApiProperty({ example: true })
|
||||
success!: boolean;
|
||||
|
||||
@ApiProperty({ example: 'TELEBIRR' })
|
||||
provider!: string;
|
||||
|
||||
@ApiProperty({ example: 'TB-BK-2026-000123-1717584000000' })
|
||||
providerRef!: string;
|
||||
|
||||
@ApiProperty({ example: 15000 })
|
||||
amount!: number;
|
||||
|
||||
@ApiProperty({ example: 'ETB' })
|
||||
currency!: string;
|
||||
|
||||
@ApiProperty({ example: '2026-06-05T12:00:00.000Z' })
|
||||
paidAt!: string;
|
||||
}
|
||||
|
||||
export class PayBookingResponseDto {
|
||||
@ApiProperty({ type: InAppPaymentReceiptDto })
|
||||
paymentReceipt!: InAppPaymentReceiptDto;
|
||||
}
|
||||
@@ -34,9 +34,3 @@ export class CancelBookingDto {
|
||||
@MinLength(1)
|
||||
reason!: string;
|
||||
}
|
||||
|
||||
export class BankCallbackDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
pnrCode!: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user