get subscription in admin
This commit is contained in:
@@ -65,7 +65,10 @@ export class ReservesService {
|
||||
throw new ForbiddenException();
|
||||
}
|
||||
|
||||
this.validateTimeRange(createReserveDto.startTime, createReserveDto.endTime);
|
||||
this.validateTimeRange(
|
||||
createReserveDto.startTime,
|
||||
createReserveDto.endTime,
|
||||
);
|
||||
this.validateAmounts(
|
||||
createReserveDto.totalAmount,
|
||||
createReserveDto.depositAmount,
|
||||
@@ -319,9 +322,7 @@ export class ReservesService {
|
||||
|
||||
private validateAmounts(totalAmount: number, depositAmount: number): void {
|
||||
if (depositAmount > totalAmount) {
|
||||
throw new BadRequestException(
|
||||
'depositAmount cannot exceed totalAmount',
|
||||
);
|
||||
throw new BadRequestException('depositAmount cannot exceed totalAmount');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,9 +330,7 @@ export class ReservesService {
|
||||
return time.length === 5 ? `${time}:00` : time;
|
||||
}
|
||||
|
||||
private async validateItems(
|
||||
items: CreateReserveDto['items'],
|
||||
): Promise<void> {
|
||||
private async validateItems(items: CreateReserveDto['items']): Promise<void> {
|
||||
for (const item of items) {
|
||||
const serviceExists = await this.servicesRepository.existsBy({
|
||||
id: item.serviceId,
|
||||
|
||||
Reference in New Issue
Block a user