Commit Graph

565 Commits

Author SHA1 Message Date
1a01757c63 Merge branch 'development' into feature/validaciones-invoices-transports 2026-04-01 13:42:49 -06:00
e8b4cbd377 checkpoint 2026-04-01 13:40:46 -06:00
61633fd969 Merge pull request 'feature/columnas_ordenamiento' (#259) from feature/columnas_ordenamiento into development
Reviewed-on: ADUANASOFT/anexo76#259
2026-03-30 14:50:10 +00:00
a08a62bc31 feature/alineacion-validaciones-carga-csv-con-manual-invoices 2026-03-27 14:57:38 -06:00
7a029307a8 feature/validaciones-invoices-transortes 2026-03-27 12:56:47 -06:00
b477233245 feature/migraciones-id-transportes 2026-03-27 09:32:59 -06:00
183a6f3348 correcion de saldos temporales 2026-03-27 09:50:47 -05:00
d93c4c6b7b Mecanismo sort para tablas 2026-03-27 08:45:51 -05:00
26977b881a Merge branch 'development' into feature/table-celery-tasks 2026-03-25 07:15:31 -06:00
85247e2713 fix/quitar-dato-empresa 2026-03-25 07:12:22 -06:00
a6c5abbe4c Enhance invoice validation logic to support existing invoices
- Updated the `validate_common` function to accept an optional `existing_invoice` parameter, allowing for more robust validation when updating invoices.
- Introduced a new helper function, `_normalize_invoice_currency_value`, to standardize currency code handling.
- Adjusted currency validation logic to ensure proper handling of existing invoice data, preventing changes to currency types when associated line items exist.
- Modified the `validate_update` functions in both imports and exports to pass the `existing_invoice` parameter, ensuring consistent validation across different update scenarios.
2026-03-24 18:52:53 -05:00
28de77e50b Refactor Alembic migration for index management and column type update
- Simplified the index drop and creation logic in the `upgrade` and `downgrade` functions by removing the unnecessary existence check for the `carta_porte_codes` table.
- Updated the `iva_factor` column type in the `invoice_financials` table from VARCHAR to Numeric, enhancing data integrity.
- Improved the overall clarity and efficiency of the migration script.
2026-03-24 18:05:24 -05:00
c565696242 feature/limpieza-periodica 2026-03-24 16:58:48 -06:00
06b3b20fd8 Refactor test setup to utilize ephemeral tenant IDs
- Introduced a new fixture, `test_tenant`, to allocate ephemeral tenant and company IDs for tests, reducing conflicts with real data.
- Updated various test functions to use the new `test_tenant` fixture, ensuring consistent tenant ID usage across tests.
- Enhanced the `ensure_tenant_company` function to accept dynamic tenant and company IDs, improving flexibility in test scenarios.
- Adjusted database interaction in tests to utilize the ephemeral IDs, streamlining the setup process and enhancing isolation.
2026-03-24 17:24:01 -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
18e4477bf1 Add TEST_DATABASE_URL to configuration settings
- Introduced a new configuration variable, TEST_DATABASE_URL, to specify the test database connection string.
- This addition enhances the flexibility of database handling, particularly for testing scenarios, aligning with recent improvements in database URL management.
2026-03-24 15:35:13 -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
481b295ab0 Merge pull request 'feature/table-celery-tasks' (#247) from feature/table-celery-tasks into development
Reviewed-on: ADUANASOFT/anexo76#247
2026-03-24 19:16:49 +00:00
3d1c73565f fix/un-alembic 2026-03-24 13:15:15 -06:00
b5b99a5ddb feature/tabla-bitacora-logs-task 2026-03-24 13:07:35 -06:00
bf8062acea Merge pull request 'Add detailed test flow documentation to backend tests README' (#246) from feature/testing into development
Reviewed-on: ADUANASOFT/anexo76#246
2026-03-24 17:58:23 +00:00
0ea17fd091 Add detailed test flow documentation to backend tests README
- Expanded the README.md for backend tests to include a comprehensive overview of the test flow, infrastructure, and edge cases.
- Introduced sections detailing the structure of tests, including integration and unit tests, along with diagrams to illustrate the business flow and common scenarios.
- Enhanced clarity on the setup and execution of tests, including database handling and security measures during testing.
- This update aims to improve understanding and maintainability of the testing framework for future contributors.
2026-03-24 12:58:01 -05:00
673ec5d1d6 Merge pull request 'Add address handling for ClientProvider in business catalog creation' (#244) from feature/testing into development
Reviewed-on: ADUANASOFT/anexo76#244
2026-03-24 17:42:40 +00:00
c812f5214c Add address handling for ClientProvider in business catalog creation
- Introduced a new helper function `_ensure_client_provider_address` to manage the assignment of addresses for ClientProvider instances.
- Refactored the `create_business_catalogs` function to utilize the new helper, ensuring that existing addresses are reused if available, preventing duplicate entries.
- This change enhances the integrity of address data during business catalog creation by ensuring proper address assignment based on existing records.
2026-03-24 12:42:19 -05:00
a44b54e28b Merge pull request 'feature/testing' (#241) from feature/testing into development
Reviewed-on: ADUANASOFT/anexo76#241
2026-03-24 17:33:48 +00:00
b750c35522 Add backend test job to CI workflow
- Introduced a new job in the CI workflow to run backend tests before the build process.
- Configured Python environment and installed dependencies from the backend requirements.
- Added a check for the TEST_DATABASE_URL secret to ensure it is defined before running tests.
- The test job must pass for the build job to execute, enhancing the reliability of the CI pipeline.
2026-03-24 12:33:21 -05:00
23509cbcc9 Refactor DTO classes to use model_config with ConfigDict for attribute handling
- Updated multiple DTO classes across various modules to replace the `Config` class with `model_config = ConfigDict(from_attributes=True)`.
- This change enhances consistency in attribute handling and aligns with the latest Pydantic practices.
- Adjusted error handling in core modules to change status codes from `HTTP_422_UNPROCESSABLE_ENTITY` to `HTTP_422_UNPROCESSABLE_CONTENT` for improved clarity in validation responses.
2026-03-24 12:06:55 -05:00
58222e9ca9 fix/pedimentos-edit-datos-borrados 2026-03-24 09:16:05 -06:00
2144ef572f fix/borrar-lineas-migracion 2026-03-24 08:16:55 -06:00
0c090c0b1f Merge branch 'development' into feature/csv-pruebas 2026-03-24 08:08:32 -06:00
79b2506af4 feature/fix-invoices-csv 2026-03-24 08:06:48 -06:00
d69dd23bcd Enhance invoice processing logic for IMD and Mexican purchases
- Updated validation logic to restrict 'IMD' document type usage unless the invoice type is 'DEF'.
- Refactored value assignment in the main processing flow to handle 'DEF' and 'MEX' invoice types with specific IVA calculations.
- Added logging for invoice processing to improve traceability and debugging.

These changes improve the accuracy of invoice validations and processing for specific document types.
2026-03-23 11:42:35 -05:00
e549a84459 Remove legacy MovementService class and associated methods from services_old.py
- Deleted the MovementService class, which handled movement operations for temporary imports, including methods for building query clauses and calculating exchange rates.
- This removal streamlines the codebase by eliminating unused legacy code, improving maintainability and clarity in the invoice processing logic.
2026-03-23 09:48: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
9cfc8b3215 feature/carga-csv-db-expo-data-to-platform 2026-03-20 15:04:28 -06:00
a8d548d91e Refactor date handling in DashboardService for invoice queries
- Updated the date calculations in the DashboardService to use the `invoice_date` field instead of `created_at` for querying previous totals and monthly data.
- Changed the date variables to return only the date part, improving clarity and consistency in date handling.

These changes enhance the accuracy of invoice data retrieval in the dashboard service.
2026-03-20 11:52:47 -05:00
54c137c156 Refactor invoice processing logic to remove legacy returned quantity fields and enhance data handling
- Updated invoice processing functions to eliminate legacy fields related to returned quantities, now relying on new balance movement and discharge records.
- Adjusted various components and services to reflect changes in quantity handling, including updates to the frontend for displaying used quantities instead of returned ones.
- Improved the logic for invoice total updates and validation processes to ensure consistency with the new data structure.

These changes aim to streamline invoice management and improve data integrity across the application.
2026-03-20 11:42:18 -05:00
9e30dede1c checkpoint 2026-03-20 09:49:46 -06:00
a2ad6d782d Merge pull request 'Correcion para restarle cantidad a la version mas actualiazda de la factrua de importacion' (#233) from fix/saldos_temporales into development
Reviewed-on: ADUANASOFT/anexo76#233
2026-03-19 22:36:51 +00:00
0d3b29ef00 Correcion para restarle cantidad a la version mas actualiazda de la factrua de importacion 2026-03-19 15:58:14 -05:00
cf56ca3a68 Enhance invoice processing and validation logic
- Updated `InvoiceService` to accurately reflect the number of line items in `party_count` for invoices.
- Modified weight calculations in the create and update validators to ensure consistent handling of weight types, now using lowercase comparison for "KGS".
- Adjusted invoice data structure in the frontend to include `total_items` and refined logistics handling.
- Improved table rendering in the invoice edit component for better sticky header behavior and item visibility.

These changes aim to improve data integrity and user experience in invoice management.
2026-03-19 14:22:21 -05:00
264188e112 Merge pull request 'se arreglo los furmularios de partes' (#231) from fix/partes into development
Reviewed-on: ADUANASOFT/anexo76#231
2026-03-19 18:42:32 +00:00
37920aa303 se arreglo los furmularios de partes 2026-03-19 12:49:16 -05:00
60164605eb Merge branch 'development' of https://git.aduanasoft.com/ADUANASOFT/anexo76 into feature/saldos_temporales_nueva_tabla 2026-03-19 10:43:01 -05:00
88dda834cb Refactorizacion de la tabla balances_movement para la generacion de reportes CSV de saldos emporales 2026-03-19 10:41:27 -05:00
e570fd5b2e Merge pull request 'feature/csv-pruebas' (#229) from feature/csv-pruebas into development
Reviewed-on: ADUANASOFT/anexo76#229
2026-03-18 22:13:00 +00:00
3f16378ed0 feature/fix-invoice-status 2026-03-18 15:49:47 -06:00
03f2213729 Update seed_initial_data.py to correct imports and adjust revision identifiers. Replaced sectors seed import with carta_porte_codes seed and updated down_revision and depends_on to reflect the latest migration state. 2026-03-18 16:43:19 -05:00