FINERACT-2103: refactor the boilerplate code for ChargeData class and its affiliate code

This commit is contained in:
zeyad2003
2024-07-04 10:21:20 +02:00
committed by Adam Saghy
parent cfdfa6cd57
commit 0358921d02
6 changed files with 72 additions and 253 deletions
@@ -334,7 +334,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
final Long chargeId = (Long) chargeToIncomeAccountMap.get("chargeId");
final String chargeName = (String) chargeToIncomeAccountMap.get("chargeName");
final Boolean penalty1 = (Boolean) chargeToIncomeAccountMap.get("penalty");
final ChargeData chargeData = ChargeData.lookup(chargeId, chargeName, penalty1);
final ChargeData chargeData = ChargeData.builder().id(chargeId).name(chargeName).penalty(penalty1).build();
final ChargeToGLAccountMapper chargeToGLAccountMapper = new ChargeToGLAccountMapper().setCharge(chargeData)
.setIncomeAccount(gLAccountData);
chargeToGLAccountMappers.add(chargeToGLAccountMapper);