feat: replace desktop membership with permanent point wallet
This commit is contained in:
11
tests/fixtures/permanent-points.ts
vendored
Normal file
11
tests/fixtures/permanent-points.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { WorksBillingSummary, WorksRechargeOrder, WorksTokenPointBalance } from '../../shared/works-billing';
|
||||
|
||||
export function permanentBalance(overrides: Partial<WorksTokenPointBalance> = {}): WorksTokenPointBalance {
|
||||
return { total: '100.00', used: '20.00', reserved: '5.00', total_remaining: '75.00', entitlement_source: 'self', family_shared: false, can_recharge: true, shared_available: null, expires_at: null, ...overrides };
|
||||
}
|
||||
export function billingSummary(overrides: Partial<WorksBillingSummary> = {}): WorksBillingSummary {
|
||||
return { own_points: permanentBalance(), points: permanentBalance(), funding_error: null, recharge_products: [{ id: 'recharge-10', name: '500 词元点数', amount_cents: 1000, point_amount: '500.00', currency: 'CNY' }], points_per_yuan: 50, signup_bonus: '100.00', can_recharge: true, payment_configured: true, ...overrides };
|
||||
}
|
||||
export function rechargeOrder(overrides: Partial<WorksRechargeOrder> = {}): WorksRechargeOrder {
|
||||
return { id: 'order-1', product_id: 'recharge-10', product_name: '500 词元点数', status: 'pending', amount_cents: 1000, point_amount: '500.00', currency: 'CNY', created_at: '2026-09-22T00:00:00Z', paid_at: null, manual_review_required: false, qr_payload: 'weixin://wxpay/bizpayurl?pr=test', ...overrides };
|
||||
}
|
||||
Reference in New Issue
Block a user