feat: restore credit limits and harden SMS sending
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user