From 068e8ae2f9e352f59884c91307ec0d018114bcff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=BF=D0=BE=D0=B4=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BD?= Date: Tue, 25 Oct 2022 23:31:12 +0300 Subject: [PATCH] Committing updates. --- src/app/Deal.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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\".");