notification

This commit is contained in:
2026-07-09 20:58:19 +03:30
parent 0732964753
commit c485ee326c
21 changed files with 1402 additions and 1 deletions
+5
View File
@@ -22,6 +22,7 @@ import { UpdateReserveDto } from './dto/update-reserve.dto';
import { ReserveItem } from './entities/reserve-item.entity';
import { ReserveStatusHistory } from './entities/reserve-status-history.entity';
import { Reserve } from './entities/reserve.entity';
import { SalonNotificationsService } from '../notifications/salon-notifications.service';
import { ReserveSmsService } from '../sms-settings/reserve-sms.service';
import { ReserveStatus } from './enums/reserve-status.enum';
@@ -44,6 +45,7 @@ export class ReservesService {
private readonly authorizationService: AuthorizationService,
private readonly reservePolicy: ReservePolicy,
private readonly reserveSmsService: ReserveSmsService,
private readonly salonNotificationsService: SalonNotificationsService,
private readonly servicesService: ServicesService,
) {}
@@ -103,6 +105,7 @@ export class ReservesService {
await this.customersService.linkToSalon(saved.salonId, saved.customerId);
await this.logStatusChange(saved.id, null, saved.status, user.id);
await this.reserveSmsService.sendReserveCreated(saved.id);
await this.salonNotificationsService.notifyReserveCreated(saved.id);
return this.findOne(saved.id, user);
}
@@ -262,6 +265,7 @@ export class ReservesService {
previousStatus !== ReserveStatus.CANCELLED
) {
await this.reserveSmsService.sendReserveCancelled(reserve.id);
await this.salonNotificationsService.notifyReserveCancelled(reserve.id);
}
return this.findOne(id, user);
@@ -314,6 +318,7 @@ export class ReservesService {
reserve.status = ReserveStatus.CONFIRMED;
await this.reservesRepository.save(reserve);
await this.reserveSmsService.sendReserveConfirmed(reserve.id);
await this.salonNotificationsService.notifyReserveConfirmed(reserve.id);
}
private async logStatusChange(