fix: polish channel groups and add production deployment

This commit is contained in:
hectorzhao
2026-07-07 11:16:08 +08:00
parent b5132d7f4e
commit 72f2c010ce
44 changed files with 1265 additions and 489 deletions
-16
View File
@@ -6,7 +6,6 @@ import {
BillingActionDto,
CreateManualRechargeDto,
CreateRechargeOrderDto,
CreateAccountTransactionDto,
CreateBillingPlanDto,
CreateBillingRuleDto,
CreateSmsBillingRecordDto,
@@ -39,16 +38,6 @@ export class BillingController {
return this.billing.createAccount(body);
}
@Get('transactions')
listTransactions(@TenantId() tenantId?: string) {
return this.billing.listTransactions(tenantId);
}
@Post('transactions')
createTransaction(@Body() body: CreateAccountTransactionDto) {
return this.billing.createTransaction(body);
}
@Get('recharges')
listRechargeOrders(@TenantId() tenantId?: string) {
return this.billing.listRechargeOrders(tenantId);
@@ -135,11 +124,6 @@ export class ClientBillingController {
return this.billing.listPlans();
}
@Get('transactions')
listTransactions(@TenantId() tenantId?: string) {
return this.billing.listTransactions(tenantId);
}
@Post('orders')
createRechargeOrder(@Body() body: CreateRechargeOrderDto) {
return this.billing.createRechargeOrder(body);
-22
View File
@@ -124,28 +124,6 @@ export class BillingService {
return this.prisma.tenantAccount.create({ data: createData });
}
listTransactions(tenantId?: string) {
return this.prisma.accountTransaction.findMany({
where: tenantId ? { tenantId } : undefined,
orderBy: { createdAt: 'desc' },
take: 100,
});
}
createTransaction(data: CreateAccountTransactionDto) {
const createData: Prisma.AccountTransactionUncheckedCreateInput = {
tenantId: data.tenantId,
transactionType: data.transactionType,
amountCents: data.amountCents ?? 0,
smsUnits: data.smsUnits ?? 0,
balanceAfter: data.balanceAfter ?? 0,
relatedType: data.relatedType,
relatedId: data.relatedId,
remark: data.remark,
};
return this.prisma.accountTransaction.create({ data: createData });
}
listRechargeOrders(tenantId?: string) {
return this.prisma.rechargeOrder.findMany({
where: tenantId ? { tenantId } : undefined,