REFACTOR ALL APIs

This commit is contained in:
Urtzi Alfaro
2025-10-06 15:27:01 +02:00
parent dc8221bd2f
commit 38fb98bc27
166 changed files with 18454 additions and 13605 deletions

View File

@@ -7,7 +7,7 @@ from fastapi import FastAPI
from sqlalchemy import text
from app.core.config import settings
from app.core.database import database_manager
from app.api import tenants, subscriptions, webhooks
from app.api import tenants, tenant_members, tenant_operations, webhooks
from shared.service_base import StandardFastAPIService
@@ -52,14 +52,14 @@ class TenantService(StandardFastAPIService):
def __init__(self):
# Define expected database tables for health checks
tenant_expected_tables = ['tenants', 'tenant_members', 'subscriptions']
# Note: api_prefix is empty because RouteBuilder already includes /api/v1
super().__init__(
service_name="tenant-service",
app_name="Tenant Management Service",
description="Multi-tenant bakery management service",
version="1.0.0",
log_level=settings.LOG_LEVEL,
api_prefix="/api/v1",
api_prefix="",
database_manager=database_manager,
expected_tables=tenant_expected_tables
)
@@ -112,7 +112,8 @@ service.setup_custom_endpoints()
# Include routers
service.add_router(tenants.router, tags=["tenants"])
service.add_router(subscriptions.router, tags=["subscriptions"])
service.add_router(tenant_members.router, tags=["tenant-members"])
service.add_router(tenant_operations.router, tags=["tenant-operations"])
service.add_router(webhooks.router, tags=["webhooks"])
if __name__ == "__main__":