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

@@ -11,10 +11,18 @@ from fastapi import FastAPI, Request
from sqlalchemy import text
from app.core.config import settings
from app.core.database import database_manager
from app.api.production import router as production_router
from app.services.production_alert_service import ProductionAlertService
from shared.service_base import StandardFastAPIService
# Import standardized routers
from app.api import (
production_batches,
production_schedules,
production_operations,
production_dashboard,
analytics
)
class ProductionService(StandardFastAPIService):
"""Production Service with standardized setup"""
@@ -63,7 +71,7 @@ class ProductionService(StandardFastAPIService):
app_name=settings.APP_NAME,
description=settings.DESCRIPTION,
version=settings.VERSION,
api_prefix="/api/v1",
api_prefix="", # Empty because RouteBuilder already includes /api/v1
database_manager=database_manager,
expected_tables=production_expected_tables,
custom_health_checks={"alert_service": check_alert_service}
@@ -128,8 +136,12 @@ service.setup_standard_endpoints()
# Setup custom middleware
service.setup_custom_middleware()
# Include routers
service.add_router(production_router)
# Include standardized routers
service.add_router(production_batches.router)
service.add_router(production_schedules.router)
service.add_router(production_operations.router)
service.add_router(production_dashboard.router)
service.add_router(analytics.router)
if __name__ == "__main__":