wip: fixed issues in Group add/edit and add client functionality
This commit is contained in:
+5
-2
@@ -27,6 +27,9 @@ public class GroupingTypesApiConstants {
|
|||||||
public static final String hierarchyParamName = "hierarchy";
|
public static final String hierarchyParamName = "hierarchy";
|
||||||
public static final String officeNameParamName = "officeName";
|
public static final String officeNameParamName = "officeName";
|
||||||
public static final String staffNameParamName = "staffName";
|
public static final String staffNameParamName = "staffName";
|
||||||
|
public static final String officeOptionsParamName = "officeOptions";
|
||||||
|
public static final String staffOptionsParamName = "staffOptions";
|
||||||
|
public static final String clientOptionsParamName = "clientOptions";
|
||||||
|
|
||||||
public static final Set<String> CENTER_REQUEST_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(localeParamName,
|
public static final Set<String> CENTER_REQUEST_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(localeParamName,
|
||||||
dateFormatParamName, nameParamName, externalIdParamName, officeIdParamName, staffIdParamName));
|
dateFormatParamName, nameParamName, externalIdParamName, officeIdParamName, staffIdParamName));
|
||||||
@@ -42,9 +45,9 @@ public class GroupingTypesApiConstants {
|
|||||||
|
|
||||||
public static final Set<String> CENTER_GROUP_RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(idParamName, nameParamName,
|
public static final Set<String> CENTER_GROUP_RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(idParamName, nameParamName,
|
||||||
externalIdParamName, officeIdParamName, officeNameParamName, staffIdParamName, staffNameParamName, hierarchyParamName,
|
externalIdParamName, officeIdParamName, officeNameParamName, staffIdParamName, staffNameParamName, hierarchyParamName,
|
||||||
"officeOptions", "staffOptions"));
|
officeOptionsParamName, staffOptionsParamName,clientOptionsParamName));
|
||||||
|
|
||||||
public static final Set<String> GROUP_RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(idParamName, nameParamName,
|
public static final Set<String> GROUP_RESPONSE_DATA_PARAMETERS = new HashSet<String>(Arrays.asList(idParamName, nameParamName,
|
||||||
externalIdParamName, officeIdParamName, officeNameParamName, "parentId", "parentName", staffIdParamName, staffNameParamName,
|
externalIdParamName, officeIdParamName, officeNameParamName, "parentId", "parentName", staffIdParamName, staffNameParamName,
|
||||||
hierarchyParamName, "officeOptions", "staffOptions", "clientOptions"));
|
hierarchyParamName, officeOptionsParamName, staffOptionsParamName,clientOptionsParamName));
|
||||||
}
|
}
|
||||||
+2
-2
@@ -230,8 +230,8 @@ public class LoansApiResource {
|
|||||||
|
|
||||||
final Collection<LoanChargeData> charges = loanBasicDetails.charges();
|
final Collection<LoanChargeData> charges = loanBasicDetails.charges();
|
||||||
if (productId != null) {
|
if (productId != null) {
|
||||||
final Long officeId = loanBasicDetails.officeId();
|
final Long officeId = loanBasicDetails.groupOfficeId();
|
||||||
allowedLoanOfficers = this.staffReadPlatformService.retrieveAllLoanOfficersByOffice(officeId);
|
if(officeId != null) allowedLoanOfficers = this.staffReadPlatformService.retrieveAllLoanOfficersByOffice(officeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
newLoanAccount = LoanAccountData.associationsAndTemplate(loanBasicDetails, repaymentSchedule, loanRepayments, charges,
|
newLoanAccount = LoanAccountData.associationsAndTemplate(loanBasicDetails, repaymentSchedule, loanRepayments, charges,
|
||||||
|
|||||||
+4
@@ -599,4 +599,8 @@ public class LoanAccountData {
|
|||||||
public Collection<LoanChargeData> charges() {
|
public Collection<LoanChargeData> charges() {
|
||||||
return this.charges;
|
return this.charges;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long groupOfficeId(){
|
||||||
|
return group == null? null : group.officeId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+8
-1
@@ -57,6 +57,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|||||||
import org.springframework.jdbc.core.ResultSetExtractor;
|
import org.springframework.jdbc.core.ResultSetExtractor;
|
||||||
import org.springframework.jdbc.core.RowMapper;
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
||||||
@@ -183,7 +184,13 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
|
|
||||||
context.authenticatedUser();
|
context.authenticatedUser();
|
||||||
|
|
||||||
final GroupGeneralData groupAccount = this.groupReadPlatformService.retrieveOne(groupId);
|
GroupGeneralData groupAccount = this.groupReadPlatformService.retrieveOne(groupId);
|
||||||
|
//get group associations
|
||||||
|
Collection<ClientData> membersOfGroup = this.clientReadPlatformService.retrieveClientMembersOfGroup(groupId);
|
||||||
|
if (!CollectionUtils.isEmpty(membersOfGroup)) {
|
||||||
|
groupAccount = GroupGeneralData.withAssocations(groupAccount, membersOfGroup);
|
||||||
|
}
|
||||||
|
|
||||||
final LocalDate expectedDisbursementDate = DateUtils.getLocalDateOfTenant();
|
final LocalDate expectedDisbursementDate = DateUtils.getLocalDateOfTenant();
|
||||||
LoanAccountData loanDetails = LoanAccountData.groupDefaults(groupAccount, expectedDisbursementDate);
|
LoanAccountData loanDetails = LoanAccountData.groupDefaults(groupAccount, expectedDisbursementDate);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user