Skip to content

Commit

Permalink
Fixed Timestamp mapper in adapter (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
rushang7 authored May 11, 2022
1 parent 443451f commit 5d5eefa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ public List<FiscalEvent> transformData(JsonObject data) {

demandJsonArray.forEach(demandJsonElement -> {
JsonObject demandJsonObject = demandJsonElement.getAsJsonObject();
JsonObject demandAuditDetails = demandJsonObject.get(BILL_DEMAND_AUDIT_DETAILS).getAsJsonObject();

FiscalEvent fiscalEvent = FiscalEvent.builder().tenantId(applicationConfiguration.getTenantId())
.eventType(getEventType())
.eventTime(Instant.now().toEpochMilli())
.eventTime(demandAuditDetails.get(BILL_DEMAND_LAST_MODIFIED_TIME).getAsLong())
.referenceId(demandJsonObject.get(ID).getAsString())
.parentEventId(null)
.parentReferenceId(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ public List<FiscalEvent> transformData(JsonObject data) {

demandJA.forEach(demandJE -> {
JsonObject demandJO = demandJE.getAsJsonObject();
JsonObject demandAuditDetails = demandJO.get(BILL_DEMAND_AUDIT_DETAILS).getAsJsonObject();

FiscalEvent fiscalEvent = FiscalEvent.builder()
.tenantId(applicationConfiguration.getTenantId())
.eventType(getEventType())
.eventTime(Instant.now().toEpochMilli())
.eventTime(demandAuditDetails.get(BILL_DEMAND_LAST_MODIFIED_TIME).getAsLong())
.referenceId(demandJO.get(ID).getAsString())
.parentEventId(null)
.parentReferenceId(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public List<FiscalEvent> transformData(JsonObject data) {
FiscalEvent fiscalEvent = FiscalEvent.builder()
.tenantId(applicationConfiguration.getTenantId())
.eventType(getEventType())
.eventTime(Instant.now().toEpochMilli())
.eventTime(paymentJO.get(PAYMENT_RECEIPT_TRANSACTION_DATE).getAsLong())
.referenceId(paymentJO.get(ID).getAsString())
.parentEventId(null).parentReferenceId(null)
.amountDetails(getAmounts(paymentJO, data)).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public List<FiscalEvent> transformData(JsonObject data) {
FiscalEvent fiscalEvent = FiscalEvent.builder()
.tenantId(applicationConfiguration.getTenantId())
.eventType(getEventType())
.eventTime(Instant.now().toEpochMilli())
.eventTime(paymentJsonObject.get(PAYMENT_RECEIPT_TRANSACTION_DATE).getAsLong())
.referenceId(paymentJsonObject.get(ID).getAsString())
.parentEventId(null).parentReferenceId(null)
.amountDetails(getAmountDetails(paymentJsonObject, data)).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ public class EventConstants {
public static final String DEMAND_DETAILS = "demandDetails";
public static final String BILL_DEMAND_CLIENT_COA_AMOUNT = "taxAmount";
public static final String BILL_DEMAND_CLIENT_COA_CODE = "taxHeadMasterCode";
public static final String BILL_DEMAND_AUDIT_DETAILS = "auditDetails";
public static final String BILL_DEMAND_LAST_MODIFIED_TIME = "lastModifiedTime";
public static final String PROJECT_CODE_DATA_NAME = "PROJECT_CODE";
public static final String CODE = "code";
public static final String PROJECT_CODE = "PROJECT_CODE";
public static final String CLIENT_PROJECT_CODE = "CLIENT_PROJECT_CODE";

public static final String PAYMENT_RECEIPT_TRANSACTION_DATE = "transactionDate";
public static final String PAYMENT_RECEIPT_FROM_BILLING_PERIOD = "fromPeriod";
public static final String PAYMENT_RECEIPT_TO_BILLING_PERIOD = "toPeriod";
public static final String PAYMENT_RECEIPT_CLIENT_COA_AMOUNT = "adjustedAmount";
Expand Down

0 comments on commit 5d5eefa

Please sign in to comment.