Commit Graph

12 Commits

Author SHA1 Message Date
880999b03a feat: plantilla base workspace SaaS
Some checks failed
Build Producción & Push a Harbor / test (push) Failing after 2s
Build Producción & Push a Harbor / build (push) Has been skipped
Convierte el repositorio de Anexo76 en una plantilla limpia y reutilizable
para nuevos proyectos del ecosistema Workspace de Aduanasoft.

Cambios principales:
- Elimina módulos específicos de Anexo76: a76, a24, sitar, public
- Agrega módulo example/ con patrón CRUD de referencia (models/dto/service/routes)
- Limpia migraciones Alembic: solo quedan las 6 de core (users, tenants, permissions)
- Reemplaza todas las rutas del dashboard con stubs genéricos
- Elimina lógica de negocio aduanera: shortcuts, CSV imports, permisos, catálogos
- Simplifica variables de entorno: una sola WORKSPACE_URL deriva Hub y Keycloak
- Agrega scripts/auth-mode.sh para alternar entre auth local y workspace
- Configura docker-compose con nombres genéricos (app-*)
- Corrige flujo SSO: elimina system-gate SCAF/SCAII que bloqueaba el login
- Modo DEV_LOCAL_AUTH para desarrollo sin Keycloak ni Hub

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 10:55:17 -05:00
4c0fa607dc refactor: update alembic migrations and import models
- Added import for `alta_log_models` to `env.py` for autogeneration of tables outside of `models.py`.
- Deleted several obsolete migration files, including those related to classification descriptions, initial data seeding, and legacy fields in the company certification schema.
- Cleaned up migration history by removing unused migration scripts to streamline future updates.
2026-05-01 22:10:21 -05:00
309835be8c Enhance SQLAlchemy URL validation in Alembic environment
- Added a new function to reject documentation placeholder hosts in database URLs, improving error handling for misconfigurations.
- Updated the `get_database_url` function to incorporate this new validation, ensuring that users are alerted when using "host" as a placeholder.
- Enhanced error messages to provide clearer guidance on valid host configurations.

These changes aim to improve the robustness and clarity of database connection handling in the application.
2026-03-24 15:41:47 -05:00
2cd6b165d7 Enhance database URL validation in Alembic environment
- Introduced a new validation function for SQLAlchemy URLs to ensure proper formatting and provide clearer error messages.
- Updated the `get_database_url` function to include checks for both `TEST_DATABASE_URL` and `DATABASE_URL`, improving flexibility in configuration.
- Removed the previous URL scheme validation in favor of the new validation method, streamlining the error handling process.

These changes aim to improve the robustness and clarity of database connection handling in the application.
2026-03-24 15:39:53 -05:00
a3ba317d2c Enhance database URL handling in Alembic environment
- Added a new helper function to strip unwanted characters from environment variable URLs, improving the normalization process.
- Updated the `get_database_url` function to validate the database URL scheme and provide clearer error messages for misconfigurations.
- Expanded the environment variable checks to include `DATABASE_URL`, enhancing flexibility for different deployment scenarios.

These changes aim to improve the robustness and clarity of database connection handling in the application.
2026-03-24 15:32:49 -05:00
4b2a3da611 Refactor database URL handling in Alembic environment
- Introduced a new function to normalize database URLs for Alembic, ensuring compatibility with different PostgreSQL drivers.
- Updated the `get_database_url` function to prioritize the use of the `TEST_DATABASE_URL` environment variable for CI and testing scenarios.
- Enhanced error messaging to clarify configuration requirements for database connections.

This change aims to improve the flexibility and reliability of database connections in the testing environment.
2026-03-24 15:28:41 -05:00
fbb24f2cd3 Refactor invoice financials to change iva_factor type from string to numeric
- Updated the `iva_factor` field in the `InvoiceFinancials` model to use a numeric type with precision and scale.
- Adjusted related frontend components and API interfaces to reflect the new numeric type for `iva_factor`.
- Enhanced Alembic migration scripts to accommodate the schema changes, ensuring proper index management and data type conversions.

These changes improve data integrity and consistency for financial calculations in invoices.
2026-03-23 09:48:33 -05:00
e1ce41f9f9 feat: update default system value in AuditLog model for consistency 2026-02-19 17:51:50 -06:00
b68c4316ff Refactor backend and frontend code for improved structure and functionality
- Rearranged imports in multiple files for consistency and clarity.
- Updated logging middleware to exclude specific paths from logging.
- Enhanced security module by cleaning up token handling and improving tenant validation.
- Added tenant and company scoped mixins for better database model management.
- Implemented generic CRUD routes for tenant-scoped resources.
- Improved error handling and response management in API routes.
- Cleaned up login and logout processes to ensure proper session management.
- Introduced mechanisms to clear local storage and cookies on tenant change.
- Enhanced company store to detect tenant changes and clear data accordingly.
- Added new DTO mixins for currency and value affect flags.
2025-11-11 17:20:47 -06:00
52b8fcd434 feat: Implement multi-tenancy support in middleware and security layers
- Enhanced TenantMiddleware to validate tenant information from JWT tokens.
- Added LicenseValidationMiddleware to check tenant licenses before processing requests.
- Updated security utilities to extract tenant information from tokens and validate company access.
- Introduced CompanyStore to manage active company state and handle company switching in the frontend.
- Modified API routes to include company_id in requests for better resource management.
- Improved logging and error handling throughout the middleware and API layers.
- Updated frontend components to reflect changes in company management and selection.
- Added new API route for fetching user's companies with proper authentication handling.
2025-11-11 14:15:31 -06:00
07dfe1edb1 Add service layers and models for Pedimento CRUD operations
- Implemented service classes for PedimentoConfigParameters, PedimentoConfigSurcharges, PedimentoConfigUpdateRectification, PedimentoConfigUpdates, PedimentoCustomsOffices, PedimentoDates, PedimentoDecrementables, PedimentoIncrementables, PedimentoIndexes, PedimentoPayments, PedimentoRectificationDestination, PedimentoRectificationOrigin, PedimentoTransportMeans, and PedimentoValidation.
- Each service class includes methods for CRUD operations: create, read, update, and delete.
- Added a main router for the API v1, integrating various modules including authentication, tenants, licenses, and pedimentos.
- Created models for PedimentoValidation with appropriate constraints and relationships.
2025-11-06 17:16:29 -06:00
2a10d7d267 feat: Add frontend and backend initialization scripts, implement Keycloak and PostgreSQL setup
- Implemented SvelteKit frontend with authentication callback handling.
- Created demo routes and paraglide localization functionality.
- Added health check and entrypoint scripts for backend services.
- Established PostgreSQL and Keycloak initialization scripts with health checks.
- Introduced models for database schema using SQLAlchemy.
- Configured Vite and SvelteKit for development and testing environments.
- Added health check script to verify service statuses and resource usage.
- Created Docker entrypoint scripts for seamless service startup.
2025-10-19 00:14:06 -05:00