fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vorbur...@apache.org
Subject [fineract] branch develop updated: FINERACT-1043: Unable to create client due to invalid error message about required address field
Date Fri, 26 Jun 2020 10:42:15 GMT
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 d9911bd  FINERACT-1043: Unable to create client due to invalid error message about
required address field
d9911bd is described below

commit d9911bd7714adbb382cd87aefecde5c339136af0
Author: kiran-vsm <kiran.vsm19@gmail.com>
AuthorDate: Thu Jun 25 12:08:55 2020 +0530

    FINERACT-1043: Unable to create client due to invalid error message about required address
field
---
 .../portfolio/client/domain/ClientAddressRepository.java    | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java
index a17074d..478d8ed 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java
@@ -21,14 +21,15 @@ package org.apache.fineract.portfolio.client.domain;
 import org.apache.fineract.infrastructure.codes.domain.CodeValue;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 
 public interface ClientAddressRepository extends JpaRepository<ClientAddress, Long>,
JpaSpecificationExecutor<ClientAddress> {
 
-    ClientAddress findByClientId(String clientId);
+    @Query("SELECT clientAddress FROM ClientAddress clientAddress WHERE clientAddress.client.id
= :clientId AND clientAddress.addressType = :addressType AND clientAddress.isActive = :isActive
")
+    ClientAddress findByClientIdAndAddressTypeAndIsActive(@Param("clientId") final long clientId,
final CodeValue addressType,
+            @Param("isActive") final boolean isActive);
 
-    // ClientAddress findByAddressId(long addressId);
-
-    ClientAddress findByClientIdAndAddressTypeAndIsActive(final long clientId, final CodeValue
addressTypeId, final boolean isActive);
-
-    ClientAddress findByClientIdAndAddressId(final long clientId, final long addressId);
+    @Query("SELECT clientAddress FROM ClientAddress clientAddress WHERE clientAddress.client.id
= :clientId AND clientAddress.address.id = :addressId ")
+    ClientAddress findByClientIdAndAddressId(@Param("clientId") final long clientId, @Param("addressId")
final long addressId);
 }


Mime
View raw message