feat(workspace): extend Workspace entity with subscription fields
Deploy / Deploy Staging (push) Failing after 6s
Deploy / Deploy Production (push) Has been skipped
Tests / test (push) Failing after 8s
Tests / lint (push) Failing after 9s

- 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:
Xiaoxia AI
2026-06-17 01:26:18 +08:00
parent 1aa111ffd2
commit 2b4eeadbbb
+8
View File
@@ -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))