adamsaghy commented on code in PR #6151:
URL: https://github.com/apache/fineract/pull/6151#discussion_r3620873532
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAllocationApplier.java:
##########
@@ -48,28 +53,42 @@ public class WorkingCapitalLoanAllocationApplier {
private final WorkingCapitalLoanChargePaymentHandler chargePaymentHandler;
- public WorkingCapitalLoanTransactionAllocation apply(final
WorkingCapitalLoanTransaction transaction,
- final WorkingCapitalLoanTransactionAllocation existingAllocation,
final WorkingCapitalLoanAllocationPlan plan,
- final List<WorkingCapitalLoanCharge> charges) {
+ /**
+ * The materialized outcome of applying a plan: the transaction allocation
and the per-charge paid-by rows produced
+ * while settling the plan's charge allocations. Both are for the
orchestrator to persist.
+ */
+ public record Result(WorkingCapitalLoanTransactionAllocation allocation,
List<WorkingCapitalLoanChargePaidBy> chargesPaidBy) {
+ }
+
+ public Result apply(final WorkingCapitalLoanTransaction transaction, final
WorkingCapitalLoanTransactionAllocation existingAllocation,
+ final WorkingCapitalLoanAllocationPlan plan, final
List<WorkingCapitalLoanCharge> charges) {
final Map<Long, WorkingCapitalLoanCharge> chargesById =
charges.stream()
.collect(Collectors.toMap(WorkingCapitalLoanCharge::getId,
Function.identity()));
return apply(transaction, existingAllocation, plan, chargesById);
}
- public WorkingCapitalLoanTransactionAllocation apply(final
WorkingCapitalLoanTransaction transaction,
- final WorkingCapitalLoanTransactionAllocation existingAllocation,
final WorkingCapitalLoanAllocationPlan plan,
- final Map<Long, WorkingCapitalLoanCharge> chargesById) {
+ public Result apply(final WorkingCapitalLoanTransaction transaction, final
WorkingCapitalLoanTransactionAllocation existingAllocation,
Review Comment:
Minor:
2nd parameter can be lifted.
Assumption:
`transaction.getAllocation()` should give the same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]