MOBILISIS-Calculator/library/include/mobilisis/tariff_calc.h

35 lines
1.4 KiB
C
Raw Normal View History

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