feat: replace desktop membership with permanent point wallet
This commit is contained in:
56
shared/works-billing.ts
Normal file
56
shared/works-billing.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
export type WorksTokenPointBalance = {
|
||||
total: string | null;
|
||||
used: string | null;
|
||||
reserved: string | null;
|
||||
total_remaining: string | null;
|
||||
entitlement_source: 'self' | 'family_owner' | 'shared_group';
|
||||
family_shared: boolean;
|
||||
can_recharge: boolean;
|
||||
shared_available: boolean | null;
|
||||
expires_at: null;
|
||||
};
|
||||
|
||||
export type WorksRechargeProduct = {
|
||||
id: string;
|
||||
name: string;
|
||||
amount_cents: number;
|
||||
point_amount: string;
|
||||
currency: 'CNY';
|
||||
};
|
||||
|
||||
export type WorksBillingSummary = {
|
||||
own_points: WorksTokenPointBalance;
|
||||
points: WorksTokenPointBalance | null;
|
||||
funding_error: string | null;
|
||||
recharge_products: WorksRechargeProduct[];
|
||||
points_per_yuan: 50;
|
||||
signup_bonus: string;
|
||||
can_recharge: boolean;
|
||||
payment_configured: boolean;
|
||||
};
|
||||
|
||||
export type WorksRechargeOrder = {
|
||||
id: string;
|
||||
product_id: string;
|
||||
product_name: string;
|
||||
status: 'pending' | 'succeeded' | 'failed' | 'canceled' | 'manual_review';
|
||||
amount_cents: number;
|
||||
point_amount: string;
|
||||
currency: 'CNY';
|
||||
created_at: string;
|
||||
paid_at: string | null;
|
||||
manual_review_required: boolean;
|
||||
qr_payload: string | null;
|
||||
};
|
||||
|
||||
export type WorksPointTransaction = {
|
||||
id: string;
|
||||
kind: 'credit' | 'usage';
|
||||
description: string;
|
||||
status: string;
|
||||
points: string;
|
||||
reserved_points: string;
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
export type WorksPointHistory = { items: WorksPointTransaction[]; has_more: boolean };
|
||||
Reference in New Issue
Block a user