Skip to content

VSN-2115 : Adding feature of initial circuits generation.

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

Merge Request Description

Title

VSN-2115: Circuit Initialization & Mapping Enhancements with Improved Service and DTO Structure


Overview

This merge request introduces a complete overhaul of the circuit initialization and mapping workflow, including new DTOs and POJOs for map representation, service signature definitions, and repository enhancements to better handle circuits and associated passengers. Additionally, it removes unsupported collection methods to streamline code quality and ensure maintainability.


Detailed Changes

1. Removal of Unsupported Methods

  • Refactor (ba9efd93): Removed outdated or unsupported collection methods:
    • AddFirst
    • AddLast
    • getFirst
    • getLast
  • This reduces potential runtime errors and improves code readability.

2. Endpoint & Controller Exposure

  • Feature exposition (91b3185b): Exposed the new circuit initialization and mapping feature via the controller.
  • Init circuits generation path (5772e770): Added endpoint path for initializing circuits display, enabling external clients to fetch initial circuit data.

3. Circuit Mapping & DTOs

  • Implementation (003d7a98): Finalized the logic for constructing circuits from service data.
  • New mapping method (8471b2d5):
    • Mapping between CircuitMap and CircuitMapMarker.
    • Refactored DTOs to POJOs to allow progressive construction of map points and coordinates.
  • Map DTO & POJOs (6aae9951):
    • Added CircuitMapDTO for external exposure.
    • Introduced MapPoint and MapCoordinates POJOs to represent positions on maps.

4. Repository Enhancements

  • Repo method (93c0c61e): Fetch circuits that have non-empty associated passengers, ensuring only relevant circuits are considered for display or processing.

5. Service Layer Improvements

  • Service signature (8c87c6de): Defined clear service methods for circuit generation and mapping.
  • New code exception (46f026c4):
    • Exception for unvalidated passengers in mass importation.
    • Integrated into service layer to prevent improper circuit creation.

6. Business Logic Refactor

  • Mass Importation Logic (c6d35414):
    • Prevented creation of circuits with duplicate codes.
    • Ensures circuit uniqueness and prevents inconsistencies in the system.

Benefits

  • Improved data mapping: Circuits and map points now have a structured representation via POJOs and DTOs.
  • Safer service operations: New exceptions prevent processing of incomplete or invalid data.
  • Cleaner codebase: Removed legacy methods and refactored DTOs → POJOs.
  • Enhanced API usability: Exposed endpoints with clear input/output structures for initializing and fetching circuits.

Impact & Compatibility

  • Backward-compatible: Existing endpoints remain unaffected.
  • New DTOs and mapping logic provide a foundation for further features such as map rendering, visualizations, and passenger assignments.

Conclusion

This MR delivers a robust circuit initialization and mapping framework, improving maintainability, correctness, and API usability. It establishes a clear separation between service logic, repository queries, DTOs, and UI-facing map structures.

Closes VSN-2115

Modification effectuée par yassine.elazami

Rapports de requête de fusion