Add barebones function for getServiceDetailByRID
All checks were successful
Testing / run-tests (push) Successful in 3m17s
All checks were successful
Testing / run-tests (push) Successful in 3m17s
This commit is contained in:
parent
ca85bbd6be
commit
cd2ce601c6
@ -1,5 +1,5 @@
|
||||
import { GenericV2_ApiResponse } from "../types/generic/GenericTypesV2";
|
||||
import { LdbV2_Staff } from "../types/ldb/LdbTypesV2";
|
||||
import { LdbV2_ServiceDetail, LdbV2_Staff } from "../types/ldb/LdbTypesV2";
|
||||
import { BaseOwlBoardClient } from "./client";
|
||||
|
||||
export class LdbClientV2 {
|
||||
@ -16,16 +16,21 @@ export class LdbClientV2 {
|
||||
}
|
||||
|
||||
// async getPublicLdb(station: string): Promise<LdbV2_Public> {}
|
||||
|
||||
async getServiceDetailByRID(rid: string): Promise<LdbV2_ServiceDetail> {
|
||||
const path = `/api/v2/live/train/rid/${rid}`;
|
||||
return this.client.makeRequest("GET", path);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Calls to include:
|
||||
|
||||
[X] Staff LDB
|
||||
[] Staff LDB - Need to validate input.
|
||||
[] Public LDB
|
||||
[] Get Service by RID
|
||||
[] Get Service by RID - NOT DONE, Types need revising on the backend.
|
||||
[] Get Service by 'Other?'
|
||||
[] Get nearest stations
|
||||
[X] Get nearest stations -- This has been implemented in the Reference Client
|
||||
|
||||
*/
|
@ -44,4 +44,19 @@ export interface LdbV2_ServiceLocation {
|
||||
tiploc: string;
|
||||
name?: string;
|
||||
via?: string;
|
||||
}
|
||||
|
||||
// This need improvement in the backend. Currently raw data from upstream is piped to the client
|
||||
export interface LdbV2_ServiceDetail {
|
||||
generatedAt: string;
|
||||
rid: string;
|
||||
uid: string;
|
||||
trainid: string;
|
||||
sdd: string;
|
||||
operator: string;
|
||||
operatorCode: string;
|
||||
serviceType: string;
|
||||
cancelReason: string;
|
||||
category: string;
|
||||
locations: [];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user