diff --git a/backend/api/v1/modules/public/reference_data/carta_porte/cartaPorte.csv b/backend/api/v1/modules/public/reference_data/carta_porte_codes/cartaPorte.csv similarity index 100% rename from backend/api/v1/modules/public/reference_data/carta_porte/cartaPorte.csv rename to backend/api/v1/modules/public/reference_data/carta_porte_codes/cartaPorte.csv diff --git a/backend/api/v1/modules/public/reference_data/carta_porte/dto.py b/backend/api/v1/modules/public/reference_data/carta_porte_codes/dto.py similarity index 100% rename from backend/api/v1/modules/public/reference_data/carta_porte/dto.py rename to backend/api/v1/modules/public/reference_data/carta_porte_codes/dto.py diff --git a/backend/api/v1/modules/public/reference_data/carta_porte/models.py b/backend/api/v1/modules/public/reference_data/carta_porte_codes/models.py similarity index 95% rename from backend/api/v1/modules/public/reference_data/carta_porte/models.py rename to backend/api/v1/modules/public/reference_data/carta_porte_codes/models.py index 1eb8e158..c23ade0b 100644 --- a/backend/api/v1/modules/public/reference_data/carta_porte/models.py +++ b/backend/api/v1/modules/public/reference_data/carta_porte_codes/models.py @@ -4,7 +4,7 @@ from sqlalchemy.orm import Mapped, mapped_column class CartaPorte(Base): - __tablename__ = "carta_porte" + __tablename__ = "carta_porte_codes" __table_args__ = ( {"schema": "public", "extend_existing": True}, ) diff --git a/backend/api/v1/modules/public/reference_data/carta_porte/routes.py b/backend/api/v1/modules/public/reference_data/carta_porte_codes/routes.py similarity index 100% rename from backend/api/v1/modules/public/reference_data/carta_porte/routes.py rename to backend/api/v1/modules/public/reference_data/carta_porte_codes/routes.py diff --git a/backend/api/v1/modules/public/reference_data/carta_porte/seed.py b/backend/api/v1/modules/public/reference_data/carta_porte_codes/seed.py similarity index 89% rename from backend/api/v1/modules/public/reference_data/carta_porte/seed.py rename to backend/api/v1/modules/public/reference_data/carta_porte_codes/seed.py index ad036fb6..7042748f 100644 --- a/backend/api/v1/modules/public/reference_data/carta_porte/seed.py +++ b/backend/api/v1/modules/public/reference_data/carta_porte_codes/seed.py @@ -39,10 +39,8 @@ def seed_carta_porte(db: Session): if len(batch) >= batch_size: db.bulk_save_objects(batch) db.commit() - batch = [] - print(f"Inserted {batch_size} records...") + batch = [] if batch: db.bulk_save_objects(batch) - db.commit() - print(f"Finished seeding with {len(batch)} remaining records.") + db.commit() diff --git a/backend/api/v1/modules/public/reference_data/router.py b/backend/api/v1/modules/public/reference_data/router.py index 62efddc6..a5d59a64 100644 --- a/backend/api/v1/modules/public/reference_data/router.py +++ b/backend/api/v1/modules/public/reference_data/router.py @@ -6,7 +6,7 @@ Agrega todos los módulos de la aplicación from fastapi import APIRouter from .agency_tariff_codes.routes import router as agency_tariff_codes_router -from .carta_porte.routes import router as carta_porte_router +from .carta_porte_codes.routes import router as carta_porte_router from .code_pedimento_regimens.routes import router as code_pedimento_regimens_router from .containers.routes import router as containers_router from .countries.routes import router as countries_router @@ -108,7 +108,7 @@ router.include_router( router.include_router( carta_porte_router, prefix="/reference_data", - tags=["public / reference_data / carta_porte"], + tags=["public / reference_data / carta_porte_codes"], ) router.include_router( customs_sections_router,