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 2020/07/01 20:31:58 UTC

[fineract] branch develop updated: Fineract-1043 Removed street field from address

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 9c3f1ad  Fineract-1043 Removed street field from address
9c3f1ad is described below

commit 9c3f1addd74dca01c5feeb538adfd9ad80d6c7fc
Author: Nikhil Pawar <16...@users.noreply.github.com>
AuthorDate: Sat Jun 27 18:18:33 2020 -0400

    Fineract-1043 Removed street field from address
---
 .../AddressCommandFromApiJsonDeserializer.java       | 17 +----------------
 .../service/AddressWritePlatformServiceImpl.java     |  7 -------
 .../core_db/V359__remove_fied_from_address.sql       | 20 ++++++++++++++++++++
 3 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/serialization/AddressCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/serialization/AddressCommandFromApiJsonDeserializer.java
index 2adbaa7..4d5e127 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/serialization/AddressCommandFromApiJsonDeserializer.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/serialization/AddressCommandFromApiJsonDeserializer.java
@@ -96,7 +96,6 @@ public class AddressCommandFromApiJsonDeserializer {
             enabledFieldList.add("locale");
             enabledFieldList.add("dateFormat");
             supportedParameters = new HashSet<>(enabledFieldList);
-            // enabledFieldList.add("address");
 
             madatoryFieldsMap.put("addressTypeId", true);
 
@@ -108,23 +107,9 @@ public class AddressCommandFromApiJsonDeserializer {
             madatoryFieldsMap.put("addressId", true);
             supportedParameters = new HashSet<>(enabledFieldList);
         }
-        // final Set<String> supportedParameters = new
-        // HashSet<>(enabledFieldList);
-        this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, supportedParameters);
-
-        final String street = this.fromApiJsonHelper.extractStringNamed("street", element);
-
-        if (enabledFieldsMap.get("street")) {
-            if (madatoryFieldsMap.get("street") && fromNewClient) {
-
-                baseDataValidator.reset().parameter("street").value(street).notBlank();
 
-            }
-            if (!regexFieldsMap.get("street").isEmpty()) {
-                baseDataValidator.reset().parameter("street").value(street).matchesRegularExpression(regexFieldsMap.get("street"));
-            }
+        this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, supportedParameters);
 
-        }
         final String addressLine1 = this.fromApiJsonHelper.extractStringNamed("addressLine1", element);
         if (enabledFieldsMap.get("addressLine1")) {
             if (madatoryFieldsMap.get("addressLine1") && fromNewClient) {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java
index a523aaf..153c60f 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/address/service/AddressWritePlatformServiceImpl.java
@@ -185,13 +185,6 @@ public class AddressWritePlatformServiceImpl implements AddressWritePlatformServ
 
         final Address addobj = this.addressRepository.getOne(addressId);
 
-        if (!command.stringValueOfParameterNamed("street").isEmpty()) {
-
-            is_address_update = true;
-            final String street = command.stringValueOfParameterNamed("street");
-            addobj.setStreet(street);
-        }
-
         if (!command.stringValueOfParameterNamed("addressLine1").isEmpty()) {
 
             is_address_update = true;
diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql
new file mode 100644
index 0000000..6083604
--- /dev/null
+++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V359__remove_fied_from_address.sql
@@ -0,0 +1,20 @@
+--
+-- 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.
+--
+
+DELETE FROM `m_field_configuration`  WHERE field = 'street';