Skip to content

VSN-1998 : Implementing logic of fetching different schedules & hours related to a prepared passenger associated establishment.

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

Merge Request Description

Prepared Passengers Schedules Extraction & Establishment Hours Integration

Overview

This merge request introduces a complete and structured implementation for extracting schedules related to prepared passengers by leveraging establishment working hours retrieved from an external administration service. The feature covers the full workflow, starting from DTO definitions and external service integration, through business logic implementation, up to REST API exposition and documentation updates.

The objective is to enable accurate computation and exposure of transport schedules associated with prepared passengers, based on establishment availability, transport configuration, and temporal constraints.


Functional Scope

1. New Schedules Extraction Feature

  • Introduced a dedicated feature to extract schedules for prepared passengers associated with establishments.
  • The extraction process is based on establishment opening hours and transport configuration.
  • The feature ensures consistency between passenger data, establishment data, and generated schedules.

Backend Changes

Service Layer

  • Added a new method signature in the prepared passenger service dedicated to schedules extraction.
  • Finalized the implementation logic responsible for:
    • Fetching establishment hours.
    • Generating schedule outcomes.
    • Mapping domain data into response DTOs.
  • Ensured clean separation between orchestration logic and utility logic.

Utility Logic

  • Introduced a utility method createScheduledTimes to generate schedule outcome objects based on request parameters.
  • Added a final enum converter class to centralize and standardize date and enumeration conversions.
  • Improved overall maintainability by isolating transformation logic.

External Integration

Admin Service Integration

  • Added a new external admin service method signature to retrieve establishment hours by establishment UUID.
  • Implemented the external call logic to fetch establishment working hours.
  • Introduced a dedicated response DTO to deserialize establishment hours data received from the admin service.

DTO & Model Enhancements

New DTOs

  • Added a DTO dedicated to passenger schedule extraction requests.
  • Added a DTO to represent establishment hours retrieved from the admin service.

DTO Refactoring

  • Refactored transport-related DTOs to include establishment UUID for better data alignment.
  • Refactored daily transport DTOs by adding annotations to avoid exposing null attributes.
  • Enhanced schedule response DTO by introducing additional attributes:
    • Trip direction (sens)
    • Schedule time
    • Period of day
    • Day of week

These changes improve clarity, extensibility, and API consumer usability.


API Layer

New Endpoint

  • Defined a new REST endpoint dedicated to extracting schedules of prepared passengers’ associated establishments.
  • Exposed the feature via the appropriate controller with a clean and explicit contract.

Finalization & Stability

  • Finalized the full implementation of schedules extraction, ensuring all dependencies are properly wired.
  • Verified coherence between request DTOs, service logic, and response structures.
  • Ensured the feature is production-ready and aligned with existing architectural patterns.

Documentation

  • Updated the changelog markdown file to reflect:
    • Introduction of the schedules extraction feature.
    • New endpoints and DTOs.
    • Refactoring and enhancement of existing models.

Summary

This merge request delivers a robust and extensible schedules extraction feature that:

  • Integrates external establishment hours.
  • Produces structured and enriched schedule responses.
  • Improves DTO consistency and expressiveness.
  • Exposes a clean REST API for downstream consumers.

The implementation adheres to clean architecture principles and prepares the system for future extensions related to transport planning and scheduling.

Closes VSN-1998

Rapports de requête de fusion