mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 00:24:54 +00:00
Compare commits
2 Commits
596562f6dc
...
5649d24724
| Author | SHA1 | Date | |
|---|---|---|---|
| 5649d24724 | |||
| bbeece9e03 |
@ -85,8 +85,8 @@ export class TransactionService {
|
||||
}
|
||||
|
||||
async getWeeklySummary(juniorId: string) {
|
||||
const startOfWeek = moment().startOf('week').toDate();
|
||||
const endOfWeek = moment().endOf('week').toDate();
|
||||
const endOfWeek = moment().toDate();
|
||||
const startOfWeek = moment().subtract(1, 'week').toDate();
|
||||
|
||||
const transactions = await this.transactionRepository.getTransactionsForCardWithinDateRange(
|
||||
juniorId,
|
||||
|
||||
@ -212,8 +212,8 @@ export class JuniorService {
|
||||
this.logger.log(`Junior ${juniorId} deleted successfully`);
|
||||
}
|
||||
|
||||
getWeeklySummary(juniorId: string, guardianId: string) {
|
||||
const doesBelong = this.doesJuniorBelongToGuardian(guardianId, juniorId);
|
||||
async getWeeklySummary(juniorId: string, guardianId: string) {
|
||||
const doesBelong = await this.doesJuniorBelongToGuardian(guardianId, juniorId);
|
||||
|
||||
if (!doesBelong) {
|
||||
this.logger.error(`Junior ${juniorId} does not belong to guardian ${guardianId}`);
|
||||
|
||||
Reference in New Issue
Block a user