Closed nmrgt closed 1 month ago
The pull request introduces several changes across multiple files, enhancing date manipulation capabilities, modifying data structures, and updating API specifications. Key updates include the addition of a differenceInHours
function for calculating time differences, the enforcement of required fields in data transfer objects, and the standardization of schema definitions. Additionally, dynamic timestamp values replace fixed dates in mock data, improving flexibility in testing scenarios.
File Path | Change Summary |
---|---|
api/src/deps.ts |
Added export { difference } from Deno's datetime module. |
api/src/lib/date/index.ts |
Introduced differenceInHours(d1: Date, d2: Date): number function for hour calculations. |
api/src/pdc/providers/carpool/mocks/database/carpool.ts |
Updated start_datetime and end_datetime to dynamic values based on the current time. |
api/src/pdc/providers/carpool/providers/CarpoolAcquisitionService.ts |
Modified carpool status logic using differenceInHours to check if acquisition is expired. |
api/src/shared/acquisition/common/interfaces/CreateJourneyDTO.ts |
Changed operator_trip_id from optional to required. |
api/src/shared/acquisition/common/schemas/createJourneySchemaV3.ts |
Standardized quotation marks and added operator_trip_id as a required field. |
doc/docs/.vuepress/public/specs/operateurs-api-v3.yaml |
Added operator_trip_id to the required fields in the API specification schema. |
sequenceDiagram
participant User
participant API
participant CarpoolService
participant DateLibrary
User->>API: Request carpool acquisition
API->>CarpoolService: Check carpool status
CarpoolService->>DateLibrary: differenceInHours(created_at, start_datetime)
DateLibrary-->>CarpoolService: Return hours difference
CarpoolService-->>API: Return carpool status (Expired/Received)
API-->>User: Respond with carpool status
🐇 In the meadow where the timestamps play,
A new function hops in, brightening the day.
With hours counted, and fields made right,
Our journeys now shine, oh what a sight!
Let's cheer for the code, as it leaps and bounds,
In the world of data, joy abounds! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Features:
Summary by CodeRabbit
New Features
differenceInHours
function for calculating hour differences between dates.operator_trip_id
as a required field in journey-related schemas and interfaces.Bug Fixes
Documentation
operator_trip_id
field.Style