start repository for mobilisis tariff-calculation
This commit is contained in:
29
library/include/mobilisis/calculator_functions.h
Normal file
29
library/include/mobilisis/calculator_functions.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include "configuration.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Calculator
|
||||
{
|
||||
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>
|
||||
std::string GetDurationFromCost(Configuration* cfg, uint8_t vehicle_type, char const* start_datetime, double price, bool nextDay = false, bool prepaid = false);
|
||||
|
||||
/// <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(Configuration* cfg, uint8_t vehicle_type, char const* start_datetime, double durationMin, bool nextDay = false, bool prepaid = false);
|
||||
};
|
||||
Reference in New Issue
Block a user