Skip to content

Commit

Permalink
[ADD] Flight models added
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil-Pahwa committed Dec 4, 2017
1 parent b72a9dd commit d6a0745
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/app/shared/resources/flights.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export interface RemoteFlight {
origin: string;
deptime: string;
duration: string;
flightno: number;
airline: string;
}

export interface Flight {
origin: string;
deptime: string;
duration: string;
flightno: number;
airline: string;
}

export class Flight implements Flight {
constructor(
public origin: string,
public deptime: string,
public duration: string,
public flightno: number,
public airline: string
) {
}
}

export function FlightFromRemote(flight: RemoteFlight): Flight {
return new Flight(flight.origin, flight.deptime, flight.duration, flight.flightno, flight.airline);
}
1 change: 1 addition & 0 deletions src/app/shared/resources/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './flights';

0 comments on commit d6a0745

Please sign in to comment.