Beispiel #1
0
        public async Task <ActionResult <LoanRespObj> > AddLoanBooking([FromBody] LoanObj model)
        {
            try
            {
                var identity = await _serverRequest.UserDataAsync();

                var user = identity.UserName;

                model.CreatedBy = user;
                model.UpdatedBy = user;
                model.CompanyId = identity.CompanyId;

                var response = await _repo.AddLoanBooking(model);

                return(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
                        }
                    }
                });
            }
        }