mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
move entities to separate file
This commit is contained in:
47
src/entities/entities.ts
Normal file
47
src/entities/entities.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
export interface IEntityWithId {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ISystem extends IEntityWithId {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ICoordinates {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
}
|
||||
|
||||
export interface IRoute extends IEntityWithId {
|
||||
name: string;
|
||||
color: string;
|
||||
polylineCoordinates: ICoordinates[];
|
||||
systemId: string;
|
||||
}
|
||||
|
||||
export interface IStop extends IEntityWithId {
|
||||
name: string;
|
||||
systemId: string;
|
||||
coordinates: ICoordinates;
|
||||
}
|
||||
|
||||
export interface IShuttle extends IEntityWithId {
|
||||
coordinates: ICoordinates;
|
||||
name: string;
|
||||
routeId: string;
|
||||
systemId: string;
|
||||
}
|
||||
|
||||
export interface IEta {
|
||||
secondsRemaining: number;
|
||||
shuttleId: string;
|
||||
stopId: string;
|
||||
}
|
||||
|
||||
export interface IOrderedStop {
|
||||
nextStop?: IOrderedStop;
|
||||
previousStop?: IOrderedStop;
|
||||
routeId: string;
|
||||
stopId: string;
|
||||
position: number;
|
||||
}
|
||||
|
||||
@@ -2,53 +2,7 @@
|
||||
// to convert from data repo to GraphQL schema
|
||||
|
||||
import { GetterRepository } from "./GetterRepository";
|
||||
|
||||
export interface IEntityWithId {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ISystem extends IEntityWithId {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ICoordinates {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
}
|
||||
|
||||
export interface IRoute extends IEntityWithId {
|
||||
name: string;
|
||||
color: string;
|
||||
polylineCoordinates: ICoordinates[];
|
||||
systemId: string;
|
||||
}
|
||||
|
||||
export interface IStop extends IEntityWithId {
|
||||
name: string;
|
||||
systemId: string;
|
||||
coordinates: ICoordinates;
|
||||
}
|
||||
|
||||
export interface IShuttle extends IEntityWithId {
|
||||
coordinates: ICoordinates;
|
||||
name: string;
|
||||
routeId: string;
|
||||
systemId: string;
|
||||
}
|
||||
|
||||
export interface IEta {
|
||||
secondsRemaining: number;
|
||||
shuttleId: string;
|
||||
stopId: string;
|
||||
}
|
||||
|
||||
export interface IOrderedStop {
|
||||
nextStop?: IOrderedStop;
|
||||
previousStop?: IOrderedStop;
|
||||
routeId: string;
|
||||
stopId: string;
|
||||
position: number;
|
||||
}
|
||||
import { IEta, IOrderedStop, IRoute, IShuttle, IStop, ISystem } from "../entities/entities";
|
||||
|
||||
/**
|
||||
* GetterRepository interface for data derived from Passio API.
|
||||
|
||||
Reference in New Issue
Block a user