public async Task <ActionResult <LoanRespObj> > GetRunningLoans([FromQuery] LoanSearchObj model)
 {
     try
     {
         var response = _repo.GetRunningLoans(1, model.LoanRefNumber);
         var respList = new List <LoanObj> {
             response
         };
         return(new LoanRespObj
         {
             Loans = respList,
         });
     }
     catch (Exception ex)
     {
         var errorCode = ErrorID.Generate(5);
         _logger.Error($"ErrorID : {errorCode} Ex : {ex?.Message ?? ex?.InnerException?.Message} ErrorStack : {ex?.StackTrace}");
         return(new LoanRespObj
         {
             Status = new APIResponseStatus {
                 IsSuccessful = false, Message = new APIResponseMessage {
                     FriendlyMessage = "Error Occurred", TechnicalMessage = ex?.Message, MessageId = errorCode
                 }
             }
         });
     }
 }
Esempio n. 2
0
        public async Task <ActionResult <LoanRespObj> > GetLoanDetailInformation([FromQuery] LoanSearchObj model)
        {
            try
            {
                var response = await _repo.GetLoanDetailInformation(model.LoanId);

                return(new LoanRespObj
                {
                    LoanDetail = response,
                });
            }
            catch (Exception ex)
            {
                var errorCode = ErrorID.Generate(5);
                _logger.Error($"ErrorID : {errorCode} Ex : {ex?.Message ?? ex?.InnerException?.Message} ErrorStack : {ex?.StackTrace}");
                return(new LoanRespObj
                {
                    Status = new APIResponseStatus {
                        IsSuccessful = false, Message = new APIResponseMessage {
                            FriendlyMessage = "Error Occurred", TechnicalMessage = ex?.Message, MessageId = errorCode
                        }
                    }
                });
            }
        }