Skip to content

Commit

Permalink
Create TransportService to unify all related services
Browse files Browse the repository at this point in the history
  • Loading branch information
sztadii committed Jun 24, 2024
1 parent 6d94769 commit 78b1e3b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ import {
metroStationFares
} from './config'

export class BusService {
interface TransportService {
getTransactionCharge(
transaction?: Transaction,
lastTransaction?: Transaction
): number
}

export class BusService implements TransportService {
private fares: BusFares

constructor(fares?: Partial<BusFares>) {
Expand All @@ -20,7 +27,7 @@ export class BusService {
}
}

export class MetroService {
export class MetroService implements TransportService {
private fares: MetroStationFares

constructor(fares?: Partial<MetroStationFares>) {
Expand Down

0 comments on commit 78b1e3b

Please sign in to comment.