order sms

This commit is contained in:
2026-07-10 13:55:59 +03:30
parent 42f08397a2
commit 33f0afaf10
2 changed files with 11 additions and 1 deletions
@@ -19,6 +19,7 @@ import { ReserveStatus } from '../reserves/enums/reserve-status.enum';
import { ReservesService } from '../reserves/reserves.service';
import { calculateSmsParts } from '../sms/helpers/sms-segment.helper';
import { SmsService } from '../sms/sms.service';
import { ReserveSmsService } from '../sms-settings/reserve-sms.service';
import { SmsDispatchService } from '../sms-settings/sms-dispatch.service';
import { SmsScenarioKey } from '../sms-settings/enums/sms-scenario-key.enum';
import { buildReserveSmsVariables } from '../sms-settings/utils/build-reserve-sms-variables.util';
@@ -49,6 +50,7 @@ export class CardToCardDepositService {
private readonly authorizationService: AuthorizationService,
private readonly salonFinancialSettingsService: SalonFinancialSettingsService,
private readonly uploaderService: UploaderService,
private readonly reserveSmsService: ReserveSmsService,
private readonly smsDispatchService: SmsDispatchService,
private readonly smsService: SmsService,
private readonly shortLinksService: ShortLinksService,
@@ -146,6 +148,10 @@ export class CardToCardDepositService {
const variables = buildReserveSmsVariables(reserve);
const mobile = reserve.customer?.user?.mobile;
if (mobile) {
if (!existingPending) {
await this.reserveSmsService.sendReserveCreated(reserve.id);
}
await this.sendDepositSms(
SmsScenarioKey.DEPOSIT_PAYMENT_REQUEST,
mobile,
+5 -1
View File
@@ -104,7 +104,11 @@ export class ReservesService {
const saved = await this.reservesRepository.save(reserve);
await this.customersService.linkToSalon(saved.salonId, saved.customerId);
await this.logStatusChange(saved.id, null, saved.status, user.id);
await this.reserveSmsService.sendReserveCreated(saved.id);
// When a deposit is required, the reserve-created SMS is sent from the
// deposit request flow so it always arrives before the payment link SMS.
if (saved.depositAmount <= 0) {
await this.reserveSmsService.sendReserveCreated(saved.id);
}
await this.salonNotificationsService.notifyReserveCreated(saved.id);
return this.findOne(saved.id, user);
}