mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 00:54:54 +00:00
git checkout -b ZOD-204-view-spending-from-child-login
This commit is contained in:
@ -191,4 +191,31 @@ export class JuniorController {
|
||||
const res = await this.juniorService.getJuniorTransfers(juniorId, user.sub, pageNum, pageSize);
|
||||
return ResponseFactory.data(res);
|
||||
}
|
||||
|
||||
@Get(':juniorId/spending-history')
|
||||
@UseGuards(RolesGuard)
|
||||
@AllowedRoles(Roles.JUNIOR, Roles.GUARDIAN)
|
||||
@ApiQuery({ name: 'startUtc', required: true, type: String, example: '2025-01-01T00:00:00.000Z' })
|
||||
@ApiQuery({ name: 'endUtc', required: true, type: String, example: '2025-01-31T23:59:59.999Z' })
|
||||
async getSpendingHistory(
|
||||
@Param('juniorId', CustomParseUUIDPipe) juniorId: string,
|
||||
@AuthenticatedUser() user: IJwtPayload,
|
||||
@Query('startUtc') startUtc: string,
|
||||
@Query('endUtc') endUtc: string,
|
||||
) {
|
||||
const res = await this.juniorService.getSpendingHistory(juniorId, user.sub, new Date(startUtc), new Date(endUtc));
|
||||
return ResponseFactory.data(res);
|
||||
}
|
||||
|
||||
@Get(':juniorId/transactions/:transactionId')
|
||||
@UseGuards(RolesGuard)
|
||||
@AllowedRoles(Roles.JUNIOR, Roles.GUARDIAN)
|
||||
async getTransactionDetail(
|
||||
@Param('juniorId', CustomParseUUIDPipe) juniorId: string,
|
||||
@Param('transactionId', CustomParseUUIDPipe) transactionId: string,
|
||||
@AuthenticatedUser() user: IJwtPayload,
|
||||
) {
|
||||
const res = await this.juniorService.getTransactionDetail(juniorId, user.sub, transactionId);
|
||||
return ResponseFactory.data(res);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user