会员积分改版V1

This commit is contained in:
2026-08-11 09:24:18 +08:00
parent fe24e51b97
commit b9fd07f293
111 changed files with 9355 additions and 3900 deletions
@@ -0,0 +1,43 @@
from __future__ import annotations
from datetime import datetime
from pydantic import BaseModel
class CreditSubscriptionPeriodOut(BaseModel):
id: str
sequence: int
scheduled_at: datetime
valid_from: datetime
expires_at: datetime
grant_credits: float
allocated_paid_amount: float
status: str
issued_balance_id: str | None = None
issued_at: datetime | None = None
model_config = {"from_attributes": True}
class CreditSubscriptionOut(BaseModel):
id: str
product_id: str | None = None
payment_order_id: str
status: str
purchase_scene: str
tier_code: str
tier_rank: int
billing_cycle: str
anchor_at: datetime
start_at: datetime
expires_at: datetime
next_grant_at: datetime | None = None
monthly_grant_credits_snapshot: float
grant_count: int
granted_count: int
paid_amount_snapshot: float
source_subscription_id: str | None = None
periods: list[CreditSubscriptionPeriodOut] = []
model_config = {"from_attributes": True}