2023-04-24 15:31:46 +02:00
|
|
|
#pragma once
|
|
|
|
#include <map>
|
|
|
|
#include <variant>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <rapidjson/rapidjson.h>
|
|
|
|
#include <rapidjson/document.h>
|
|
|
|
#include <rapidjson/error/en.h>
|
|
|
|
#include "member_type.h"
|
|
|
|
#include "currency.h"
|
|
|
|
#include "duration.h"
|
|
|
|
#include "payment_mtd.h"
|
|
|
|
#include "payment_opt.h"
|
|
|
|
#include "spec_days.h"
|
|
|
|
#include "payment_opt.h"
|
|
|
|
#include "weekdays.h"
|
|
|
|
#include "weekdays_worktime.h"
|
|
|
|
#include "spec_days_worktime.h"
|
|
|
|
#include "member_type.h"
|
|
|
|
#include "period_year.h"
|
|
|
|
#include "payment_rate.h"
|
2023-10-11 15:42:31 +02:00
|
|
|
#include "atb_project.h"
|
2023-04-24 15:31:46 +02:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace rapidjson;
|
|
|
|
|
|
|
|
class Configuration
|
|
|
|
{
|
|
|
|
public:
|
2023-10-11 15:42:31 +02:00
|
|
|
ATBProject project;
|
|
|
|
ATBCurrency Currency;
|
2023-04-24 15:31:46 +02:00
|
|
|
ATBDuration duration;
|
|
|
|
|
|
|
|
multimap<int, ATBDuration> Duration;
|
|
|
|
multimap<int, ATBPaymentMethod> PaymentMethod;
|
|
|
|
multimap<int, ATBPaymentRate> PaymentRate;
|
|
|
|
multimap<int, ATBSpecialDaysWorktime> SpecialDaysWorktime;
|
|
|
|
multimap<int, ATBSpecialDays> SpecialDays;
|
|
|
|
multimap<int, ATBWeekDays> WeekDays;
|
|
|
|
multimap<int, ATBPeriodYear> YearPeriod;
|
|
|
|
multimap<int, ATBWeekDaysWorktime> WeekDaysWorktime;
|
|
|
|
multimap<int, ATBPaymentOption> PaymentOption;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Parse JSON string
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="json"></param>
|
|
|
|
/// <returns>Returns operation status bool (OK | FAIL) </returns>
|
|
|
|
bool ParseJson(Configuration* cfg, const char* json);
|
|
|
|
|
|
|
|
private:
|
|
|
|
/// <summary>
|
|
|
|
/// Identify type of JSON member
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="member_name"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
MemberType IdentifyJsonMember(const char* member_name);
|
2023-05-15 14:05:55 +02:00
|
|
|
};
|