public IActionResult SubmitDeal([FromBody] SubmitDealRequest submitDealRequest)
        {
            try
            {
                _logger.LogInformation($"SubmitDeal Call with submitDealRequest.RequestID {submitDealRequest.RequestID}");

                if (string.IsNullOrEmpty(submitDealRequest.RequestID))
                {
                    throw new Exception(message: "RequestID is missing.");
                }
                else if (submitDealRequest.AccountDetails == null)
                {
                    throw new Exception(message: "AccountDetails Object is missing.");
                }
                else if (submitDealRequest.Borrowers == null)
                {
                    throw new Exception(message: "Borrowers Object is missing.");
                }
                else if (submitDealRequest.LoanDetails == null)
                {
                    throw new Exception(message: "LoanDetails Object is missing.");
                }
                else if (submitDealRequest.SecurityPropertyDetails == null)
                {
                    throw new Exception(message: "SecurityPropertyDetails Object is missing.");
                }
                else if (submitDealRequest.PreauthorizedPaymentAccount == null)
                {
                    throw new Exception(message: "PreauthorizedPaymentAccount Object is missing.");
                }

                SubmitDealResponse SubmitDealResponse = _SubmitDealService.SubmitDeal(submitDealRequest);

                return(Ok(SubmitDealResponse));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, message: "Exception Occurred.");
                return(Result(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Exemple #2
0
        public IActionResult AskQuestion(SubmitDealRequest submitDealRequest)
        {
            SubmitDealResponse SubmitDealResponse = _SubmitDealService.SubmitDeal(submitDealRequest);

            return(Ok(SubmitDealResponse));
        }