salon's services
This commit is contained in:
@@ -13,6 +13,7 @@ import { CustomersService } from '../customers/customers.service';
|
||||
import { SalonsService } from '../salons/salons.service';
|
||||
import { ServiceSkill } from '../services/entities/service-skill.entity';
|
||||
import { Service } from '../services/entities/service.entity';
|
||||
import { ServicesService } from '../services/services.service';
|
||||
import { StylistsService } from '../stylists/stylists.service';
|
||||
import { UserRole } from '../users/enums/user-role.enum';
|
||||
import { CreateReserveDto } from './dto/create-reserve.dto';
|
||||
@@ -43,6 +44,7 @@ export class ReservesService {
|
||||
private readonly authorizationService: AuthorizationService,
|
||||
private readonly reservePolicy: ReservePolicy,
|
||||
private readonly reserveSmsService: ReserveSmsService,
|
||||
private readonly servicesService: ServicesService,
|
||||
) {}
|
||||
|
||||
async create(
|
||||
@@ -76,6 +78,10 @@ export class ReservesService {
|
||||
createReserveDto.depositAmount,
|
||||
);
|
||||
await this.validateItems(createReserveDto.items);
|
||||
await this.servicesService.ensureSalonOffersServices(
|
||||
createReserveDto.salonId,
|
||||
createReserveDto.items.map((item) => item.serviceId),
|
||||
);
|
||||
|
||||
const reserve = this.reservesRepository.create({
|
||||
salonId: createReserveDto.salonId,
|
||||
|
||||
Reference in New Issue
Block a user