Skip to content

VSN-1991 : Changing the download exportation url path to match with patterns of downloads in other app sections.

yassine.elazami a demandé de fusionner VSN-1991 vers develop

Exportation Download Refinement — Detailed Merge Request Description

Overview

This merge request delivers a complete refactor of the prepared passenger exportation download feature. The goal is to align the download behavior with existing frontend patterns, enforce cleaner backend architecture, centralize exception handling, and improve error management through logging instead of explicit response exposure. The changes bring consistency, maintainability, and robustness to the exportation workflow.


Included Changes

1. refactor(exportation) : Exportation download

  • Updated the exportation download endpoint to fully align with frontend conventions already adopted in other export sections.
  • Ensured that the download path now respects unified routing patterns used across the application.
  • Improved interoperability between frontend and backend export features.

2. doc(changelog) : Changelog update

  • Added an entry documenting the modifications applied to the exportation download logic and endpoint.
  • Ensured that versioning history remains accurate and up to date.

3. refactor(download) : Exportation download

  • Refactored the exportation service logic to delegate responsibilities properly:
    • The controller now handles only endpoint mapping, without containing any business logic.
    • All export processing is now encapsulated entirely within the service layer.
  • Improved separation of concerns and made the controller more compliant with clean architecture practices.

4. refactor(download) : Exceptions mapping

  • Introduced a dedicated exception messages dictionary to standardize error messages related to exportation download failures.
  • Integrated the "download error" mapping into the service logic to unify failure handling.
  • Reduced duplication and made error messaging maintainable and consistent across the module.

5. refactor(download) : Keeping only Functional Exp.

  • Simplified the exportation service error model by keeping only Functional Exceptions.
  • Removed unnecessary or redundant exception types to enforce a cleaner and more predictable exception hierarchy.
  • Ensured the download logic follows internal guidelines requiring the use of custom Functional exceptions only.

6. refactor(download) : logging instead of display

  • Replaced error message exposure with proper server-side logging.
  • Removed direct error display in HTTP responses to prevent leaking internal details.
  • This change:
    • Strengthens security,
    • Improves debugging for developers,
    • Keeps API behavior uniform and compliant with internal exception-handling rules.

Impact

  • Fully standardized exportation download behavior with other export modules.
  • More consistent, secure, and maintainable error handling.
  • Cleaner controller structure and better separation of concerns.
  • Easier debugging through centralized logging.
  • Harmonized endpoint structure expected by frontend consumers.

Conclusion

This refactor significantly improves the reliability and architectural quality of the exportation download process. The newly standardized endpoint, unified exception mapping, cleaned-up service structure, and secure error logging establish a solid and scalable foundation for future export-related enhancements.

Closes VSN-1991

Modification effectuée par yassine.elazami

Rapports de requête de fusion