Skip to content

Commit

Permalink
changed reporting to false (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
truthfool authored Apr 6, 2023
1 parent 6b5b73e commit 4f1f07e
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,6 @@ public void upsertToReportingIndex(JSONObject record) {
} else if (valueObj.getString("name").equalsIgnoreCase("originDate")) {
Instant timestamp = Instant.ofEpochMilli(valueObj.getLong("value"));
newRecord.put((String) valueObj.get("name"), timestamp);
} else if (valueObj.getString("name").equalsIgnoreCase("customData")) {
JSONArray customDataArray = valueObj.getJSONArray("customData");
for (int i = 0; i < customDataArray.length(); i++) {
JSONObject customData = customDataArray.getJSONObject(i);
newRecord.put(customData.getString("key").replaceAll("\"", ""),
customData.getString("value")
.replaceAll("\"", ""));
}
} else {
newRecord.put((String) valueObj.get("name"), valueObj.get("value").toString()
.replaceAll("\"", ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,27 @@ public class PaymentsIndexConfiguration {

@Value("${reporting.fields.transferResponseCREATE}")
private Boolean transferResponseCREATEVal;

@Value("${reporting.fields.currency}")
private Boolean currencyVal;

@Value("${reporting.fields.errorInformation}")
private Boolean errorInformationVal;
@Value("${reporting.fields.customData.enabled}")

@Value("${reporting.fields.customData}")
private Boolean customDataVal;
@Value("${reporting.fields.customData.enabled.reconciled}")
private Boolean reconciledVal;
@Value("${reporting.fields.customData.enabled.confirmationReceived}")

@Value("${reporting.fields.confirmationReceived}")
private Boolean confirmationReceivedVal;

public PaymentsIndexConfiguration(){}
@Value("${reporting.fields.clientCorrelationId}")
private Boolean clientCorrelationIdVal;

@Value("${reporting.fields.ams}")
private Boolean amsVal;

public PaymentsIndexConfiguration() {
}

public List<String> getVariables() {
Boolean amount = amountVal;
Expand Down Expand Up @@ -128,100 +137,104 @@ public List<String> getVariables() {
Boolean currency = currencyVal;
Boolean errorInformation = errorInformationVal;
Boolean customData = customDataVal;
Boolean reconciled = reconciledVal;
Boolean confirmationReceived = confirmationReceivedVal;

if (amount) {
variables.add("amount");
}
if (accountId) {
variables.add("accountId");
}
if (errorCode) {
variables.add("errorCode");
}
if (errorDescription) {
variables.add("errorDescription");
}
if (externalId) {
variables.add("externalId");
}
if (initiator) {
variables.add("initiator");
}
if (initiatorType) {
variables.add("initiatorType");
}
if (isNotificationsFailureEnabled) {
variables.add("isNotificationsFailureEnabled");
}
if (isNotificationsSuccessEnabled) {
variables.add("isNotificationsSuccessEnabled");
}
if (mpesaTransactionId) {
variables.add("mpesaTransactionId");
}
if (mpesaTransactionStatusRetryCount) {
variables.add("mpesaTransactionStatusRetryCount");
}
if (originDate) {
variables.add("originDate");
}
if (partyLookupFailed) {
variables.add("partyLookupFailed");
}
if (phoneNumber) {
variables.add("phoneNumber");
}
if (processDefinitionKey) {
variables.add("processDefinitionKey");
}
if (processInstanceKey) {
variables.add("processInstanceKey");
}
if (scenario) {
variables.add("scenario");
}
if (tenantId) {
variables.add("tenantId");
}
if (timer) {
variables.add("timer");
}
if (timestamp) {
variables.add("timestamp");
}
if (transactionFailed) {
variables.add("transactionFailed");
}
if (transactionId) {
variables.add("transactionId");
}
if (transferCreateFailed) {
variables.add("transferCreateFailed");
}
if (transferSettlementFailed) {
variables.add("transferSettlementFailed");
}
if (transferResponseCREATE) {
variables.add("transferResponse-CREATE");
}
if(currency){
variables.add("currency");
}
if(errorInformation){
variables.add("errorInformation");
}
if(customData){
if(reconciled){
variables.add("reconciled");
}
if(confirmationReceived){
variables.add("confirmationReceived");
}
}
Boolean clientCorrelationId = clientCorrelationIdVal;
Boolean ams = amsVal;

if (amount) {
variables.add("amount");
}
if (accountId) {
variables.add("accountId");
}
if (errorCode) {
variables.add("errorCode");
}
if (errorDescription) {
variables.add("errorDescription");
}
if (externalId) {
variables.add("externalId");
}
if (initiator) {
variables.add("initiator");
}
if (initiatorType) {
variables.add("initiatorType");
}
if (isNotificationsFailureEnabled) {
variables.add("isNotificationsFailureEnabled");
}
if (isNotificationsSuccessEnabled) {
variables.add("isNotificationsSuccessEnabled");
}
if (mpesaTransactionId) {
variables.add("mpesaTransactionId");
}
if (mpesaTransactionStatusRetryCount) {
variables.add("mpesaTransactionStatusRetryCount");
}
if (originDate) {
variables.add("originDate");
}
if (partyLookupFailed) {
variables.add("partyLookupFailed");
}
if (phoneNumber) {
variables.add("phoneNumber");
}
if (processDefinitionKey) {
variables.add("processDefinitionKey");
}
if (processInstanceKey) {
variables.add("processInstanceKey");
}
if (scenario) {
variables.add("scenario");
}
if (tenantId) {
variables.add("tenantId");
}
if (timer) {
variables.add("timer");
}
if (timestamp) {
variables.add("timestamp");
}
if (transactionFailed) {
variables.add("transactionFailed");
}
if (transactionId) {
variables.add("transactionId");
}
if (transferCreateFailed) {
variables.add("transferCreateFailed");
}
if (transferSettlementFailed) {
variables.add("transferSettlementFailed");
}
if (transferResponseCREATE) {
variables.add("transferResponse-CREATE");
}
if (currency) {
variables.add("currency");
}
if (errorInformation) {
variables.add("errorInformation");
}
if (customData) {
variables.add("customData");
}
if (confirmationReceived) {
variables.add("confirmationReceived");
}
if (clientCorrelationId) {
variables.add("clientCorrelationId");
}
if (ams) {
variables.add("ams");
}
return variables;
}

}

}
10 changes: 2 additions & 8 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ importer:
bulk-size: 20
index-prefix: "zeebe-record"


elasticsearch:
security:
enabled: false
Expand All @@ -23,7 +22,6 @@ logging:
pattern:
console: "%clr(%d{dd-MM-yyyy HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr([%35.35t]){faint} %clr(%-28.28logger{28}){cyan} %clr(:){faint}%X{BUSINESS-LOG} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"


reporting:
enabled: true
fields:
Expand All @@ -32,9 +30,8 @@ reporting:
ams: true
clientCorrelationId: true
currency: true
customData:
enabled: true
confirmationReceived: true
customData: false
confirmationReceived: false
errorCode: false
errorDescription: true
errorInformation: true
Expand All @@ -59,6 +56,3 @@ reporting:
transferCreateFailed: false
transferSettlementFailed: false
transferResponseCREATE: false



0 comments on commit 4f1f07e

Please sign in to comment.