public async Task <List <Exposure> > GetCreditBureauExposureIndividual(List <Exposure> listExposure, RetrieveCreditBureauExposureCommand request, int partyId)
        {
            try
            {
                var _party = await _involvedPartyRepository.GetPartyGeneralInformation(request.ApplicationNumber, partyId, "employment-data,household-info,financial-profile,contact-points,credit-bureau,product-usage");

                var checkBalanceList       = _configurationService.GetEffective("offer/exposure/balance-arrangement-kinds", "term-loan").Result;
                var creditArrangementTypes = _configurationService.GetEffective("offer/exposure/credit-bureau-placement-kinds", "term-loan,term-loan-debtor,overdraft-facility,credit-facility,credit-card-facility").Result.Split(",");

                if (_party.PartyKind == PartyKind.Individual)
                {
                    var ind           = (IndividualParty)_party;
                    var listExposures = request.CreditBureauExposures.Where(p => p.PartyId.Equals(ind.PartyId.ToString())).ToList();

                    if (listExposure != null)
                    {
                        foreach (var exp in listExposures)
                        {
                            if (creditArrangementTypes.Contains(exp.Kind))
                            {
                                Exposure exposure = new Exposure
                                {
                                    AccountNumber = "",
                                    PartyId       = ind.CustomerNumber,
                                    Currency      = exp.Currency,
                                    ExposureApprovedInSourceCurrency = exp.ExposureInSourceCurrency ?? 0,
                                    CustomerName            = ind.CustomerName,
                                    ArrangementKind         = ArrangementKind.OtherProductArrangement,
                                    Term                    = "P0M",
                                    isBalance               = checkBalanceList.Contains(exp.Kind),
                                    AnnuityInSourceCurrency = exp.AnnuityInSourceCurrency ?? 0,
                                    RiskCategory            = exp.RiskCategory,
                                    ExposureOutstandingAmountInSourceCurrency = exp.ExposureDebtInSourceCurrency ?? 0
                                };

                                var kind = EnumUtils.ToEnum <ArrangementKind>(exp.Kind);
                                if (kind != null)
                                {
                                    exposure.ArrangementKind = kind.Value;
                                }

                                if (exp.EndDate != null && exp.StartDate != null)
                                {
                                    int months = ((exp.EndDate.Value.Year - exp.StartDate.Value.Year) * 12) + exp.EndDate.Value.Month - exp.StartDate.Value.Month;
                                    exposure.Term = "P" + months / 12 + "Y" + months % 12 + "M";
                                }
                                listExposure.Add(exposure);
                            }
                        }
                    }
                }
                return(listExposure);
            }
            catch (Exception ex)
            {
                _logger.LogError("Updating credit bureau exposure data for application {applicationNumber} has failed. Error: " + ex.Message, request.ApplicationNumber);
                return(null);
            }
        }
        public async Task <IActionResult> GetPartyGeneralInformation([FromRoute] long applicationNumber, [FromRoute] int partyId, [FromQuery] string include, [FromQuery] string trim)
        {
            var result = await _involvedPartyRepository.GetPartyGeneralInformation(applicationNumber, partyId, include, trim);

            if (result != null)
            {
                return(Ok(result));
            }
            else
            {
                return(NotFound());
            }
        }