diff --git a/src/repositories/InMemoryParkingRepository.ts b/src/repositories/InMemoryParkingRepository.ts index 763ab38..a23a886 100644 --- a/src/repositories/InMemoryParkingRepository.ts +++ b/src/repositories/InMemoryParkingRepository.ts @@ -1,36 +1,44 @@ import { ParkingGetterSetterRepository } from "./ParkingGetterSetterRepository"; -import { IParkingStructure } from "../entities/ParkingRepositoryEntities"; +import { + IParkingStructure, + IParkingStructureTimestampRecord +} from "../entities/ParkingRepositoryEntities"; +import { HistoricalParkingAverageQueryResult } from "./ParkingGetterRepository"; + +type ParkingStructureID = string; export class InMemoryParkingRepository implements ParkingGetterSetterRepository { - private structures: Map; - - constructor() { - this.structures = new Map(); + constructor( + private structures: Map = new Map(), + private historicalData: Map = new Map(), + ) { } - async addOrUpdateParkingStructure(structure: IParkingStructure): Promise { + addOrUpdateParkingStructure = async (structure: IParkingStructure): Promise => { this.structures.set(structure.id, { ...structure }); - } + }; - async clearParkingStructureData(): Promise { + clearParkingStructureData = async (): Promise => { this.structures.clear(); - } + }; - async getParkingStructureById(id: string): Promise { + getParkingStructureById = async (id: string): Promise => { const structure = this.structures.get(id); return structure ? { ...structure } : null; - } + }; - async getParkingStructures(): Promise { - return Array.from(this.structures.values()).map(structure => ({ ...structure })); - } + getParkingStructures = async (): Promise => Array.from(this.structures.values()).map(structure => ({...structure})); - async removeParkingStructureIfExists(id: string): Promise { + removeParkingStructureIfExists = async (id: string): Promise => { const structure = this.structures.get(id); if (structure) { this.structures.delete(id); return { ...structure }; } return null; - } + }; + + getHistoricalAveragesOfParkingStructureCounts = async (id: string): Promise => { + return []; + }; }