feat(admin): wallet adjustment endpoint and atomic prisma wallet topup transaction [TASK-26.14] [TASK-26.15] [TASK-26.16]

This commit is contained in:
parsa aghaei committed 2026-08-05 14:40:35 +03:30
1 parent 3497a743b3
commit d94b33f96d
3 files changed
+59 -3

No files matched your search

+17
View File
@@ -76,6 +76,23 @@ export class AdminController {
};
}
@UseGuards(JwtAuthGuard)
@Post('users/:id/wallet-adjust')
@ApiOperation({ summary: 'شارژ یا کسر مستقیم کیف پول کاربر توسط ادمین' })
async adjustWallet(
@Param('id') id: string,
@Body('amount') amount: number,
@Body('type') type: 'deposit' | 'withdrawal' | 'refund',
@Body('description') description?: string,
) {
const result = await this.adminService.adjustUserWallet(id, Number(amount), type, description);
return {
success: true,
message: 'موجود کیف پول با موفقیت بروزرسانی شد',
data: result,
};
}
@UseGuards(JwtAuthGuard)
@Get('products')
@ApiOperation({ summary: 'لیست محصولات (مدیریت)' })