Commit Graph

81 Commits

Author SHA1 Message Date
3fdfd70633 feat: add DODA module with DTOs, models, and service layer for managing DODA operations 2025-12-06 23:36:35 -06:00
6f2b755898 feat: implement location management module with DTOs, models, routes, and service layer 2025-12-06 23:36:22 -06:00
0cb89ceeec feat: update pedimento dates model, add PATCH method to API, and enhance edit forms 2025-12-05 17:27:19 -06:00
6eae26acf3 Merge pull request 'feature/pedimentos' (#21) from feature/pedimentos into development
Reviewed-on: ADUANASOFT/anexo76#21
2025-11-24 22:45:03 +00:00
dcd42583d9 feat: replace SVG icons with Lucide icons in reference data pages
- Updated the "Nueva Sección" button in customs_sections, customs_warehouses, incoterms, invoice_types, material_types, payment_methods, pedimento_codes, pedimento_regimens, sectors, states, transport_modes, and transport_types pages to use the Plus icon from Lucide.
- Updated the "Actualizar" button in the same pages to use the RefreshCw icon from Lucide.
- Added a new edit dialog component for customs brokers with a comprehensive form for editing broker details, including validation and loading states.
2025-11-24 16:43:53 -06:00
cdc3788a05 feat: update company API endpoint, refine pedimento dates model, and adjust Keycloak mapper creation 2025-11-24 09:58:24 -06:00
3043be4624 feat: Integrate pedimento codes into the edit form and update data loading 2025-11-18 19:00:13 -06:00
404333f35e Refactor Pedimento data structure and update forms
- Expanded the PedimentoDates, PedimentoPayments, PedimentoTransportMeans, and PedimentoValidation interfaces to include additional fields.
- Updated the dates, payments, transport, and validation tab forms to initialize form data directly from the Pedimento object, removing unnecessary API calls for data loading.
- Enhanced the payload construction in the edit page to conditionally include sub-resources only if they contain values, improving data handling during creation and update operations.
- Adjusted the form bindings to reflect the new structure and ensure proper data flow between the components.
2025-11-18 18:20:04 -06:00
84006e3410 Merge pull request 'feat: Convertir módulo de clases para usar TenantCRUDRoutes' (#20) from classes into development
Reviewed-on: ADUANASOFT/anexo76#20
2025-11-18 22:36:29 +00:00
243fab8bef Merge branch 'feature/pedimentos2' into development 2025-11-18 16:27:57 -06:00
e73309edb6 feat: Add sub-resource interfaces for Pedimento and unify API calls in edit page 2025-11-18 16:20:39 -06:00
KevinMrkz3221
99aff32eea feat: Convertir módulo de clases para usar TenantCRUDRoutes
Cambios en backend:
- Actualizado ClassResponseDTO con campos de tenant y timestamps
- Agregados métodos estáticos en servicio (get_all, get_by_id, create, update, delete)
- Reemplazados endpoints de rutas con inicialización de TenantCRUDRoutes
- Corregida ruta de importación del modelo Company en security.py
- Actualizados nombres de campos en DTO para coincidir con modelo (description_es/en)
- Agregada validación para constraint de foreign key de material_key
- Agregada validación de class_code duplicado en método create
- Agregado TimestampMixin al modelo Class
- Creada migración de Alembic para agregar columnas timestamp a tabla classes
- Corregido orden de parámetros en firma del método update

Cambios en frontend:
- Actualizados componentes de UI para módulo de clases
2025-11-15 20:05:29 -06:00
c100c048fe Merge pull request 'feat: Enhance Pedimentos CRUD operations with related data handling' (#18) from feature/customs-brokers into development
Reviewed-on: ADUANASOFT/anexo76#18
2025-11-15 00:17:50 +00:00
ba40123333 feat: Enhance Pedimentos CRUD operations with related data handling
- Updated PedimentosService to create and update related tables for Pedimentos.
- Added company_id filtering in queries for Pedimentos.
- Improved error handling and logging during creation and update processes.
- Refactored router tags for consistency and clarity.
- Adjusted API endpoints for customs brokers to include company_id in requests.
- Enhanced company selection logic in various components to prioritize active company.
- Implemented event listeners for company changes to reload data dynamically.
- Updated frontend components to handle loading states and errors more effectively.
- Ensured all relevant routes and API calls are aligned with the new company context.
2025-11-14 18:14:33 -06:00
836083b428 Merge pull request 'Fix: Corregir inserción de tenant y relaciones en PostgreSQL usando formato -c en psql' (#17) from setup/init into development
Reviewed-on: ADUANASOFT/anexo76#17
2025-11-14 03:18:46 +00:00
KevinMrkz3221
dd77a80408 Fix: Corregir inserción de tenant y relaciones en PostgreSQL usando formato -c en psql
- Cambiar de heredoc (<<EOF) a formato -c para ejecutar comandos SQL
- Agregar cast explícito 'SHARED'::tenanttype para el campo type del tenant
- Arreglar inserción de company para que se ejecute correctamente
- Arreglar inserción de relación usuario-tenant en table user_tenants
- Mejora en ejecución de comandos PostgreSQL dentro de docker exec

El problema era que los heredocs no interpolaban correctamente las variables
en el contexto de docker exec. Usar -c con sentencias SQL en una línea resuelve
el problema y asegura que los INSERTs se ejecuten correctamente.
2025-11-13 20:18:10 -06:00
35dd4423c1 Merge pull request 'fix/auth' (#16) from fix/auth into development
Reviewed-on: ADUANASOFT/anexo76#16
2025-11-12 22:58:11 +00:00
aa35635397 feat: Implement customs brokers management interface
- Added a data table for displaying customs brokers with columns for key, name, type, license, RFC, email, phone, city, and actions.
- Created a dialog for adding new customs brokers with a form for inputting necessary details.
- Implemented actions for viewing details and deleting customs brokers with confirmation dialogs.
- Integrated search functionality to find customs brokers by their key.
- Established server-side loading for the customs brokers page to handle authentication and data retrieval.
2025-11-12 16:57:15 -06:00
6225122832 feat: Implement client and provider management dashboard
- Added data table component for displaying clients and providers with infinite scroll functionality.
- Created dropdown actions for each client/provider including copy ID, copy RFC, view details, edit, toggle status, and delete.
- Implemented dialogs for creating, editing, viewing details, and deleting clients/providers.
- Integrated API calls for fetching, creating, editing, deleting, and toggling status of clients/providers.
- Enhanced error handling and loading states for better user experience.
- Updated server-side logic to handle pagination and company selection for client/provider data retrieval.
2025-11-12 16:08:42 -06:00
67a309912c feat: Enhance Pedimentos creation and validation logic in frontend and backend 2025-11-12 10:42:15 -06:00
a5c1bab201 Refactor authentication handling and API calls in dashboard routes
- Centralized API URL configuration and token management in $lib/server/api.ts.
- Replaced direct token access with a centralized method for retrieving tokens.
- Updated all dashboard reference data routes to use authenticatedFetch for API calls, improving token refresh handling.
- Simplified login route by utilizing centralized token management functions.
- Added a new layout file for the dashboard to pass user and company data to the client.
2025-11-12 09:46:59 -06:00
70f7d1f868 refactor: Reorganize base CRUD routes in company module and enhance error logging in my-companies API 2025-11-12 09:20:14 -06:00
3c2094314b fix: Correct import path for customs_broker_router in the API router 2025-11-11 18:26:00 -06:00
962f43fe62 Refactor and enhance CRUD operations for Seal, Trailer, Transporter, Vehicle, and Customs Broker modules
- Updated SealService to support tenant and company filtering with pagination and enhanced CRUD methods.
- Refactored TrailerService to include tenant and company support, added filtering capabilities, and improved CRUD methods.
- Introduced TenantCRUDRoutes for Trailer and Transporter routes to streamline API endpoint creation and management.
- Enhanced TransporterService with tenant and company filtering, pagination, and improved CRUD operations.
- Added Customs Broker module with DTOs, models, services, and routes for managing customs broker data.
- Implemented CRUD operations for Customs Broker, including personnel and VU management.
- Improved data validation and descriptions in DTOs for better API documentation.
2025-11-11 18:20:39 -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
ac7f8d19d8 feat: Refactor DTOs and models to use from_attributes, update database schema references, and implement trailer types 2025-11-11 14:43:07 -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
e1eb6bbd01 Merge pull request 'feature/sec' (#14) from feature/sec into development
Reviewed-on: ADUANASOFT/anexo76#14
2025-11-11 20:04:35 +00:00
e7670d4e79 Merge pull request 'nov-7' (#13) from nov-7 into development
Reviewed-on: ADUANASOFT/anexo76#13
2025-11-11 20:02:43 +00:00
870bc36590 Aplicar lógica de validación de tenant y compañía a todos los endpoints relevantes en los módulos: client_and_provider, classes, country_rule_oct, exchange_rate, fraction_rule_octave, package, parts, permission_rule_oct, seal 2025-11-09 18:13:08 -06:00
9b01632fde Refactor pedimento routes to use company_id instead of tenant_id
- Updated all route files to replace tenant_id with company_id.
- Introduced validate_company_access function to check user access to the specified company.
- Modified service methods to accept company_id as a parameter.
- Adjusted query parameters in route definitions to include company_id.
- Ensured all CRUD operations in pedimento routes validate access based on company_id.
- Added a script to automate the update process for route files.
2025-11-08 10:21:17 -06:00
8722139b71 Resumen del trabajo de hoy: Se agregaron y actualizaron módulos, rutas, servicios y DTOs para las entidades trabajadas hoy, incluyendo Aduanal, Drivers, Trailers, TransportModes, TransportTypes, Transporters, Vehicles, entre otros. Se verificó la presencia de los campos tenant_id y company_id en los modelos relevantes. 2025-11-08 08:35:38 -06:00
6fab5a3dd4 Resumen del trabajo de hoy: Se agregaron y actualizaron módulos, rutas, servicios y DTOs para las entidades trabajadas hoy, incluyendo Aduanal, Drivers, Trailers, TransportModes, TransportTypes, Transporters, Vehicles, entre otros. Se verificó la presencia de los campos tenant_id y company_id en los modelos relevantes. 2025-11-08 08:35:02 -06:00
ace261fc57 Merge pull request 'Refactor database models to include company_id and update unique constraints' (#12) from feature/catalogos-generales into development
Reviewed-on: ADUANASOFT/anexo76#12
2025-11-08 00:48:33 +00:00
e0e38526b0 Refactor database models to include company_id and update unique constraints
- Updated PermissionRuleOct model to include company_id and modified unique constraint.
- Updated Seal model to include company_id and modified unique constraint.
- Added TYPE_CHECKING imports in reference data models for better type hinting.
- Created new models for QClasses and SClasses in the a24 module.
- Enhanced init_first_time.sh script for comprehensive system initialization, including Keycloak and PostgreSQL setup.
- Updated documentation to reflect changes in API endpoints and database relationships.
2025-11-07 18:47:41 -06:00
e1274abf2a Merge pull request 'feature/pedimentos' (#11) from feature/pedimentos into development
Reviewed-on: ADUANASOFT/anexo76#11
2025-11-07 21:27:40 +00:00
6d42b0976c feat: Enhance Pedimentos schemas with required fields and operation type enumeration 2025-11-07 15:26:31 -06:00
2fe6a7c8ff feat: Implement user-tenant relationship management with CRUD operations and access control 2025-11-07 14:38:48 -06:00
6e59eee82e refactor: Update foreign key constraints and primary key definitions in ORM models 2025-11-07 12:55:04 -06:00
ef3924a41d Refactor models and services in A76 module
- Updated GBultoService to use models.Package instead of models.GBulto.
- Refactored Part model to use SQLAlchemy 2.0 style with Mapped and mapped_column.
- Added timestamps (created_at, updated_at, deleted_at) to various pedimento models.
- Improved relationships and foreign key constraints in pedimento models.
- Updated PermissionRuleOct and Seal models to use Mapped and mapped_column.
- Changed DTO configuration from orm_mode to from_attributes for better compatibility.
- Removed obsolete models (models.py and models_ped.py) from the repository.
2025-11-07 12:17:26 -06:00
2987a6c541 Merge pull request 'feauture-pedimentos' (#10) from feauture-pedimentos into development
Reviewed-on: ADUANASOFT/anexo76#10
2025-11-07 16:11:10 +00:00
6422921ea0 Merge pull request 'Refactorización de nombres de módulos y actualizaciones:' (#9) from catalogos_g into development
Reviewed-on: ADUANASOFT/anexo76#9
2025-11-07 16:10:19 +00:00
29f637a5ee Refactor pedimento-related interfaces and forms to standardize date and payment fields
- Updated `PedimentoDates`, `PedimentoPayments`, `PedimentoTransportMeans`, and `PedimentoValidation` interfaces to include new fields and rename existing ones for consistency.
- Modified forms in Svelte components to reflect the updated interfaces, including new input fields for various dates and payment details.
- Enhanced status handling in the dashboard to accommodate new status options and improve user feedback.
- Implemented token validation on the server-side to ensure secure access to the dashboard.
- Cleaned up login logic to prevent redirection loops when tokens are present but potentially expired.
2025-11-07 10:08:55 -06:00
e6d7d23328 feat: Add payments, transport, and validation tabs for pedimento editing
- Implemented PaymentsTabForm component for managing payment information.
- Implemented TransportTabForm component for managing transport details.
- Implemented ValidationTabForm component for managing validation documents.
- Enhanced the main edit page to include new tabs and handle data saving for each section.
- Added alert components for success and error messages during save operations.
- Updated server-side logic to handle fetching and saving of pedimento data.
2025-11-07 00:02:35 -06:00
e50a86e014 Refactorización de nombres de módulos y actualizaciones:
- Creación y traducción de módulos:
  - gpaisreglaoct -> country_rule_oct
  - gpermisoreglaoct -> permission_rule_oct
  - gprecintos -> seal
  - gtipocambio -> exchange_rate
  - gfracroctava -> fraction_rule_octave
  - gbultos -> package

- Traducción de nombres de campos, clases y métodos al inglés.
- Renombrados los nombres de las tablas (__tablename__) en los modelos.
- Actualización de las importaciones en el archivo router.py para reflejar los nuevos nombres de módulos.
- Asegurada la consistencia en los nombres de clases, métodos y rutas.
- Agregado el campo tenant_id a los modelos que no lo incluían.
2025-11-06 22:05:43 -06:00
1de76c6efb Merge pull request 'catalogos-frontend' (#8) from catalogos-frontend into development
Reviewed-on: ADUANASOFT/anexo76#8
2025-11-07 02:31:16 +00:00
ef5c40af92 feat: Implement client and provider management service
- Added service layer for handling client and provider operations including creation, retrieval, updating, and deletion.
- Introduced DTOs for data transfer and validation.
- Implemented filtering and pagination for client/provider listing.
- Added logging for better traceability of operations.

feat: Create parts management module

- Developed a complete module for managing parts/components including creation, retrieval, updating, and deletion.
- Introduced DTOs for parts with detailed attributes and validation.
- Implemented search and filtering capabilities for parts based on various criteria.
- Added endpoints for regulatory information retrieval and parts statistics.
- Integrated logging for error handling and operational insights.
2025-11-06 20:29:18 -06:00
5c9dbacfdf Merge remote-tracking branch 'origin/catalogos_a76' into catalogos-frontend 2025-11-06 20:20:18 -06:00
3ac0f7b1b4 Merge pull request 'feature-pedimentos' (#5) from feature-pedimentos into catalogos-frontend
Reviewed-on: ADUANASOFT/anexo76#5
2025-11-07 00:36:30 +00:00
cf18c8e07d feat: Implement create/edit dialog for pedimentos management
- Added create-edit-dialog component for creating and editing pedimentos.
- Integrated dialog with data table actions for editing existing pedimentos.
- Implemented infinite scroll functionality in the data table for loading more pedimentos.
- Enhanced server-side loading of pedimentos with authentication checks.
- Added filtering options for pedimentos based on status, client ID, and year.
- Improved error handling and user feedback for actions like creating, editing, and deleting pedimentos.
2025-11-06 18:35:47 -06:00