commit for FINERACT-53 (Make the clientId URL parameter optional for 'loan details template' retrieval)
This commit is contained in:
+8
-5
@@ -273,12 +273,15 @@ public class LoansApiResource {
|
||||
// for JLG loan both client and group details are required
|
||||
if (templateType.equals("individual") || templateType.equals("jlg")) {
|
||||
|
||||
final LoanAccountData loanAccountClientDetails = this.loanReadPlatformService.retrieveClientDetailsTemplate(clientId);
|
||||
if(clientId == null) {
|
||||
newLoanAccount = newLoanAccount == null ? LoanAccountData.emptyTemplate() : newLoanAccount;
|
||||
} else {
|
||||
final LoanAccountData loanAccountClientDetails = this.loanReadPlatformService.retrieveClientDetailsTemplate(clientId);
|
||||
|
||||
officeId = loanAccountClientDetails.officeId();
|
||||
|
||||
newLoanAccount = newLoanAccount == null ? loanAccountClientDetails : LoanAccountData.populateClientDefaults(newLoanAccount,
|
||||
loanAccountClientDetails);
|
||||
officeId = loanAccountClientDetails.officeId();
|
||||
newLoanAccount = newLoanAccount == null ? loanAccountClientDetails : LoanAccountData.populateClientDefaults(newLoanAccount,
|
||||
loanAccountClientDetails);
|
||||
}
|
||||
|
||||
// if it's JLG loan add group details
|
||||
if (templateType.equals("jlg")) {
|
||||
|
||||
+11
-1
@@ -1557,4 +1557,14 @@ public class LoanAccountData {
|
||||
return (this.repaymentFrequencyType.getId().intValue() == PeriodFrequencyType.MONTHS.getValue());
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Used to produce a {@link LoanAccountData} with only collateral options for now.
|
||||
*
|
||||
* @return {@link LoanAccountData} object
|
||||
*/
|
||||
public static LoanAccountData emptyTemplate() {
|
||||
final Collection<CodeValueData> loanCollateralOptions = null;
|
||||
|
||||
return LoanAccountData.collateralTemplate(loanCollateralOptions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user