#pragma once #include #include "tariff_cfg.h" #include "tariff_utils.h" #include "tariff_payment_method.h" #include "tariff_vehicle_types.h" #include "tariff_time_range.h" /// /// Definition of TariffCalculator class /// class TariffCalculator { public: /// /// Gets duration in seconds from cost /// /// Pointer to configuration /// Type of vehicle /// Date/time of payment to be conducted in ISO8601 format (e.g. 2022-12-25T08:00:00Z) /// /// Returns duration in seconds (data type: double) double GetDurationFromCost(TariffConfiguration* tariff_cfg, uint8_t vehicle_type, char const *start_datetime, double price); /// /// Gets cost from duration in seconds /// /// Pointer to configuration /// Type of vehicle /// Date/time of payment to be conducted in ISO8601 format (e.g. 2022-12-25T08:00:00Z) /// Duration of parking in minutes /// Returns cost (data type: double) double GetCostFromDuration(TariffConfiguration* tariff_cfg, uint8_t vehicle_type, char const *start_datetime, double durationMin); };