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,7 +11,9 @@ from sqlalchemy import text
from app.core.config import settings
from app.core.database import database_manager
from app.api.orders import router as orders_router
from app.api.procurement import router as procurement_router
from app.api.customers import router as customers_router
from app.api.order_operations import router as order_operations_router
from app.api.procurement_operations import router as procurement_operations_router
from app.services.procurement_scheduler_service import ProcurementSchedulerService
from shared.service_base import StandardFastAPIService
@@ -52,7 +54,7 @@ class OrdersService(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=orders_expected_tables
)
@@ -94,9 +96,14 @@ app = service.create_app()
# Setup standard endpoints
service.setup_standard_endpoints()
# Include routers
# Include routers - organized by ATOMIC and BUSINESS operations
# ATOMIC: Direct CRUD operations
service.add_router(orders_router)
service.add_router(procurement_router)
service.add_router(customers_router)
# BUSINESS: Complex operations and workflows
service.add_router(order_operations_router)
service.add_router(procurement_operations_router)
@app.post("/test/procurement-scheduler")