- Consolidated item creation and update validation into a common function to reduce code duplication. - Updated the `validate_create` and `validate_update` functions to utilize the new common validation logic. - Introduced a new `common_validators.py` file for shared validation functions. - Added a new `fractions.py` file to handle fraction-related logic and searches. - Enhanced the `LineCustom` model to use an enumeration for `fraction_type`. - Improved the `ItemService` class with methods for locking invoices and renumbering line items. - Updated the `Sector` model to use a boolean type for the `authorized` field. - Fixed import issues in the router by replacing the old `a24_router` with `sitar_router`.
34 lines
809 B
Python
34 lines
809 B
Python
"""
|
|
Router principal de API v1
|
|
Agrega todos los módulos de la aplicación
|
|
"""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
# Importar routers de módulos
|
|
from .modules.core.router import router as core_router
|
|
from .modules.a76.router import router as a76_router
|
|
from .modules.a24.router import router as a24_router
|
|
from .modules.public.router import router as public_router
|
|
from .modules.sitar.router import router as sitar_router
|
|
|
|
|
|
# Router principal
|
|
router = APIRouter()
|
|
|
|
# Registrar módulos
|
|
router.include_router(core_router)
|
|
router.include_router(a76_router)
|
|
router.include_router(a24_router)
|
|
router.include_router(public_router)
|
|
router.include_router(sitar_router)
|
|
|
|
|
|
# Health check
|
|
@router.get("/status")
|
|
def status():
|
|
"""Health check de la API"""
|
|
return {"status": "ok", "version": "1.0.0", "api": "v1"}
|
|
|
|
|