feat(workspace): extend Workspace entity with subscription fields
- Add subscription_plan (free/pro/enterprise) with free as default - Add subscription_status (active/cancelled/expired) - Add subscription_expires_at for expiration tracking - Add max_projects quota (free: 3, pro/enterprise: unlimited) - Add max_storage_gb and used_storage_gb for storage tracking - Backward compatible with existing code (all new fields have defaults) Phase 4 Task 9/68 completed
This commit is contained in:
@@ -41,6 +41,14 @@ class Workspace:
|
||||
id: str
|
||||
name: str
|
||||
owner_user_id: str
|
||||
# 订阅相关字段
|
||||
subscription_plan: str = "free" # free, pro, enterprise
|
||||
subscription_status: str = "active" # active, cancelled, expired
|
||||
subscription_expires_at: datetime | None = None
|
||||
# 配额限制
|
||||
max_projects: int = 3 # free: 3, pro: unlimited, enterprise: unlimited
|
||||
max_storage_gb: int = 10 # free: 10, pro: 100, enterprise: 1000
|
||||
used_storage_gb: float = 0.0
|
||||
created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user