git checkout -b ZOD-349-weekly-spending-data-not-displaying-in-the-child-profile-parent-view

This commit is contained in:
Abdalhamid Alhamad
2025-10-26 13:14:35 +03:00
parent 596562f6dc
commit bbeece9e03
2 changed files with 4 additions and 4 deletions

View File

@ -85,8 +85,8 @@ export class TransactionService {
} }
async getWeeklySummary(juniorId: string) { async getWeeklySummary(juniorId: string) {
const startOfWeek = moment().startOf('week').toDate(); const endOfWeek = moment().toDate();
const endOfWeek = moment().endOf('week').toDate(); const startOfWeek = moment().subtract(1, 'week').toDate();
const transactions = await this.transactionRepository.getTransactionsForCardWithinDateRange( const transactions = await this.transactionRepository.getTransactionsForCardWithinDateRange(
juniorId, juniorId,

View File

@ -212,8 +212,8 @@ export class JuniorService {
this.logger.log(`Junior ${juniorId} deleted successfully`); this.logger.log(`Junior ${juniorId} deleted successfully`);
} }
getWeeklySummary(juniorId: string, guardianId: string) { async getWeeklySummary(juniorId: string, guardianId: string) {
const doesBelong = this.doesJuniorBelongToGuardian(guardianId, juniorId); const doesBelong = await this.doesJuniorBelongToGuardian(guardianId, juniorId);
if (!doesBelong) { if (!doesBelong) {
this.logger.error(`Junior ${juniorId} does not belong to guardian ${guardianId}`); this.logger.error(`Junior ${juniorId} does not belong to guardian ${guardianId}`);