- Modified the error message in the build workflow to clarify the expected format for the TEST_DATABASE_URL, specifying the use of a real IP address instead of the placeholder "host".
- This change enhances the guidance provided to users, ensuring correct configuration for database connections in testing scenarios.
- 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.
- 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.
- 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.
- 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.
- 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.
- Added an environment variable for the test database URL and executed an Alembic migration to ensure the database schema is up-to-date prior to running tests.
- This change aims to improve the reliability of test execution by ensuring the correct database state.
- 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.
- Updated the pytest command in the CI workflow to include additional flags for verbose output, allowing for more detailed test results and easier debugging.
- This change improves the visibility of test execution details, aiding in the identification of issues during the CI process.
- 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.
- Added a function to install the python3-venv package if the virtual environment creation fails due to missing ensurepip.
- Improved error handling and messaging for the installation process, ensuring compatibility with both root and non-root users.
- Streamlined the activation of the virtual environment for better clarity in the CI pipeline.
- Consolidated the installation of backend dependencies and test execution into a single job in the CI workflow.
- Removed the use of actions/setup-python in favor of system Python and virtual environments to avoid issues on self-hosted runners.
- Added checks for the TEST_DATABASE_URL secret and improved error handling for virtual environment creation.
- Enhanced the overall reliability and clarity of the testing process in the CI pipeline.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.