mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add payments feature access based on config
This commit is contained in:
parent
5a746a946d
commit
546e8a5f98
19 changed files with 98 additions and 43 deletions
|
|
@ -40,7 +40,6 @@ class AssignmentOrgConfig(BaseModel):
|
|||
|
||||
class PaymentOrgConfig(BaseModel):
|
||||
enabled: bool = True
|
||||
stripe_key: str = ""
|
||||
|
||||
|
||||
class DiscussionOrgConfig(BaseModel):
|
||||
|
|
@ -91,7 +90,7 @@ class OrgCloudConfig(BaseModel):
|
|||
|
||||
# Main Config
|
||||
class OrganizationConfigBase(BaseModel):
|
||||
config_version: str = "1.1"
|
||||
config_version: str = "1.2"
|
||||
general: OrgGeneralConfig
|
||||
features: OrgFeatureConfig
|
||||
cloud: OrgCloudConfig
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ def install_create_organization(org_object: OrganizationCreate, db_session: Sess
|
|||
|
||||
# Org Config
|
||||
org_config = OrganizationConfigBase(
|
||||
config_version="1.1",
|
||||
config_version="1.2",
|
||||
general=OrgGeneralConfig(
|
||||
enabled=True,
|
||||
color="normal",
|
||||
|
|
@ -345,7 +345,7 @@ def install_create_organization(org_object: OrganizationCreate, db_session: Sess
|
|||
storage=StorageOrgConfig(enabled=True, limit=0),
|
||||
ai=AIOrgConfig(enabled=True, limit=0, model="gpt-4o-mini"),
|
||||
assignments=AssignmentOrgConfig(enabled=True, limit=0),
|
||||
payments=PaymentOrgConfig(enabled=True, stripe_key=""),
|
||||
payments=PaymentOrgConfig(enabled=False),
|
||||
discussions=DiscussionOrgConfig(enabled=True, limit=0),
|
||||
analytics=AnalyticsOrgConfig(enabled=True, limit=0),
|
||||
collaboration=CollaborationOrgConfig(enabled=True, limit=0),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from src.services.install.install import (
|
|||
install_default_elements,
|
||||
)
|
||||
|
||||
|
||||
# TODO: Depreceated and need to be removed and remade
|
||||
async def create_initial_data_for_tests(db_session: Session):
|
||||
# Install default elements
|
||||
await install_default_elements({}, db_session)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue