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
|
// to convert from data repo to GraphQL schema
|
||||||
|
|
||||||
import { GetterRepository } from "./GetterRepository";
|
import { GetterRepository } from "./GetterRepository";
|
||||||
|
import { IEta, IOrderedStop, IRoute, IShuttle, IStop, ISystem } from "../entities/entities";
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GetterRepository interface for data derived from Passio API.
|
* GetterRepository interface for data derived from Passio API.
|
||||||
|
|||||||
Reference in New Issue
Block a user