feat(payment): 新增微信支付宝积分充值与对账

This commit is contained in:
MasterChiefCN
2026-09-02 12:58:10 +08:00
parent 52158da7c2
commit 669b83b2f8
41 changed files with 6401 additions and 136 deletions

View File

@@ -14,11 +14,12 @@ export type CreditAccount = {
export type CreditLedgerEntry = {
id: string;
userId: string;
type: "redeem" | "admin_grant" | "consume" | "refund" | "admin_adjustment" | "signup_bonus" | "checkin_bonus";
type: "redeem" | "payment_topup" | "admin_grant" | "consume" | "refund" | "admin_adjustment" | "signup_bonus" | "checkin_bonus";
amountMicrocredits: number;
availableAfterMicrocredits: number;
reservedAfterMicrocredits: number;
billingOrderId?: string;
paymentOrderId?: string;
model?: string;
channelId?: string;
scene?: string;
@@ -65,7 +66,7 @@ export type ChannelModel = {
priceVersion: number;
capabilityVersion?: number;
capabilityConfig?: import("@/lib/model-capabilities").ModelCapabilityConfig;
priceTiers: ChannelModelPriceTier[];
priceTiers: ChannelModelPriceTier[];
createdAt: string;
updatedAt: string;
};
@@ -73,8 +74,8 @@ export type ChannelModel = {
export type ChannelModelPriceTier = {
id: string;
channelModelId: string;
selector: Record<string, string>;
selectorKey: string;
selector: Record<string, string>;
selectorKey: string;
resolution: string;
videoSeconds: number;
providerModelKey: string;
@@ -100,7 +101,7 @@ export type ChannelModelMutation = {
protocol?: ChannelModel["protocol"];
enabled?: boolean;
capabilityConfig?: ChannelModel["capabilityConfig"];
priceTiers?: Array<Omit<ChannelModelPriceTier, "id" | "channelModelId" | "selectorKey" | "priceVersion" | "createdAt" | "updatedAt">>;
priceTiers?: Array<Omit<ChannelModelPriceTier, "id" | "channelModelId" | "selectorKey" | "priceVersion" | "createdAt" | "updatedAt">>;
billingMode?: ChannelModel["billingMode"];
unitPriceMicrocredits?: number;
inputTokenPriceMicrocredits?: number;
@@ -285,7 +286,7 @@ export function updateAdminChannelModel(channelId: string, id: string, input: Ch
}
export function deleteAdminChannelModel(channelId: string, id: string) {
return request<{ ok: boolean }>(api.delete(`/admin/channels/${encodeURIComponent(channelId)}/models/${encodeURIComponent(id)}`));
return request<{ ok: boolean }>(api.delete(`/admin/channels/${encodeURIComponent(channelId)}/models/${encodeURIComponent(id)}`));
}
export type AdminFinanceListParams = { keyword?: string; status?: string; validity?: string; page?: number; limit?: number };