/**
 *  \brief     functions for writing getdp post
 *  \details   functions for writing getdp post
 *  \author    vadims
 *  \date      Jan 15, 2020
 *  \warning   Improper use can crash your application
 *  \copyright CENOS LLC
 */

#ifndef GETDPPOSTFNS_HPP_
#define GETDPPOSTFNS_HPP_
#include <optional>
#include "setup/postValues.hpp"
#include "easylogging++/easylogging++.h"

std::string getPostOperations(std::shared_ptr<PostValues> postValue, std::string entityName, int timeStep,  std::optional<PostValues::PostValueType> restrictedType = {});
std::string getPostProcessing(std::shared_ptr<PostValues> postValue);
json processGlobalValues(std::shared_ptr<PostValues> postValue, std::string domName, std::string wDir, std::string portNumber);
std::vector<std::pair<double, double>> processGlobalValuesV2(std::shared_ptr<PostValues> postValue, std::string domName, std::string wDir);
std::vector<std::pair<double, double>> processGlobalValuesV2Legacy(std::shared_ptr<PostValues> postValue, std::string domName, std::string wDir);
json mergeGroupedDomainsInJson(json inpJson);
void appendTimeToGlobalsJson(json inpJson, json& globalsJson);
std::string prepareCsvFromJson(json postJson);

#endif //GETDPPOSTFNS_HPP_
