feat(hosting): add HostWizard platform module and fix migration chain
Some checks failed
CI / pytest (push) Failing after 49m20s
CI / validate (push) Successful in 24s
CI / dependency-scanning (push) Successful in 33s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
CI / ruff (push) Successful in 10s

- Add complete hosting module (models, routes, schemas, services, templates, migrations)
- Add HostWizard platform to init_production seed (code=hosting, domain=hostwizard.lu)
- Fix cms_002 migration down_revision to z_unique_subdomain_domain
- Fix prospecting_001 migration to chain after cms_002 (remove branch label)
- Add hosting/prospecting version_locations to alembic.ini
- Fix admin_services delete endpoint to use proper response model
- Add hostwizard.lu to deployment docs (DNS, Caddy, Cloudflare)
- Add hosting and prospecting user journey docs to mkdocs nav

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 19:34:56 +01:00
parent 784bcb9d23
commit 8b147f53c6
46 changed files with 3907 additions and 13 deletions

View File

@@ -55,6 +55,7 @@ for _mod in [
"app.modules.orders.models",
"app.modules.marketplace.models",
"app.modules.cms.models",
"app.modules.hosting.models",
]:
with contextlib.suppress(ImportError):
__import__(_mod)
@@ -194,6 +195,16 @@ def create_oms_admin(db: Session, auth_manager: AuthManager, oms_platform: Platf
)
def create_hostwizard_admin(db: Session, auth_manager: AuthManager, hosting_platform: Platform) -> User | None:
"""Create a platform admin for the HostWizard platform."""
return create_platform_admin(
db, auth_manager, hosting_platform,
username="hosting_admin",
email="admin@hostwizard.lu",
first_name="HostWizard",
)
def create_default_platforms(db: Session) -> list[Platform]:
"""Create all default platforms (OMS, Main, Loyalty+)."""
@@ -231,6 +242,17 @@ def create_default_platforms(db: Session) -> list[Platform]:
"settings": {"features": ["points", "rewards", "tiers", "analytics"]},
"theme_config": {"primary_color": "#8B5CF6", "secondary_color": "#A78BFA"},
},
{
"code": "hosting",
"name": "HostWizard",
"description": "Web hosting, domains, email, and website building for Luxembourg businesses",
"domain": "hostwizard.lu",
"path_prefix": "hosting",
"default_language": "fr",
"supported_languages": ["fr", "de", "en", "lb"],
"settings": {"features": ["hosting", "domains", "email", "ssl", "poc_sites"]},
"theme_config": {"primary_color": "#0D9488", "secondary_color": "#14B8A6"},
},
]
platforms = []
@@ -526,6 +548,7 @@ def create_platform_modules(db: Session, platforms: list[Platform]) -> int:
"oms": ["inventory", "catalog", "orders", "marketplace", "analytics", "cart", "checkout"],
"main": ["analytics", "monitoring", "dev-tools"],
"loyalty": ["loyalty"],
"hosting": ["prospecting", "hosting", "analytics"],
}
now = datetime.now(UTC)
@@ -647,6 +670,12 @@ def initialize_production(db: Session, auth_manager: AuthManager):
else:
print_warning("Loyalty platform not found, skipping loyalty admin creation")
hosting_platform = next((p for p in platforms if p.code == "hosting"), None)
if hosting_platform:
create_hostwizard_admin(db, auth_manager, hosting_platform)
else:
print_warning("Hosting platform not found, skipping hosting admin creation")
# Step 4: Set up default role templates
print_step(4, "Setting up role templates...")
create_default_role_templates(db)
@@ -729,6 +758,11 @@ def print_summary(db: Session):
print(f" URL: {admin_url}")
print(" Username: loyalty_admin")
print(" Password: admin123") # noqa: SEC021
print()
print(" HostWizard Platform Admin (hosting only):")
print(f" URL: {admin_url}")
print(" Username: hosting_admin")
print(" Password: admin123") # noqa: SEC021
print("" * 70)
# Show security warnings if in production