Close #17
This commit is contained in:
@@ -293,7 +293,7 @@ int Deals::Status()
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int Deals::Complite()
|
||||
int Deals::Complete()
|
||||
{
|
||||
|
||||
string data = CommonStatus();
|
||||
@@ -305,10 +305,14 @@ int Deals::Complite()
|
||||
|
||||
string positive = "Positive";
|
||||
int refund = 0;
|
||||
/*
|
||||
|
||||
if (parser.cmdOptionExists("-n") || parser.cmdOptionExists("--negative"))
|
||||
{
|
||||
positive = "Negative";
|
||||
}
|
||||
|
||||
*/
|
||||
if (parser.cmdOptionExists("--refund"))
|
||||
{
|
||||
refund = stoi(parser.getCmdOption("--refund"));
|
||||
@@ -317,6 +321,10 @@ int Deals::Complite()
|
||||
{
|
||||
refund = stoi(parser.getCmdOption("-r"));
|
||||
}
|
||||
if (refund > 0)
|
||||
{
|
||||
positive = "Negative";
|
||||
}
|
||||
|
||||
deal["feedback"]["status"] = positive;
|
||||
if (refund > 0)
|
||||
|
||||
@@ -3,35 +3,36 @@
|
||||
#include <string>
|
||||
#include "InputParser.hpp"
|
||||
|
||||
class Deals {
|
||||
class Deals
|
||||
{
|
||||
public:
|
||||
/// @brief Конструктор
|
||||
/// @param parser - парсер аргументов
|
||||
/// @param isRussian - вывод справки на русском
|
||||
Deals(const InputParser& parser, const bool isRussian, const std::string address, bool isDebug);
|
||||
Deals(const InputParser &parser, const bool isRussian, const std::string address, bool isDebug);
|
||||
int Process();
|
||||
|
||||
private:
|
||||
InputParser parser;
|
||||
bool isRussian;
|
||||
std::string address;
|
||||
bool isDebug;
|
||||
|
||||
/// @brief Получение справки о параметрах команды
|
||||
/// @brief Получение справки о параметрах команды
|
||||
int HelpCreate() const;
|
||||
int HelpDealStatus() const;
|
||||
int HelpDealComplete() const;
|
||||
int HelpDealCancel() const;
|
||||
int HelpDealNegative() const;
|
||||
int Update();
|
||||
int Create();
|
||||
int Create();
|
||||
int Status();
|
||||
std::string CommonStatus();
|
||||
int Complite();
|
||||
int Complete();
|
||||
int Cancel();
|
||||
int Negative();
|
||||
|
||||
std::string GetVal(const std::string first,const std::string second);
|
||||
std::string GetVal(const std::string first, const std::string second);
|
||||
std::string GetDate(const std::string date);
|
||||
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user