diff --git a/src/app/Deal.cpp b/src/app/Deal.cpp index 57a27dd..c826b95 100644 --- a/src/app/Deal.cpp +++ b/src/app/Deal.cpp @@ -554,8 +554,6 @@ namespace Apostol { throw ExceptionFrm("Invalid until date format: %s.", until.c_str()); m_Data.Payment.Until = DateToString(Until); - } else { - m_Data.Payment.Until = DateToString(Date + 1); // 1 day } const auto &sum = payment["sum"].as(); @@ -576,8 +574,6 @@ namespace Apostol { throw ExceptionFrm("Invalid leave before date format: %s.", leave_before.c_str()); m_Data.FeedBack.LeaveBefore = DateToString(LeaveBefore); - } else { - m_Data.FeedBack.LeaveBefore = DateToString(Date + 14); // 14 day } if (feedback["status"]) @@ -600,6 +596,12 @@ namespace Apostol { m_Data.Error.Message = error["message"].as(); } + if (m_Data.Payment.Until.IsEmpty()) + m_Data.Payment.Until = DateToString(Date + 1); // 1 day + + if (m_Data.FeedBack.LeaveBefore.IsEmpty()) + m_Data.FeedBack.LeaveBefore = DateToString(Date + 14); // 14 day + m_Data.Code = GetCode(); } else throw ExceptionFrm("Invalid YAML format: Need node \"deal\".");