Skip to content
Permalink
Browse files
ease handling for cost components for loans
  • Loading branch information
mgeiss committed Oct 3, 2017
1 parent 8cb0b0e commit ef2e776236914af147d94c5b622ef43d72f8fd17
Showing 1 changed file with 6 additions and 5 deletions.
@@ -70,17 +70,18 @@ public List<Charge> getCharges(final String productIdentifier, final String case
costComponents.forEach(costComponent -> {
if (costComponent.getAmount() != null
&& costComponent.getAmount().compareTo(BigDecimal.ZERO) > 0) {
final Charge charge = new Charge();
charge.setCode(costComponent.getChargeIdentifier());
charge.setAmount(costComponent.getAmount());
try {
final ChargeDefinition chargeDefinition =
this.portfolioManager.getChargeDefinition(productIdentifier, costComponent.getChargeIdentifier());
final Charge charge = new Charge();
charge.setCode(chargeDefinition.getIdentifier());
charge.setName(chargeDefinition.getName());
charge.setAmount(costComponent.getAmount());
charges.add(charge);
charge.setName(chargeDefinition.getName());
} catch (final NotFoundException nfex) {
this.logger.warn("Charge {} not found.", costComponent.getChargeIdentifier());
charge.setName(costComponent.getChargeIdentifier());
}
charges.add(charge);
}
});
} catch (final NotFoundException | BadRequestException ex) {

0 comments on commit ef2e776

Please sign in to comment.