fix: polish channel groups and add production deployment
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user