galovics commented on code in PR #2822:
URL: https://github.com/apache/fineract/pull/2822#discussion_r1050827634
##########
fineract-avro-schemas/src/main/avro/loan/v1/LoanAccountDelinquencyRangeDataV1.avsc:
##########
@@ -5,23 +5,23 @@
"fields": [
{
"default": null,
- "name": "id",
+ "name": "loanId",
Review Comment:
Let's make this non-nullable.
##########
fineract-avro-schemas/src/main/avro/loan/v1/LoanAccountDelinquencyRangeDataV1.avsc:
##########
@@ -5,23 +5,23 @@
"fields": [
{
"default": null,
- "name": "id",
+ "name": "loanId",
"type": [
"null",
"long"
]
},
{
"default": null,
- "name": "accountNo",
+ "name": "loanAccountNo",
Review Comment:
Let's make this non-nullable.
##########
fineract-avro-schemas/src/main/avro/loan/v1/LoanChargeDataRangeViewV1.avsc:
##########
@@ -0,0 +1,39 @@
+{
+ "name": "LoanChargeDataRangeViewV1",
+ "namespace": "org.apache.fineract.avro.loan.v1",
+ "type": "record",
+ "fields": [
+ {
+ "default": null,
+ "name": "id",
+ "type": [
Review Comment:
Let's make this non-nullable.
##########
fineract-avro-schemas/src/main/avro/loan/v1/LoanAccountDelinquencyRangeDataV1.avsc:
##########
@@ -34,6 +34,33 @@
"null",
"org.apache.fineract.avro.loan.v1.DelinquencyRangeDataV1"
]
+ },
+ {
+ "default": null,
+ "name": "charges",
+ "type": [
+ "null",
+ {
+ "type": "array",
+ "items":
"org.apache.fineract.avro.loan.v1.LoanChargeDataRangeViewV1"
+ }
+ ]
+ },
+ {
+ "default": null,
Review Comment:
Let's make this non-nullable.
##########
fineract-avro-schemas/src/main/avro/loan/v1/LoanChargeDataRangeViewV1.avsc:
##########
@@ -0,0 +1,39 @@
+{
+ "name": "LoanChargeDataRangeViewV1",
+ "namespace": "org.apache.fineract.avro.loan.v1",
+ "type": "record",
+ "fields": [
+ {
+ "default": null,
+ "name": "id",
+ "type": [
+ "null",
+ "long"
+ ]
+ },
+ {
+ "default": null,
+ "name": "name",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ {
+ "default": null,
+ "name": "currency",
Review Comment:
Let's make this non-nullable.
##########
fineract-avro-schemas/src/main/avro/loan/v1/LoanAccountDelinquencyRangeDataV1.avsc:
##########
@@ -34,6 +34,33 @@
"null",
"org.apache.fineract.avro.loan.v1.DelinquencyRangeDataV1"
]
+ },
+ {
+ "default": null,
+ "name": "charges",
+ "type": [
+ "null",
+ {
+ "type": "array",
+ "items":
"org.apache.fineract.avro.loan.v1.LoanChargeDataRangeViewV1"
+ }
+ ]
+ },
+ {
+ "default": null,
+ "name": "currency",
+ "type": [
+ "null",
+ "org.apache.fineract.avro.generic.v1.CurrencyDataV1"
+ ]
+ },
+ {
+ "default": null,
+ "name": "amount",
Review Comment:
Can we add some description to this to make it more self-explanatory?
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/event/external/service/serialization/serializer/loan/LoanDelinquencyRangeChangeBusinessEventSerializer.java:
##########
@@ -39,17 +51,60 @@
public class LoanDelinquencyRangeChangeBusinessEventSerializer extends
AbstractBusinessEventSerializer {
private final LoanReadPlatformService service;
+
+ private final CurrencyReadPlatformService currencyService;
private final LoanDelinquencyRangeDataMapper mapper;
+ private final LoanChargeDataMapper chargeMapper;
+
+ private final CurrencyDataMapper currencyMapper;
+
@Override
protected <T> ByteBufferSerializable toAvroDTO(BusinessEvent<T> rawEvent) {
Review Comment:
Since this got more complicated than before, let's have some unit tests for
it.
--
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]