feat(admin-web): expose AI point balance and usage ledger

Surfaces the new AI point quota in the workspace shell and adds a
Personal Center → AI Point Usage page that shows balance, base-char
rule, and the paginated reservation/refund history. Updates shared
types for the QuotaSummary and ledger payloads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-28 11:34:07 +08:00
parent e307a048d1
commit bf7594ccd8
7 changed files with 536 additions and 4 deletions
+30
View File
@@ -48,6 +48,8 @@ export interface MembershipInfo {
end_at: string | null;
article_generation_limit: number;
article_quota_cycle: string;
ai_points_monthly: number;
ai_point_base_chars: number;
company_limit: number;
image_storage_bytes: number;
contact_admin_on_expiry: boolean;
@@ -353,6 +355,34 @@ export interface QuotaSummary {
used_quota: number;
balance: number;
reset_at: string | null;
ai_points_total: number;
ai_points_used: number;
ai_points_balance: number;
ai_point_base_chars: number;
ai_points_reset_at: string | null;
}
export interface AIPointUsageLog {
id: number;
usage_type: string;
resource_type: string | null;
resource_id: number | null;
resource_uid: string | null;
request_chars: number;
base_chars: number;
points: number;
status: string;
model: string | null;
error_message: string | null;
completed_at: string | null;
created_at: string;
}
export interface AIPointUsageListResponse {
items: AIPointUsageLog[];
total: number;
page: number;
page_size: number;
}
export interface TemplateCard {