From 2b4eeadbbb6014da7e2f1d4fc61a8ed9f9c5bfc5 Mon Sep 17 00:00:00 2001 From: Xiaoxia AI Date: Wed, 17 Jun 2026 01:26:18 +0800 Subject: [PATCH] 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 --- packages/domain/entities.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/domain/entities.py b/packages/domain/entities.py index fd9baa7ea..95bb6db0c 100644 --- a/packages/domain/entities.py +++ b/packages/domain/entities.py @@ -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))