end points to get current points and wallet

This commit is contained in:
2025-12-29 22:14:02 +03:30
parent 85067f0373
commit e067912bb4
6 changed files with 54 additions and 29 deletions
@@ -14,11 +14,15 @@ import { API_HEADER_SLUG } from 'src/common/constants/index';
import { UserSuccessMessage } from 'src/common/enums/message.enum';
import { Permissions } from 'src/common/decorators/permissions.decorator';
import { Permission } from 'src/common/enums/permission.enum';
import { WalletService } from '../providers/wallet.service';
@ApiTags('User')
@Controller()
export class UsersController {
constructor(private readonly userService: UserService) { }
constructor(
private readonly userService: UserService,
private readonly walletService: WalletService,
) {}
@UseGuards(AuthGuard)
@ApiBearerAuth()
@@ -55,9 +59,19 @@ export class UsersController {
@ApiBearerAuth()
@ApiOperation({ summary: 'Get User Wallet' })
@ApiHeader(API_HEADER_SLUG)
@Get('public/user/wallet')
@Get('public/user/wallet/balance')
async getUserWalletBalance(@UserId() userId: string, @RestId() restId: string) {
const wallet = await this.walletService.getUserCurrentWalletBalance(userId, restId);
return wallet;
}
@UseGuards(AuthGuard)
@ApiBearerAuth()
@ApiOperation({ summary: 'Get User Wallet' })
@ApiHeader(API_HEADER_SLUG)
@Get('public/user/points/balance')
async getUserWallet(@UserId() userId: string, @RestId() restId: string) {
const wallet = await this.userService.getUserWallet(userId, restId);
const wallet = await this.walletService.getUserCurrentPoinrBalance(userId, restId);
return wallet;
}
@@ -166,6 +180,4 @@ export class UsersController {
) {
return this.userService.findAll(restId, query);
}
}