chore: add all notification sewrvice to the queue
This commit is contained in:
@@ -9,7 +9,7 @@ import { DataSource, Not, QueryRunner } from "typeorm";
|
||||
|
||||
import { PaginationDto } from "../../../common/DTO/pagination.dto";
|
||||
import { CommonMessage, PaymentMessage, UserMessage, WalletMessage } from "../../../common/enums/message.enum";
|
||||
import { NotificationsService } from "../../notifications/providers/notifications.service";
|
||||
import { NotificationQueue } from "../../notifications/queue/notification.queue";
|
||||
import { ReferralRewardStatus } from "../../referrals/enums/referral-reward-status.enum";
|
||||
import { ReferralStatus } from "../../referrals/enums/referral-status.enum";
|
||||
import { ReferralsService } from "../../referrals/providers/referrals.service";
|
||||
@@ -43,7 +43,7 @@ export class PaymentsService {
|
||||
private readonly logger = new Logger(PaymentsService.name);
|
||||
constructor(
|
||||
@InjectQueue(PAYMENT.QUEUE_NAME) private readonly paymentQueue: Queue,
|
||||
private readonly notificationsService: NotificationsService,
|
||||
private readonly notificationQueue: NotificationQueue,
|
||||
private readonly configService: ConfigService,
|
||||
private readonly gatewayFactory: PaymentGatewayFactory,
|
||||
private readonly paymentGatewaysRepository: PaymentGatewaysRepository,
|
||||
@@ -185,18 +185,14 @@ export class PaymentsService {
|
||||
const additionalParams: Record<string, string> = {};
|
||||
|
||||
//
|
||||
await this.notificationsService.createWalletChargeNotification(
|
||||
payment.user.id,
|
||||
{
|
||||
amount: new Decimal(payment.amount).toNumber(),
|
||||
balance: new Decimal(wallet.balance).toNumber(),
|
||||
date: payment.createdAt,
|
||||
reason: WalletMessage.DEPOSIT_WALLET_IPG,
|
||||
userPhone: payment.user.phone,
|
||||
userEmail: payment.user.email,
|
||||
},
|
||||
queryRunner,
|
||||
);
|
||||
await this.notificationQueue.addWalletChargeNotification(payment.user.id, {
|
||||
amount: new Decimal(payment.amount).toNumber(),
|
||||
balance: new Decimal(wallet.balance).toNumber(),
|
||||
date: payment.createdAt,
|
||||
reason: WalletMessage.DEPOSIT_WALLET_IPG,
|
||||
userPhone: payment.user.phone,
|
||||
userEmail: payment.user.email,
|
||||
});
|
||||
|
||||
return {
|
||||
status: PaymentStatus.COMPLETED,
|
||||
|
||||
Reference in New Issue
Block a user