UNPKG

@golemio/parkings

Version:
40 lines (39 loc) 1.63 kB
import { IParkingsTariff } from "../data-access/v2/V2ParkingTariffsRepository"; import ICentroidPg from "../models/interfaces/ICentroidPg"; import { IParkingsTariffChargeNormalized } from "./interfaces/IParkingsTariffChargeNormalized"; import { IPostalAddress } from "@golemio/core/dist/integration-engine"; import { IGeoJSONFeatureCollection, TGeoCoordinates } from "@golemio/core/dist/output-gateway"; import { IParkings } from "../models/ParkingsModel"; import { IParkingsFeature } from "./interfaces/IParkingFeature"; export interface IParkingsFlattened { id: string; source: string; source_id: string; data_provider: string | null; name: string; category: string | null; date_modified: string | null; address: IPostalAddress | null; location: TGeoCoordinates; area_served: string | null; payment_web_url: string | null; payment_android_url: string | null; payment_ios_url: string | null; total_spot_number: number; tariff_id: string | null; valid_from: string | null; valid_to: string | null; distance?: number; parking_type: string | null; zone_type: string | null; centroid: ICentroidPg; available_spots_last_updated: string; available_spots_number: number; } export declare class ParkingsTransformationFabric { buildFeatureItem: (locationFromDb: IParkingsFlattened) => IParkingsFeature; private transformAvailableSpotsLastUpdated; buildFeatureCollection: (locations: IParkings[]) => IGeoJSONFeatureCollection; getChargeData: (data: IParkingsTariff) => IParkingsTariffChargeNormalized; private getCentroid; }