Draft
Conversation
Contributor
traines-source
left a comment
There was a problem hiding this comment.
LGTM, at least I can't think of anything important that we would be absolutely missing.
For reference, this was the script we once used to obtain some statistics:
SELECT l.distance as besetztkm, l.distance*request.passengers as personenkm, l.duration as besetztzeit, (tour.arrival-tour.departure)/1000 tourzeit, tour.departure as tour_start_ts, tour.arrival as tour_end_ts
FROM journey
JOIN request ON request.id = journey.request1
JOIN tour ON request.tour = tour.id
JOIN LATERAL jsonb_to_recordset(journey.json -> 'legs') AS l(distance numeric, duration numeric, mode text) ON true
WHERE NOT tour.cancelled
AND NOT request.cancelled and request.ticket_checked and l.mode = 'ODM';
| .innerJoin('company', 'company.id', 'vehicle.company') | ||
| .where('tour.arrival', '<', Date.now()) | ||
| .where('tour.approachAndReturnM', 'is', null) | ||
| .where('tour.cancelled', '=', false) |
Contributor
There was a problem hiding this comment.
I think this could also be interesting for cancelled tours?
Contributor
Author
There was a problem hiding this comment.
I agree. So far I avoided touching this since, #582 means there might be tours for which it is not trivial to tell which requests belonged to it before it was cancelled. So I will probably look at this issue before merging this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add scripts for computing and viewing some statistics