X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/7766e753fefb962209f1898a234053f8c7bbe59d..f7795445d9e0dd2282b336c89ebe117a2b71a88e:/projects/sgconf/tariffs.cpp diff --git a/projects/sgconf/tariffs.cpp b/projects/sgconf/tariffs.cpp index 4d4feb9a..3da1001a 100644 --- a/projects/sgconf/tariffs.cpp +++ b/projects/sgconf/tariffs.cpp @@ -91,6 +91,21 @@ for (size_t i = 0; i < info.dirPrice.size(); ++i) PrintDirPriceData(i, info.dirPrice[i], level + 1); } +std::vector GetTariffParams() +{ +std::vector params; +params.push_back(SGCONF::API_ACTION::PARAM("fee", "", "\t\ttariff fee")); +params.push_back(SGCONF::API_ACTION::PARAM("free", "", "\tprepaid traff")); +params.push_back(SGCONF::API_ACTION::PARAM("passive-cost", "", "\tpassive cost")); +params.push_back(SGCONF::API_ACTION::PARAM("traff-type", "", "\ttraff type (up, dow, up+down, max)")); +params.push_back(SGCONF::API_ACTION::PARAM("period", "", "\ttarification period (daily, monthly)")); +params.push_back(SGCONF::API_ACTION::PARAM("times", "", "coma-separated day time-spans for each direction")); +params.push_back(SGCONF::API_ACTION::PARAM("day-prices", "", "coma-separated day prices for each direction")); +params.push_back(SGCONF::API_ACTION::PARAM("night-prices", "", "coma-separated day prices for each direction")); +params.push_back(SGCONF::API_ACTION::PARAM("thresholds", "", "coma-separated thresholds for each direction")); +return params; +} + void SimpleCallback(bool result, const std::string & reason, void * /*data*/) @@ -193,10 +208,11 @@ return false; void SGCONF::AppendTariffsOptionBlock(COMMANDS & commands, OPTION_BLOCKS & blocks) { +std::vector params(GetTariffParams()); blocks.Add("Tariff management options") .Add("get-tariffs", SGCONF::MakeAPIAction(commands, GetTariffsFunction), "\tget tariff list") - .Add("get-tariff", SGCONF::MakeAPIAction(commands, "", true, GetTariffFunction), "get tariff") - .Add("add-tariff", SGCONF::MakeAPIAction(commands, "", true, AddTariffFunction), "add tariff") - .Add("del-tariff", SGCONF::MakeAPIAction(commands, "", true, DelTariffFunction), "del tariff") - .Add("chg-tariff", SGCONF::MakeAPIAction(commands, "", true, ChgTariffFunction), "change tariff"); + .Add("get-tariff", SGCONF::MakeAPIAction(commands, "", GetTariffFunction), "get tariff") + .Add("add-tariff", SGCONF::MakeAPIAction(commands, "", params, AddTariffFunction), "add tariff") + .Add("del-tariff", SGCONF::MakeAPIAction(commands, "", DelTariffFunction), "del tariff") + .Add("chg-tariff", SGCONF::MakeAPIAction(commands, "", params, ChgTariffFunction), "change tariff"); }