get subscription in admin

This commit is contained in:
2026-07-08 22:23:14 +03:30
parent 3250a6456b
commit 1dd2813a01
34 changed files with 188 additions and 119 deletions
+6 -7
View File
@@ -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,