FINERACT-2081: Update Loan data avro schemas with new delinquent fields
This commit is contained in:
committed by
Adam Saghy
parent
eb06b40190
commit
b3b14ba929
@@ -104,6 +104,38 @@
|
|||||||
"items": "org.apache.fineract.avro.loan.v1.LoanInstallmentDelinquencyBucketDataV1"
|
"items": "org.apache.fineract.avro.loan.v1.LoanInstallmentDelinquencyBucketDataV1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": null,
|
||||||
|
"name": "delinquentPrincipal",
|
||||||
|
"type": [
|
||||||
|
"null",
|
||||||
|
"bigdecimal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": null,
|
||||||
|
"name": "delinquentInterest",
|
||||||
|
"type": [
|
||||||
|
"null",
|
||||||
|
"bigdecimal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": null,
|
||||||
|
"name": "delinquentFee",
|
||||||
|
"type": [
|
||||||
|
"null",
|
||||||
|
"bigdecimal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": null,
|
||||||
|
"name": "delinquentPenalty",
|
||||||
|
"type": [
|
||||||
|
"null",
|
||||||
|
"bigdecimal"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -426,6 +426,22 @@
|
|||||||
"null",
|
"null",
|
||||||
"string"
|
"string"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": null,
|
||||||
|
"name": "totalUnpaidAccruedDueInterest",
|
||||||
|
"type": [
|
||||||
|
"null",
|
||||||
|
"bigdecimal"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": null,
|
||||||
|
"name": "totalUnpaidAccruedNotDueInterest",
|
||||||
|
"type": [
|
||||||
|
"null",
|
||||||
|
"bigdecimal"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+14
@@ -47,6 +47,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||||||
public class CustomSnapshotEventIntegrationTest extends BaseLoanIntegrationTest {
|
public class CustomSnapshotEventIntegrationTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
private SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||||
|
private Gson gson = new Gson();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSnapshotEventGenerationWhenLoanInstallmentIsNotPayed() {
|
public void testSnapshotEventGenerationWhenLoanInstallmentIsNotPayed() {
|
||||||
@@ -92,6 +93,19 @@ public class CustomSnapshotEventIntegrationTest extends BaseLoanIntegrationTest
|
|||||||
Assertions.assertEquals(1, allExternalEvents.size());
|
Assertions.assertEquals(1, allExternalEvents.size());
|
||||||
Assertions.assertEquals("LoanAccountCustomSnapshotBusinessEvent", allExternalEvents.get(0).getType());
|
Assertions.assertEquals("LoanAccountCustomSnapshotBusinessEvent", allExternalEvents.get(0).getType());
|
||||||
Assertions.assertEquals(loanId, allExternalEvents.get(0).getAggregateRootId());
|
Assertions.assertEquals(loanId, allExternalEvents.get(0).getAggregateRootId());
|
||||||
|
|
||||||
|
// Loan Delinquency data validation
|
||||||
|
final Map<String, Object> payLoad = (Map<String, Object>) allExternalEvents.get(0).getPayLoad().get("delinquent");
|
||||||
|
log.info("Payload: {}", payLoad.toString());
|
||||||
|
|
||||||
|
Assertions.assertNotNull(payLoad.get("delinquentPrincipal"));
|
||||||
|
Assertions.assertEquals(312.0, payLoad.get("delinquentPrincipal"));
|
||||||
|
Assertions.assertNotNull(payLoad.get("delinquentInterest"));
|
||||||
|
Assertions.assertEquals(0.0, payLoad.get("delinquentInterest"));
|
||||||
|
Assertions.assertNotNull(payLoad.get("delinquentFee"));
|
||||||
|
Assertions.assertEquals(0.0, payLoad.get("delinquentFee"));
|
||||||
|
Assertions.assertNotNull(payLoad.get("delinquentPenalty"));
|
||||||
|
Assertions.assertEquals(0.0, payLoad.get("delinquentPenalty"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user