forked from Stellar-Uzima/Uzima-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreward.controller.ts
More file actions
24 lines (22 loc) 路 918 Bytes
/
Copy pathreward.controller.ts
File metadata and controls
24 lines (22 loc) 路 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Controller, Get, Query, UseGuards } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
import { RewardService } from './reward.service';
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
import { GetUser } from '../auth/decorators/get-user.decorator';
import { PayoutHistoryQueryDto } from './dto/payout-history-query.dto';
@ApiTags('Rewards')
@ApiBearerAuth()
@Controller('rewards')
@UseGuards(JwtAuthGuard)
export class RewardController {
constructor(private readonly rewardService: RewardService) {}
@Get('payouts')
@ApiOperation({ summary: 'Get XLM reward payout history' })
@ApiResponse({ status: 200, description: 'Returns paginated payout records' })
async getPayouts(
@GetUser('id') userId: string,
@Query() query: PayoutHistoryQueryDto,
) {
return this.rewardService.getRewardHistory(userId, query);
}
}