diff --git a/src/main/java/org/mifos/connector/ams/zeebe/ZeebeUtil.java b/src/main/java/org/mifos/connector/ams/zeebe/ZeebeUtil.java index f548022c..262f9d14 100644 --- a/src/main/java/org/mifos/connector/ams/zeebe/ZeebeUtil.java +++ b/src/main/java/org/mifos/connector/ams/zeebe/ZeebeUtil.java @@ -68,8 +68,10 @@ public static T zeebeVariable(Exchange exchange, String name, Class clazz } public static String getCurrentDate(String requestedDate,String dateFormat) { - LocalDateTime datetime = LocalDateTime.parse(requestedDate, DateTimeFormatter.ofPattern(dateFormat)); - return datetime.format(DateTimeFormatter.ofPattern(dateFormat)); + String dateFormatGiven="yyyy-MM-dd'T'HH:mm:ss.SSSXXX"; + LocalDateTime datetime = LocalDateTime.parse(requestedDate, DateTimeFormatter.ofPattern(dateFormatGiven)); + String newDate= datetime.format(DateTimeFormatter.ofPattern(dateFormat)); + return newDate; } public static LoanRepaymentDTO setLoanRepaymentBody(Exchange exchange) { @@ -78,19 +80,21 @@ public static LoanRepaymentDTO setLoanRepaymentBody(Exchange exchange) { loanRepaymentDTO.setDateFormat(dateFormat); loanRepaymentDTO.setLocale("en"); loanRepaymentDTO.setTransactionAmount(exchange.getProperty("amount").toString()); - String currDate = getCurrentDate(exchange.getProperty("requestedDate").toString(),dateFormat); - loanRepaymentDTO.setTransactionDate(currDate); + loanRepaymentDTO.setTransactionDate(exchange.getProperty("requestedDate").toString()); return loanRepaymentDTO; } public static void setZeebeVariables(Exchange e, Map variables, String requestDate, String accountHoldingInstitutionId, String transactionChannelRequestDTO) { + String dateFormat = "dd MMMM yyyy"; + String currentDate=getCurrentDate(requestDate,dateFormat); + variables.put(ACCOUNT_IDENTIFIER,e.getProperty(ACCOUNT_IDENTIFIER)); variables.put(ACCOUNT_NUMBER,e.getProperty(ACCOUNT_NUMBER)); variables.put(TRANSACTION_ID, UUID.randomUUID().toString()); variables.put(TENANT_ID,accountHoldingInstitutionId); variables.put(TRANSFER_ACTION,CREATE.name()); variables.put(CHANNEL_REQUEST,transactionChannelRequestDTO); - variables.put(REQUESTED_DATE,requestDate); + variables.put(REQUESTED_DATE,currentDate); variables.put(EXTERNAL_ACCOUNT_ID,e.getProperty(ACCOUNT_NUMBER)); variables.put("payeeTenantId", accountHoldingInstitutionId); } diff --git a/src/main/resources/application-fin12.yml b/src/main/resources/application-fin12.yml index d338315a..519dc839 100644 --- a/src/main/resources/application-fin12.yml +++ b/src/main/resources/application-fin12.yml @@ -37,7 +37,7 @@ ams: auth: host: https://localhost:8443 loan: - host: https://localhost:8443 + host: http://localhost:8443 repayment-path: /fineract-provider/api/v1/interoperation/transactions/{accountNumber}/loanrepayment