You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2021/01/10 13:28:32 UTC

[fineract] branch develop updated: Add an interop release transfer command handler (FINERACT-1281)

This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 30d04ce  Add an interop release transfer command handler (FINERACT-1281)
30d04ce is described below

commit 30d04ce34e92c2ae6643a527215086841133de69
Author: Cedric Khin <c....@opensense.fr>
AuthorDate: Mon Dec 14 17:20:58 2020 +0100

    Add an interop release transfer command handler (FINERACT-1281)
---
 .../handler/ReleaseInteropTransferHandler.java     | 49 ++++++++++++++++++++++
 .../fineract/interoperation/util/InteropUtil.java  |  1 +
 2 files changed, 50 insertions(+)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/handler/ReleaseInteropTransferHandler.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/handler/ReleaseInteropTransferHandler.java
new file mode 100644
index 0000000..4c1dad3
--- /dev/null
+++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/handler/ReleaseInteropTransferHandler.java
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.interoperation.handler;
+
+import static org.apache.fineract.interoperation.util.InteropUtil.ACTION_TRANSFER_RELEASE;
+import static org.apache.fineract.interoperation.util.InteropUtil.ENTITY_NAME_TRANSFER;
+
+import org.apache.fineract.commands.annotation.CommandType;
+import org.apache.fineract.commands.handler.NewCommandSourceHandler;
+import org.apache.fineract.infrastructure.core.api.JsonCommand;
+import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
+import org.apache.fineract.interoperation.service.InteropService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@CommandType(entity = ENTITY_NAME_TRANSFER, action = ACTION_TRANSFER_RELEASE)
+public class ReleaseInteropTransferHandler implements NewCommandSourceHandler {
+
+    private final InteropService interopService;
+
+    @Autowired
+    public ReleaseInteropTransferHandler(InteropService interopService) {
+        this.interopService = interopService;
+    }
+
+    @Transactional
+    @Override
+    public CommandProcessingResult processCommand(final JsonCommand command) {
+        return this.interopService.releaseTransfer(command);
+    }
+}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/util/InteropUtil.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/util/InteropUtil.java
index 9888f28..d93c24e 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/util/InteropUtil.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/util/InteropUtil.java
@@ -41,6 +41,7 @@ public final class InteropUtil {
 
     public static final String ACTION_TRANSFER_PREPARE = "PREPARE";
     public static final String ACTION_TRANSFER_COMMIT = "CREATE";
+    public static final String ACTION_TRANSFER_RELEASE = "RELEASE";
 
     public static final String PARAM_LOCALE = "locale";
     public static final String PARAM_DATE_FORMAT = "dateFormat";