Add subcription feature
This commit is contained in:
@@ -20,7 +20,8 @@ class UserRegistration(BaseModel):
|
||||
tenant_name: Optional[str] = Field(None, max_length=255)
|
||||
role: Optional[str] = Field("admin", pattern=r'^(user|admin|manager|super_admin)$')
|
||||
subscription_plan: Optional[str] = Field("starter", description="Selected subscription plan (starter, professional, enterprise)")
|
||||
use_trial: Optional[bool] = Field(False, description="Whether to use trial period")
|
||||
billing_cycle: Optional[str] = Field("monthly", description="Billing cycle (monthly, yearly)")
|
||||
coupon_code: Optional[str] = Field(None, description="Discount coupon code")
|
||||
payment_method_id: Optional[str] = Field(None, description="Stripe payment method ID")
|
||||
# GDPR Consent fields
|
||||
terms_accepted: Optional[bool] = Field(True, description="Accept terms of service")
|
||||
@@ -76,6 +77,7 @@ class TokenResponse(BaseModel):
|
||||
token_type: str = "bearer"
|
||||
expires_in: int = 3600 # seconds
|
||||
user: Optional[UserData] = None
|
||||
subscription_id: Optional[str] = Field(None, description="Subscription ID if created during registration")
|
||||
|
||||
class Config:
|
||||
schema_extra = {
|
||||
@@ -92,7 +94,8 @@ class TokenResponse(BaseModel):
|
||||
"is_verified": False,
|
||||
"created_at": "2025-07-22T10:00:00Z",
|
||||
"role": "user"
|
||||
}
|
||||
},
|
||||
"subscription_id": "sub_1234567890"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,6 +113,8 @@ class UserResponse(BaseModel):
|
||||
timezone: Optional[str] = None # ✅ Added missing field
|
||||
tenant_id: Optional[str] = None
|
||||
role: Optional[str] = "admin"
|
||||
payment_customer_id: Optional[str] = None # ✅ Added payment integration field
|
||||
default_payment_method_id: Optional[str] = None # ✅ Added payment integration field
|
||||
|
||||
class Config:
|
||||
from_attributes = True # ✅ Enable ORM mode for SQLAlchemy objects
|
||||
|
||||
Reference in New Issue
Block a user