withdraw request
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Controller, Get, Post, Body, Delete, Param, Query } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Body, Delete, Param, Query, Patch } from '@nestjs/common';
|
||||
import { ResellerService } from './reseller.service';
|
||||
import { ApiOperation } from '@nestjs/swagger';
|
||||
import { PermissionsDec } from '../../common/decorators/permission.decorator';
|
||||
@@ -17,6 +17,7 @@ import { WalletsService } from '../wallets/providers/wallets.service';
|
||||
import { CreateWithdrawRequestDto } from './dto/create-withdraw-request.dto';
|
||||
import { CreateUserBankAccountDto } from './dto/create-user-bank-account.dto';
|
||||
import { ResellerType } from '../auth/DTO/verify-reseller-otp.dto';
|
||||
import { ConfirmwithdrawRequestDto } from './dto/confirm-withdraw-request.dto';
|
||||
|
||||
@Controller('reseller')
|
||||
@AuthGuards()
|
||||
@@ -45,12 +46,20 @@ export class ResellerController {
|
||||
|
||||
//=========== Reward Requests =========
|
||||
|
||||
@ApiOperation({ summary: "get reseller reward requests ==> admin route" })
|
||||
@ApiOperation({ summary: "get withdraw requests ==> admin route" })
|
||||
@AdminRoute()
|
||||
@PermissionsDec(PermissionEnum.RESELLER)
|
||||
@Get('reward/request')
|
||||
getRewardRequests() {
|
||||
return this.resellerService.findAll()
|
||||
@Get('withdraw-request/admin')
|
||||
getRewardRequests(@Query() query: SearchWithdrawRequestQueryDto) {
|
||||
return this.resellerService.getwithdrawRequestsForAdmin(query)
|
||||
}
|
||||
|
||||
@ApiOperation({ summary: "get withdraw requests ==> admin route" })
|
||||
@AdminRoute()
|
||||
@PermissionsDec(PermissionEnum.RESELLER)
|
||||
@Patch('withdraw-request/:id')
|
||||
confirmWithdrawRequests(@Param('id') requestId: string, @Body() dto: ConfirmwithdrawRequestDto) {
|
||||
return this.resellerService.confirmWithdrawRequest(requestId, dto.transactionId)
|
||||
}
|
||||
|
||||
// ************** Reseller Panel Endpoints ***********
|
||||
@@ -148,7 +157,7 @@ export class ResellerController {
|
||||
@ResellerRoute([ResellerType.agent, ResellerType.reseller])
|
||||
@Get('withdraw-request')
|
||||
getPayments(@UserDec("id") userId: string, @Body() dto: SearchWithdrawRequestQueryDto) {
|
||||
return this.resellerService.getRewrdsRequests(userId, dto)
|
||||
return this.resellerService.getWithdrawRequests(userId, dto)
|
||||
}
|
||||
|
||||
// ============ Create Bank Account =============
|
||||
|
||||
Reference in New Issue
Block a user