feat: restore credit limits and harden SMS sending

This commit is contained in:
hectorzhao
2026-07-14 18:46:35 +08:00
parent 3e3b7a9d1a
commit c1a17699db
23 changed files with 796 additions and 56 deletions
+8 -1
View File
@@ -1,4 +1,4 @@
import { Body, Controller, Get, Post } from '@nestjs/common';
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { TenantId } from '../common/tenant-id.decorator';
import { RequireRecentAuthentication } from '../auth/require-recent-authentication.decorator';
@@ -10,6 +10,7 @@ import {
CreateSmsBillingRecordDto,
CreateTenantAccountDto,
EstimateSmsCostDto,
UpdateCreditLimitDto,
} from './billing.service';
@ApiTags('billing')
@@ -27,6 +28,12 @@ export class BillingController {
return this.billing.createAccount(body);
}
@Post('accounts/:tenantId/credit-limit')
@RequireRecentAuthentication()
updateCreditLimit(@Param('tenantId') tenantId: string, @Body() body: UpdateCreditLimitDto) {
return this.billing.updateCreditLimit(tenantId, body);
}
@Get('recharges')
listRechargeOrders(@TenantId() tenantId?: string) {
return this.billing.listRechargeOrders(tenantId);