You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "galovics (via GitHub)" <gi...@apache.org> on 2023/06/13 06:49:05 UTC

[GitHub] [fineract] galovics commented on a diff in pull request #3250: Fineract 1926 asset externalization new events

galovics commented on code in PR #3250:
URL: https://github.com/apache/fineract/pull/3250#discussion_r1227608111


##########
fineract-investor/src/main/java/org/apache/fineract/investor/cob/loan/LoanAccountOwnerTransferBusinessStep.java:
##########
@@ -89,7 +93,8 @@ public Loan execute(Loan loan) {
 
     private void handleSale(final Loan loan, final LocalDate settlementDate, final ExternalAssetOwnerTransfer externalAssetOwnerTransfer) {
         ExternalAssetOwnerTransfer newExternalAssetOwnerTransfer = sellAsset(loan, settlementDate, externalAssetOwnerTransfer);
-        // TODO: trigger asset loan transfer executed event
+        businessEventNotifierService.notifyPreBusinessEvent(new LoanOwnershipTransferBusinessEvent(newExternalAssetOwnerTransfer, loan));

Review Comment:
   Should be a "post" event instead of a "pre", otherwise an external event won't be raised.



##########
fineract-investor/src/main/java/org/apache/fineract/investor/cob/loan/LoanAccountOwnerTransferBusinessStep.java:
##########
@@ -102,7 +107,8 @@ private void handleBuyback(final Loan loan, final LocalDate settlementDate,
                 .orElseThrow();
         ExternalAssetOwnerTransfer newExternalAssetOwnerTransfer = buybackAsset(loan, settlementDate, buybackExternalAssetOwnerTransfer,
                 activeExternalAssetOwnerTransfer);
-        // TODO: trigger asset loan transfer executed event
+        businessEventNotifierService.notifyPreBusinessEvent(new LoanOwnershipTransferBusinessEvent(newExternalAssetOwnerTransfer, loan));

Review Comment:
   Same as above.



##########
fineract-provider/src/test/java/org/apache/fineract/infrastructure/event/external/service/serialization/serializer/loan/LoanRepaymentBusinessEventSerializerTest.java:
##########
@@ -86,6 +90,7 @@ public void setUp() {
         ThreadLocalContextUtil.setActionContext(ActionContext.DEFAULT);
         ThreadLocalContextUtil
                 .setBusinessDates(new HashMap<>(Map.of(BusinessDateType.BUSINESS_DATE, LocalDate.now(ZoneId.systemDefault()))));
+        // when(dataEnricherProcessor.enrich(any())).thenAnswer(a -> a.getArguments()[0]);

Review Comment:
   Comment.



##########
fineract-investor/src/main/java/org/apache/fineract/investor/cob/loan/LoanAccountOwnerTransferBusinessStep.java:
##########
@@ -166,10 +172,13 @@ private boolean isTransferable(final Loan loan) {
         return loan.getLoanSummary().getTotalOutstanding().compareTo(BigDecimal.ZERO) > 0;
     }
 
-    private void handleSameDaySaleAndBuyback(final LocalDate settlementDate, final List<ExternalAssetOwnerTransfer> transferDataList) {
+    private void handleSameDaySaleAndBuyback(final LocalDate settlementDate, final List<ExternalAssetOwnerTransfer> transferDataList,
+            Loan loan) {
         ExternalAssetOwnerTransfer cancelledPendingTransfer = cancelTransfer(settlementDate, transferDataList.get(0));
         ExternalAssetOwnerTransfer cancelledBuybackTransfer = cancelTransfer(settlementDate, transferDataList.get(1));
-        // TODO: trigger asset loan transfer cancel events
+        businessEventNotifierService.notifyPreBusinessEvent(new LoanOwnershipTransferBusinessEvent(cancelledPendingTransfer, loan));

Review Comment:
   Same as above.



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org