From 78b1e3bb4398b325f5ed1c74b30ac312c130300d Mon Sep 17 00:00:00 2001 From: Krystian Sz Date: Mon, 24 Jun 2024 07:41:18 +0700 Subject: [PATCH] Create TransportService to unify all related services --- src/services.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/services.ts b/src/services.ts index bf34c72..50b11fc 100644 --- a/src/services.ts +++ b/src/services.ts @@ -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) { @@ -20,7 +27,7 @@ export class BusService { } } -export class MetroService { +export class MetroService implements TransportService { private fares: MetroStationFares constructor(fares?: Partial) {