Enhance weekly summary functionality to accept optional date range parameters in CardService, TransactionService, JuniorService, and JuniorController. Update API documentation to reflect new query parameters for start and end dates.

This commit is contained in:
Abdalhamid Alhamad
2025-10-28 11:20:49 +03:00
parent bbeece9e03
commit 05a6ad2d84
4 changed files with 27 additions and 8 deletions

View File

@ -212,7 +212,7 @@ export class JuniorService {
this.logger.log(`Junior ${juniorId} deleted successfully`);
}
async getWeeklySummary(juniorId: string, guardianId: string) {
async getWeeklySummary(juniorId: string, guardianId: string, startDate?: Date, endDate?: Date) {
const doesBelong = await this.doesJuniorBelongToGuardian(guardianId, juniorId);
if (!doesBelong) {
@ -221,7 +221,7 @@ export class JuniorService {
}
this.logger.log(`Getting weekly summary for junior ${juniorId}`);
return this.cardService.getWeeklySummary(juniorId);
return this.cardService.getWeeklySummary(juniorId, startDate, endDate);
}
async getJuniorHome(juniorId: string, userId: string, size: number): Promise<JuniorHomeResponseDto> {