npsplk/npsp

Api for requesting schedules

Opened this issue · 0 comments

API should return schedules based on input parameters (start location, end location, datetime range).

Example:-
Query String Parameters:

{
"startLocation": {"id":1},
"endLocation":  {"id":2},
"minDateTime": "2019-03-25T14:50:00.000Z",
"maxDateTime": "2019-03-26T18:50:00.000Z"
}

Sample Response:
[{"id":243,"startTime":"2019-02-08T11:10:00Z","endTime":"2019-02-08T12:50:00Z","isActive":true,"vehicle":{"id":154,"registrationNumber":"M-18","numberOfSeats":52,"driver":null,"transportType":{"id":1,"typeName":"Bus","metaCode":"bus","description":"transportation method is by bus"},"vehicleFacilities":null},"driver":null,"route":{"id":8,"routeName":"Matara-Makumbura (Southern Expressway)","routeNumber":"EX-1-1","routeLocations":[{"id":28,"sequenceNumber":1,"location":{"id":2,"locationName":"Makumbura","locationNameSinhala":"මාකුඹුර","locationNameTamil":"Makumbura","longitude":50.0,"latitude":40.0,"locationType":{"id":1,"typeName":"Bus Station","metaCode":"bus_station"}},"route":{"id":8,"routeName":"Matara-Makumbura (Southern Expressway)","routeNumber":"EX-1-1"}},{"id":29,"sequenceNumber":2,"location":{"id":9,"locationName":"Matara","locationNameSinhala":"මාතර","locationNameTamil":"மாத்தறை","longitude":40.0,"latitude":50.0,"locationType":{"id":1,"typeName":"Bus Station","metaCode":"bus_station"}},"route":{"id":8,"routeName":"Matara-Makumbura (Southern Expressway)","routeNumber":"EX-1-1"}}]},"bay":{"id":7,"bayName":"Bay 07","bindingAddress":null},"weekdays":null,"vehicleFacilities":null}]

Special Notes:

  1. Schedule instances are available only up to next X hours. If the user requests for future time period, the information should be queried from scheduleTemplates entity.
  2. response should be sorted by departure time.