mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-10-23 08:37:57 +00:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47b825c4b2 | ||
|
|
6a250efd5e | ||
|
|
604cb7ce25 | ||
|
|
ef5572440c | ||
|
|
64623c7cea | ||
|
|
4ca8123a67 | ||
|
|
e734060c52 | ||
|
|
5e6c8d96de | ||
|
|
0f56381703 | ||
|
|
887bd20217 | ||
|
|
2e21acac7f | ||
|
|
652359b1bf | ||
|
|
2d6524be9f | ||
|
|
3ab00dfc29 | ||
|
|
11b2b25adc | ||
|
|
ed8cf4b4f8 | ||
|
|
98f6aaf01f | ||
|
|
16f8756b74 | ||
|
|
f849003142 |
@@ -92,7 +92,9 @@ export class TransactionRepository {
|
||||
return this.transactionRepository
|
||||
.createQueryBuilder('transaction')
|
||||
.innerJoinAndSelect('transaction.card', 'card')
|
||||
.where('card.customerId = :juniorId', { juniorId })
|
||||
.innerJoin('card.customer', 'customer')
|
||||
.innerJoin('customer.junior', 'junior')
|
||||
.where('junior.id = :juniorId', { juniorId })
|
||||
.andWhere('transaction.transactionScope = :scope', { scope: TransactionScope.CARD })
|
||||
.andWhere('transaction.transactionType = :type', { type: TransactionType.EXTERNAL })
|
||||
.andWhere('transaction.transactionDate BETWEEN :startDate AND :endDate', { startDate, endDate })
|
||||
@@ -153,7 +155,9 @@ export class TransactionRepository {
|
||||
.createQueryBuilder('tx')
|
||||
.innerJoinAndSelect('tx.card', 'card')
|
||||
.innerJoinAndSelect('card.account', 'account')
|
||||
.where('card.customerId = :juniorId', { juniorId })
|
||||
.innerJoin('card.customer', 'customer')
|
||||
.innerJoin('customer.junior', 'junior')
|
||||
.where('junior.id = :juniorId', { juniorId })
|
||||
.andWhere('tx.transactionScope = :scope', { scope: TransactionScope.CARD })
|
||||
.andWhere('tx.transactionType = :type', { type: TransactionType.INTERNAL })
|
||||
.orderBy('tx.transactionDate', 'DESC')
|
||||
@@ -166,7 +170,9 @@ export class TransactionRepository {
|
||||
return this.transactionRepository
|
||||
.createQueryBuilder('tx')
|
||||
.innerJoin('tx.card', 'card')
|
||||
.where('card.customerId = :juniorId', { juniorId })
|
||||
.innerJoin('card.customer', 'customer')
|
||||
.innerJoin('customer.junior', 'junior')
|
||||
.where('junior.id = :juniorId', { juniorId })
|
||||
.andWhere('tx.transactionScope = :scope', { scope: TransactionScope.CARD })
|
||||
.andWhere('tx.transactionType = :type', { type: TransactionType.INTERNAL })
|
||||
.getCount();
|
||||
@@ -176,8 +182,10 @@ export class TransactionRepository {
|
||||
return this.transactionRepository
|
||||
.createQueryBuilder('tx')
|
||||
.innerJoinAndSelect('tx.card', 'card')
|
||||
.innerJoin('card.customer', 'customer')
|
||||
.innerJoin('customer.junior', 'junior')
|
||||
.where('tx.id = :transactionId', { transactionId })
|
||||
.andWhere('card.customerId = :juniorId', { juniorId })
|
||||
.andWhere('junior.id = :juniorId', { juniorId })
|
||||
.getOne();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { I18nService } from 'nestjs-i18n';
|
||||
import { Roles } from '~/auth/enums';
|
||||
import { NotificationFactory, NotificationPreferences } from '../services/notification-factory.service';
|
||||
import { UserService } from '~/user/services/user.service';
|
||||
import { NOTIFICATION_EVENTS } from '../constants/event-names.constant';
|
||||
@@ -25,14 +24,6 @@ export class ProfileNotificationListener {
|
||||
try {
|
||||
const { user, updatedFields } = event;
|
||||
|
||||
// Do not notify when a child updates their profile (no notification to child or parent)
|
||||
if (user?.roles?.includes(Roles.JUNIOR)) {
|
||||
this.logger.log(
|
||||
`Skipping profile updated notification for child user ${user.id} - no notification sent`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.log(
|
||||
`Processing profile updated notification for user ${user.id} - Updated fields: ${updatedFields.join(', ')}`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user