FINERACT-1694: Making Avro mapping to fail at compile time for unmapped properties
This commit is contained in:
committed by
Arnold Gálovics
parent
3f1743a3d4
commit
4f312f33f6
@@ -13,7 +13,7 @@
|
||||
},
|
||||
{
|
||||
"default": null,
|
||||
"name": "code",
|
||||
"name": "role",
|
||||
"type": [
|
||||
"null",
|
||||
"org.apache.fineract.avro.generic.v1.CodeValueDataV1"
|
||||
|
||||
@@ -416,7 +416,7 @@
|
||||
"name": "timeline",
|
||||
"type": [
|
||||
"null",
|
||||
"org.apache.fineract.avro.generic.v1.EnumOptionDataV1"
|
||||
"org.apache.fineract.avro.loan.v1.LoanApplicationTimelineDataV1"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
"name": "timeline",
|
||||
"type": [
|
||||
"null",
|
||||
"org.apache.fineract.avro.loan.v1.LoanApplicationTimelineV1"
|
||||
"org.apache.fineract.avro.loan.v1.LoanApplicationTimelineDataV1"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "LoanApplicationTimelineV1",
|
||||
"name": "LoanApplicationTimelineDataV1",
|
||||
"namespace": "org.apache.fineract.avro.loan.v1",
|
||||
"type": "record",
|
||||
"fields": [
|
||||
@@ -325,7 +325,7 @@
|
||||
},
|
||||
{
|
||||
"default": null,
|
||||
"name": "allowPartialPeriodInterestCalcualtion",
|
||||
"name": "allowPartialPeriodInterestCalculation",
|
||||
"type": [
|
||||
"null",
|
||||
"boolean"
|
||||
|
||||
@@ -128,7 +128,10 @@
|
||||
"name": "periods",
|
||||
"type": [
|
||||
"null",
|
||||
"org.apache.fineract.avro.loan.v1.LoanSchedulePeriodDataV1"
|
||||
{
|
||||
"type": "array",
|
||||
"items": "org.apache.fineract.avro.loan.v1.LoanSchedulePeriodDataV1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -136,7 +139,10 @@
|
||||
"name": "futurePeriods",
|
||||
"type": [
|
||||
"null",
|
||||
"org.apache.fineract.avro.loan.v1.LoanSchedulePeriodDataV1"
|
||||
{
|
||||
"type": "array",
|
||||
"items": "org.apache.fineract.avro.loan.v1.LoanSchedulePeriodDataV1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
{
|
||||
"default": null,
|
||||
"name": "description",
|
||||
"name": "value",
|
||||
"type": [
|
||||
"null",
|
||||
"string"
|
||||
|
||||
+4
-4
@@ -37,7 +37,7 @@
|
||||
},
|
||||
{
|
||||
"default": null,
|
||||
"name": "rejectedOnDate",
|
||||
"name": "rejectedDate",
|
||||
"type": [
|
||||
"null",
|
||||
"string"
|
||||
@@ -69,7 +69,7 @@
|
||||
},
|
||||
{
|
||||
"default": null,
|
||||
"name": "approvedOnDate",
|
||||
"name": "approvedDate",
|
||||
"type": [
|
||||
"null",
|
||||
"string"
|
||||
@@ -101,7 +101,7 @@
|
||||
},
|
||||
{
|
||||
"default": null,
|
||||
"name": "activatedOnDate",
|
||||
"name": "activatedDate",
|
||||
"type": [
|
||||
"null",
|
||||
"string"
|
||||
@@ -133,7 +133,7 @@
|
||||
},
|
||||
{
|
||||
"default": null,
|
||||
"name": "closedOnDate",
|
||||
"name": "closedDate",
|
||||
"type": [
|
||||
"null",
|
||||
"string"
|
||||
|
||||
@@ -45,7 +45,7 @@ task buildJavaSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateT
|
||||
validateSpec = false
|
||||
skipValidateSpec = true
|
||||
inputSpec = "file:///$swaggerFile"
|
||||
outputDir = "$buildDir/generated/java".toString()
|
||||
outputDir = "$buildDir/generated/temp-java".toString()
|
||||
templateDir = "$projectDir/src/main/resources/templates/java"
|
||||
groupId = 'org.apache.fineract'
|
||||
apiPackage = 'org.apache.fineract.client.services'
|
||||
@@ -110,8 +110,24 @@ task buildAsciidoc(type: org.openapitools.generator.gradle.plugin.tasks.Generate
|
||||
dependsOn(':fineract-provider:resolve')
|
||||
}
|
||||
|
||||
task cleanupJodaImports() {
|
||||
// This is a temporary step to get rid of joda imports in the generated code
|
||||
// At this point it's unknown why it's even generated, probably it's a bug in the generator
|
||||
doLast {
|
||||
copy {
|
||||
from "$buildDir/generated/temp-java".toString()
|
||||
into "$buildDir/generated/java".toString()
|
||||
filter { line ->
|
||||
line.replaceAll("import org\\.joda\\.time\\.\\*;", "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn("buildJavaSdk")
|
||||
}
|
||||
|
||||
// TODO: @vidakovic we could provide even more client libs in different languages (Go, Ruby, Swift etc.)
|
||||
compileJava.dependsOn(buildJavaSdk, buildTypescriptAngularSdk, buildAsciidoc, licenseFormatMain, spotlessMiscApply)
|
||||
compileJava.dependsOn(buildJavaSdk, buildTypescriptAngularSdk, buildAsciidoc, cleanupJodaImports, licenseFormatMain, spotlessMiscApply)
|
||||
|
||||
java {
|
||||
// keep this at Java 8, not 17; see https://issues.apache.org/jira/browse/FINERACT-1214
|
||||
|
||||
+4
-3
@@ -212,7 +212,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
if (PortfolioAccountType.fromInt(entityTypeId).isLoanAccount()) {
|
||||
final LoanTransactionEnumData loanTransactionType = LoanEnumerations
|
||||
.transactionType(JdbcSupport.getInteger(rs, "loanTransactionType"));
|
||||
transactionTypeEnumData = new TransactionTypeEnumData(loanTransactionType.id(), loanTransactionType.getCode(),
|
||||
transactionTypeEnumData = new TransactionTypeEnumData(loanTransactionType.getId(), loanTransactionType.getCode(),
|
||||
loanTransactionType.getValue());
|
||||
} else if (PortfolioAccountType.fromInt(entityTypeId).isSavingsAccount()) {
|
||||
final SavingsAccountTransactionEnumData savingsTransactionType = SavingsEnumerations
|
||||
@@ -444,8 +444,9 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
||||
|
||||
final LocalDate transactionDate = DateUtils.getBusinessLocalDate();
|
||||
|
||||
return OfficeOpeningBalancesData.createNew(officeId, officeData.name(), transactionDate, contraAccount, assetAccountOpeningBalances,
|
||||
liabilityAccountOpeningBalances, incomeAccountOpeningBalances, equityAccountOpeningBalances, expenseAccountOpeningBalances);
|
||||
return OfficeOpeningBalancesData.createNew(officeId, officeData.getName(), transactionDate, contraAccount,
|
||||
assetAccountOpeningBalances, liabilityAccountOpeningBalances, incomeAccountOpeningBalances, equityAccountOpeningBalances,
|
||||
expenseAccountOpeningBalances);
|
||||
}
|
||||
|
||||
private List<JournalEntryData> populateOpeningBalances(final List<JournalEntryData> existingOpeningBalanceTransactions,
|
||||
|
||||
+2
-2
@@ -276,7 +276,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
if (StringUtils.isNotBlank(officeIdStr)) {
|
||||
officeId = Long.valueOf(officeIdStr);
|
||||
final OfficeData office = this.officeReadPlatformService.retrieveOffice(officeId);
|
||||
commandAsJsonMap.put("officeName", office.name());
|
||||
commandAsJsonMap.put("officeName", office.getName());
|
||||
} else {
|
||||
commandAsJsonMap.put("officeName", "");
|
||||
}
|
||||
@@ -290,7 +290,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||
if (StringUtils.isNotBlank(clientIdStr)) {
|
||||
clientId = Long.valueOf(clientIdStr);
|
||||
final ClientData client = this.clientReadPlatformService.retrieveOne(clientId);
|
||||
commandAsJsonMap.put("clientName", client.displayName());
|
||||
commandAsJsonMap.put("clientName", client.getDisplayName());
|
||||
} else {
|
||||
commandAsJsonMap.put("clientName", "");
|
||||
}
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
|
||||
} else {
|
||||
commandSourceResult = CommandSource.fullEntryFrom(wrapper, command, maker);
|
||||
}
|
||||
commandSourceResult.updateResourceId(result.resourceId());
|
||||
commandSourceResult.updateResourceId(result.getResourceId());
|
||||
commandSourceResult.updateForAudit(result.getOfficeId(), result.getGroupId(), result.getClientId(), result.getLoanId(),
|
||||
result.getSavingsId(), result.getProductId(), result.getTransactionId());
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public class ClientIdSerializer implements JsonSerializer<Collection<ClientData>
|
||||
public JsonElement serialize(Collection<ClientData> src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
JsonArray clientIdJsonArray = new JsonArray();
|
||||
for (ClientData client : src) {
|
||||
JsonElement clientIdElment = new JsonPrimitive(client.id().toString());
|
||||
JsonElement clientIdElment = new JsonPrimitive(client.getId().toString());
|
||||
clientIdJsonArray.add(clientIdElment);
|
||||
}
|
||||
return clientIdJsonArray;
|
||||
|
||||
+1
-1
@@ -29,6 +29,6 @@ public class CurrencyDateCodeSerializer implements JsonSerializer<CurrencyData>
|
||||
|
||||
@Override
|
||||
public JsonElement serialize(CurrencyData src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
return new JsonPrimitive(src.code());
|
||||
return new JsonPrimitive(src.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -100,7 +100,7 @@ public abstract class AbstractWorkbookPopulator implements WorkbookPopulator {
|
||||
int rowIndex = 0;
|
||||
for (OfficeData office : offices) {
|
||||
Row row = sheet.createRow(++rowIndex);
|
||||
writeString(officeNameCol, row, office.name().trim().replaceAll("[ )(]", "_"));
|
||||
writeString(officeNameCol, row, office.getName().trim().replaceAll("[ )(]", "_"));
|
||||
writeDate(activationDateCol, row, "" + office.getOpeningDate().getDayOfMonth() + "/"
|
||||
+ office.getOpeningDate().getMonthValue() + "/" + office.getOpeningDate().getYear(), dateCellStyle, dateFormat);
|
||||
|
||||
@@ -123,7 +123,7 @@ public abstract class AbstractWorkbookPopulator implements WorkbookPopulator {
|
||||
if (row == null) {
|
||||
row = sheet.createRow(rowIndex);
|
||||
}
|
||||
writeString(nameCol, row, client.displayName().replaceAll("[ )(] ", "_") + "(" + client.id() + ")");
|
||||
writeString(nameCol, row, client.getDisplayName().replaceAll("[ )(] ", "_") + "(" + client.getId() + ")");
|
||||
|
||||
if (client.getActivationDate() != null) {
|
||||
writeDate(activationDateCol, row, outputFormat.format(client.getActivationDate()), dateCellStyle, dateFormat);
|
||||
|
||||
+3
-3
@@ -72,11 +72,11 @@ public class CenterSheetPopulator extends AbstractWorkbookPopulator {
|
||||
Row row = centerSheet.createRow(rowIndex);
|
||||
for (OfficeData office : offices) {
|
||||
startIndex = rowIndex + 1;
|
||||
writeString(OFFICE_NAME_COL, row, office.name());
|
||||
writeString(OFFICE_NAME_COL, row, office.getName());
|
||||
ArrayList<String> centersList = new ArrayList<String>();
|
||||
|
||||
if (officeToCenters.containsKey(office.name().trim().replaceAll("[ )(]", "_"))) {
|
||||
centersList = officeToCenters.get(office.name().trim().replaceAll("[ )(]", "_"));
|
||||
if (officeToCenters.containsKey(office.getName().trim().replaceAll("[ )(]", "_"))) {
|
||||
centersList = officeToCenters.get(office.getName().trim().replaceAll("[ )(]", "_"));
|
||||
if (!centersList.isEmpty()) {
|
||||
for (String centerName : centersList) {
|
||||
writeString(CENTER_NAME_COL, row, centerName);
|
||||
|
||||
+6
-6
@@ -62,7 +62,7 @@ public class ClientSheetPopulator extends AbstractWorkbookPopulator {
|
||||
private void setClientNameToClientIdMap() {
|
||||
clientNameToClientId = new HashMap<>();
|
||||
for (ClientData clientData : allClients) {
|
||||
clientNameToClientId.put(clientData.displayName().trim() + "(" + clientData.id() + ")", clientData.id());
|
||||
clientNameToClientId.put(clientData.getDisplayName().trim() + "(" + clientData.getId() + ")", clientData.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,14 +82,14 @@ public class ClientSheetPopulator extends AbstractWorkbookPopulator {
|
||||
officeToClients = new HashMap<>();
|
||||
for (ClientData person : allClients) {
|
||||
addToOfficeClientMap(person.getOfficeName().trim().replaceAll("[ )(]", "_"),
|
||||
person.displayName().trim() + "(" + person.id() + ")");
|
||||
person.getDisplayName().trim() + "(" + person.getId() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
private void setClientNameToSavingsAccountsIdsMap() {
|
||||
clientNameToSavingsAccountIds = new HashMap<>();
|
||||
for (ClientData client : allClients) {
|
||||
clientNameToSavingsAccountIds.put(client.displayName().trim() + "(" + client.id() + ")", client.getSavingsAccountId());
|
||||
clientNameToSavingsAccountIds.put(client.getDisplayName().trim() + "(" + client.getId() + ")", client.getSavingsAccountId());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -112,10 +112,10 @@ public class ClientSheetPopulator extends AbstractWorkbookPopulator {
|
||||
Row row = clientSheet.createRow(rowIndex);
|
||||
for (OfficeData office : officesDataList) {
|
||||
startIndex = rowIndex + 1;
|
||||
writeString(OFFICE_NAME_COL, row, office.name());
|
||||
writeString(OFFICE_NAME_COL, row, office.getName());
|
||||
ArrayList<String> clientList = new ArrayList<String>();
|
||||
if (officeToClients.containsKey(office.name().trim().replaceAll("[ )(]", "_"))) {
|
||||
clientList = officeToClients.get(office.name().trim().replaceAll("[ )(]", "_"));
|
||||
if (officeToClients.containsKey(office.getName().trim().replaceAll("[ )(]", "_"))) {
|
||||
clientList = officeToClients.get(office.getName().trim().replaceAll("[ )(]", "_"));
|
||||
}
|
||||
if (!clientList.isEmpty()) {
|
||||
for (String clientName : clientList) {
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ public class ExtrasSheetPopulator extends AbstractWorkbookPopulator {
|
||||
}
|
||||
|
||||
writeString(CURRENCY_NAME_COL, row, currencies.getName().trim().replaceAll("[ )(]", "_"));
|
||||
writeString(CURRENCY_CODE_COL, row, currencies.code());
|
||||
writeString(CURRENCY_CODE_COL, row, currencies.getCode());
|
||||
}
|
||||
extrasSheet.protectSheet("");
|
||||
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ public class FixedDepositProductSheetPopulator extends AbstractWorkbookPopulator
|
||||
writeString(LOCKIN_PERIOD_FREQUENCY_COL, row, product.getLockinPeriodFrequencyType().getValue());
|
||||
}
|
||||
CurrencyData currency = product.getCurrency();
|
||||
writeString(CURRENCY_COL, row, currency.code());
|
||||
writeString(CURRENCY_COL, row, currency.getCode());
|
||||
}
|
||||
productSheet.protectSheet("");
|
||||
}
|
||||
|
||||
+3
-3
@@ -93,11 +93,11 @@ public class GroupSheetPopulator extends AbstractWorkbookPopulator {
|
||||
Row row = groupSheet.createRow(rowIndex);
|
||||
for (OfficeData office : offices) {
|
||||
startIndex = rowIndex + 1;
|
||||
writeString(OFFICE_NAME_COL, row, office.name());
|
||||
writeString(OFFICE_NAME_COL, row, office.getName());
|
||||
ArrayList<String> groupsList = new ArrayList<>();
|
||||
|
||||
if (officeToGroups.containsKey(office.name().trim().replaceAll("[ )(]", "_"))) {
|
||||
groupsList = officeToGroups.get(office.name().trim().replaceAll("[ )(]", "_"));
|
||||
if (officeToGroups.containsKey(office.getName().trim().replaceAll("[ )(]", "_"))) {
|
||||
groupsList = officeToGroups.get(office.getName().trim().replaceAll("[ )(]", "_"));
|
||||
}
|
||||
|
||||
if (!groupsList.isEmpty()) {
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ public class OfficeSheetPopulator extends AbstractWorkbookPopulator {
|
||||
for (OfficeData office : offices) {
|
||||
Row row = officeSheet.createRow(rowIndex);
|
||||
writeLong(ID_COL, row, office.getId());
|
||||
writeString(OFFICE_NAME_COL, row, office.name().trim().replaceAll("[ )(]", "_"));
|
||||
writeString(OFFICE_NAME_COL, row, office.getName().trim().replaceAll("[ )(]", "_"));
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class OfficeSheetPopulator extends AbstractWorkbookPopulator {
|
||||
public List<String> getOfficeNames() {
|
||||
List<String> officeNames = new ArrayList<>();
|
||||
for (OfficeData office : offices) {
|
||||
officeNames.add(office.name());
|
||||
officeNames.add(office.getName());
|
||||
}
|
||||
return officeNames;
|
||||
}
|
||||
|
||||
+2
-2
@@ -77,9 +77,9 @@ public class PersonnelSheetPopulator extends AbstractWorkbookPopulator {
|
||||
Row row = staffSheet.createRow(rowIndex);
|
||||
for (OfficeData office : offices) {
|
||||
startIndex = rowIndex + 1;
|
||||
writeString(OFFICE_NAME_COL, row, office.name().trim().replaceAll("[ )(]", "_"));
|
||||
writeString(OFFICE_NAME_COL, row, office.getName().trim().replaceAll("[ )(]", "_"));
|
||||
|
||||
List<StaffData> staffList = officeToPersonnel.get(office.name().trim().replaceAll("[ )(]", "_"));
|
||||
List<StaffData> staffList = officeToPersonnel.get(office.getName().trim().replaceAll("[ )(]", "_"));
|
||||
|
||||
if (staffList != null) {
|
||||
if (!staffList.isEmpty()) {
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ public class RecurringDepositProductSheetPopulator extends AbstractWorkbookPopul
|
||||
writeString(LOCKIN_PERIOD_FREQUENCY_COL, row, product.getLockinPeriodFrequencyType().getValue());
|
||||
}
|
||||
CurrencyData currency = product.getCurrency();
|
||||
writeString(CURRENCY_COL, row, currency.code());
|
||||
writeString(CURRENCY_COL, row, currency.getCode());
|
||||
}
|
||||
productSheet.protectSheet("");
|
||||
}
|
||||
|
||||
+2
-2
@@ -53,9 +53,9 @@ public class SavingsAccountSheetPopulator extends AbstractWorkbookPopulator {
|
||||
int rowIndex = 1;
|
||||
for (SavingsAccountData savings : savingsAccountDataList) {
|
||||
Row row = savingsSheet.createRow(rowIndex++);
|
||||
writeLong(SAVINGS_ACCOUNT_ID_COL, row, savings.id());
|
||||
writeLong(SAVINGS_ACCOUNT_ID_COL, row, savings.getId());
|
||||
writeString(SAVING_ACCOUNT_NO, row, savings.getAccountNo());
|
||||
writeString(CURRENCY_COL, row, savings.currency().code());
|
||||
writeString(CURRENCY_COL, row, savings.getCurrency().getCode());
|
||||
writeString(CLIENT_NAME, row, savings.getClientName());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -79,10 +79,10 @@ public class SavingsProductSheetPopulator extends AbstractWorkbookPopulator {
|
||||
writeString(LOCKIN_PERIOD_FREQUENCY_COL, row, product.getLockinPeriodFrequencyType().getValue());
|
||||
}
|
||||
CurrencyData currency = product.getCurrency();
|
||||
writeString(CURRENCY_COL, row, currency.code());
|
||||
writeInt(DECIMAL_PLACES_COL, row, currency.decimalPlaces());
|
||||
if (currency.currencyInMultiplesOf() != null) {
|
||||
writeInt(IN_MULTIPLES_OF_COL, row, currency.currencyInMultiplesOf());
|
||||
writeString(CURRENCY_COL, row, currency.getCode());
|
||||
writeInt(DECIMAL_PLACES_COL, row, currency.getDecimalPlaces());
|
||||
if (currency.getInMultiplesOf() != null) {
|
||||
writeInt(IN_MULTIPLES_OF_COL, row, currency.getInMultiplesOf());
|
||||
}
|
||||
writeBoolean(WITHDRAWAL_FEE_COL, row, product.isWithdrawalFeeForTransfers());
|
||||
writeBoolean(ALLOW_OVERDRAFT_COL, row, product.isAllowOverdraft());
|
||||
|
||||
+3
-3
@@ -76,9 +76,9 @@ public class SharedProductsSheetPopulator extends AbstractWorkbookPopulator {
|
||||
writeLong(PRODUCT_ID, row, productData.getId());
|
||||
writeString(PRODUCT_NAME_COL, row, productData.getName().replaceAll("[ ]", "_"));
|
||||
writeString(CURRENCY_COL, row, productData.getCurrency().getName().replaceAll("[ ]", "_"));
|
||||
writeInt(DECIMAL_PLACES_COL, row, productData.getCurrency().decimalPlaces());
|
||||
writeInt(DECIMAL_PLACES_COL, row, productData.getCurrency().getDecimalPlaces());
|
||||
writeBigDecimal(TODAYS_PRICE_COL, row, deriveMarketPrice(productData));
|
||||
writeInt(CURRENCY_IN_MULTIPLES_COL, row, productData.getCurrency().currencyInMultiplesOf());
|
||||
writeInt(CURRENCY_IN_MULTIPLES_COL, row, productData.getCurrency().getInMultiplesOf());
|
||||
if (chargesForSharedProducts != null) {
|
||||
int chargeRowIndex = 0;
|
||||
for (ChargeData chargeData : chargesForSharedProducts) {
|
||||
@@ -101,7 +101,7 @@ public class SharedProductsSheetPopulator extends AbstractWorkbookPopulator {
|
||||
if (marketDataSet != null && !marketDataSet.isEmpty()) {
|
||||
LocalDate currentDate = DateUtils.getBusinessLocalDate();
|
||||
for (ShareProductMarketPriceData data : marketDataSet) {
|
||||
LocalDate futureDate = data.getStartDate();
|
||||
LocalDate futureDate = data.getFromDate();
|
||||
if (currentDate.isAfter(futureDate)) {
|
||||
marketValue = data.getShareValue();
|
||||
}
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ public class CentersWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
Integer[] officeNameToBeginEndIndexesOfStaff = personnelSheetPopulator.getOfficeNameToBeginEndIndexesOfStaff().get(i);
|
||||
Name loanOfficerName = centerWorkbook.createName();
|
||||
if (officeNameToBeginEndIndexesOfStaff != null) {
|
||||
loanOfficerName.setNameName("Staff_" + offices.get(i).name().trim().replaceAll("[ )(]", "_"));
|
||||
loanOfficerName.setNameName("Staff_" + offices.get(i).getName().trim().replaceAll("[ )(]", "_"));
|
||||
loanOfficerName.setRefersToFormula(TemplatePopulateImportConstants.STAFF_SHEET_NAME + "!$B$"
|
||||
+ officeNameToBeginEndIndexesOfStaff[0] + ":$B$" + officeNameToBeginEndIndexesOfStaff[1]);
|
||||
}
|
||||
|
||||
+3
-3
@@ -95,7 +95,7 @@ public class ChartOfAccountsWorkbook extends AbstractWorkbookPopulator {
|
||||
String[] currencyCode = new String[currencies.size()];
|
||||
int currencyIndex = 0;
|
||||
for (CurrencyData currencies : currencies) {
|
||||
currencyCode[currencyIndex] = currencies.code();
|
||||
currencyCode[currencyIndex] = currencies.getCode();
|
||||
currencyIndex++;
|
||||
}
|
||||
return currencyCode;
|
||||
@@ -246,13 +246,13 @@ public class ChartOfAccountsWorkbook extends AbstractWorkbookPopulator {
|
||||
startIndex = rowIndex + 1;
|
||||
if (chartOfAccountsSheet.getRow(rowIndex) != null) {
|
||||
Row row = chartOfAccountsSheet.getRow(rowIndex);
|
||||
writeString(ChartOfAcountsConstants.LOOKUP_OFFICE_COL, row, office.name());
|
||||
writeString(ChartOfAcountsConstants.LOOKUP_OFFICE_COL, row, office.getName());
|
||||
writeLong(ChartOfAcountsConstants.LOOKUP_OFFICE_ID_COL, row, office.getId());
|
||||
rowIndex++;
|
||||
|
||||
} else {
|
||||
Row row = chartOfAccountsSheet.createRow(rowIndex);
|
||||
writeString(ChartOfAcountsConstants.LOOKUP_OFFICE_COL, row, office.name());
|
||||
writeString(ChartOfAcountsConstants.LOOKUP_OFFICE_COL, row, office.getName());
|
||||
writeLong(ChartOfAcountsConstants.LOOKUP_OFFICE_ID_COL, row, office.getId());
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
+1
-1
@@ -368,7 +368,7 @@ public class ClientEntityWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
Integer[] officeNameToBeginEndIndexesOfStaff = personnelSheetPopulator.getOfficeNameToBeginEndIndexesOfStaff().get(i);
|
||||
if (officeNameToBeginEndIndexesOfStaff != null) {
|
||||
Name name = clientWorkbook.createName();
|
||||
setSanitized(name, "Staff_" + offices.get(i).name());
|
||||
setSanitized(name, "Staff_" + offices.get(i).getName());
|
||||
name.setRefersToFormula(TemplatePopulateImportConstants.STAFF_SHEET_NAME + "!$B$" + officeNameToBeginEndIndexesOfStaff[0]
|
||||
+ ":$B$" + officeNameToBeginEndIndexesOfStaff[1]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -340,7 +340,7 @@ public class ClientPersonWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
Integer[] officeNameToBeginEndIndexesOfStaff = personnelSheetPopulator.getOfficeNameToBeginEndIndexesOfStaff().get(i);
|
||||
if (officeNameToBeginEndIndexesOfStaff != null) {
|
||||
Name name = clientWorkbook.createName();
|
||||
setSanitized(name, "Staff_" + offices.get(i).name());
|
||||
setSanitized(name, "Staff_" + offices.get(i).getName());
|
||||
name.setRefersToFormula(TemplatePopulateImportConstants.STAFF_SHEET_NAME + "!$B$" + officeNameToBeginEndIndexesOfStaff[0]
|
||||
+ ":$B$" + officeNameToBeginEndIndexesOfStaff[1]);
|
||||
}
|
||||
|
||||
+2
-2
@@ -241,12 +241,12 @@ public class GroupsWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
Name centerName = centerWorkbook.createName();
|
||||
|
||||
if (officeNameToBeginEndIndexesOfStaff != null) {
|
||||
setSanitized(loanOfficerName, "Staff_" + offices.get(i).name());
|
||||
setSanitized(loanOfficerName, "Staff_" + offices.get(i).getName());
|
||||
loanOfficerName.setRefersToFormula(TemplatePopulateImportConstants.STAFF_SHEET_NAME + "!$B$"
|
||||
+ officeNameToBeginEndIndexesOfStaff[0] + ":$B$" + officeNameToBeginEndIndexesOfStaff[1]);
|
||||
}
|
||||
if (officeNameToBeginEndIndexesOfCenters != null) {
|
||||
setSanitized(centerName, "Center_" + offices.get(i).name());
|
||||
setSanitized(centerName, "Center_" + offices.get(i).getName());
|
||||
centerName.setRefersToFormula(TemplatePopulateImportConstants.CENTER_SHEET_NAME + "!$B$"
|
||||
+ officeNameToBeginEndIndexesOfCenters[0] + ":$B$" + officeNameToBeginEndIndexesOfCenters[1]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class OfficeWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
int rowIndex = 1;
|
||||
for (OfficeData office : offices) {
|
||||
Row row = officeSheet.createRow(rowIndex);
|
||||
writeString(OfficeConstants.LOOKUP_OFFICE_COL, row, office.name());
|
||||
writeString(OfficeConstants.LOOKUP_OFFICE_COL, row, office.getName());
|
||||
writeLong(OfficeConstants.LOOKUP_OFFICE_ID_COL, row, office.getId());
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
+1
-1
@@ -404,7 +404,7 @@ public class SavingsWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
setSanitized(lockinPeriodFrequencyName, "Lockin_Frequency_" + productName);
|
||||
lockinPeriodFrequencyName.setRefersToFormula(TemplatePopulateImportConstants.PRODUCT_SHEET_NAME + "!$J$" + (i + 2));
|
||||
}
|
||||
if (product.getCurrency().currencyInMultiplesOf() != null) {
|
||||
if (product.getCurrency().getInMultiplesOf() != null) {
|
||||
setSanitized(inMultiplesOfName, "In_Multiples_" + productName);
|
||||
inMultiplesOfName.setRefersToFormula(TemplatePopulateImportConstants.PRODUCT_SHEET_NAME + "!$M$" + (i + 2));
|
||||
}
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ public class UserWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
Name userOfficeName = userWorkbook.createName();
|
||||
|
||||
if (officeNameToBeginEndIndexesOfStaff != null) {
|
||||
setSanitized(userOfficeName, "Staff_" + offices.get(i).name());
|
||||
setSanitized(userOfficeName, "Staff_" + offices.get(i).getName());
|
||||
userOfficeName.setRefersToFormula(TemplatePopulateImportConstants.STAFF_SHEET_NAME + "!$B$"
|
||||
+ officeNameToBeginEndIndexesOfStaff[0] + ":$B$" + officeNameToBeginEndIndexesOfStaff[1]);
|
||||
}
|
||||
|
||||
+2
-27
@@ -19,20 +19,17 @@
|
||||
package org.apache.fineract.infrastructure.codes.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Immutable data object represent code-value data in system.
|
||||
*/
|
||||
@Getter
|
||||
public class CodeValueData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
|
||||
private final String name;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final Integer position;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final String description;
|
||||
private final boolean active;
|
||||
private final boolean mandatory;
|
||||
@@ -88,26 +85,4 @@ public class CodeValueData implements Serializable {
|
||||
this.active = active;
|
||||
this.mandatory = mandatory;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the mandatory
|
||||
*/
|
||||
public boolean isMandatory() {
|
||||
return mandatory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the active
|
||||
*/
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-52
@@ -21,12 +21,14 @@ package org.apache.fineract.infrastructure.core.data;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* Represents the successful result of an REST API call that results in processing a command.
|
||||
*/
|
||||
@ToString
|
||||
@Getter
|
||||
public class CommandProcessingResult implements Serializable {
|
||||
|
||||
private Long commandId;
|
||||
@@ -171,46 +173,10 @@ public class CommandProcessingResult implements Serializable {
|
||||
this(commandId, officeId, null, clientId, null, null, null, resourceId, null, changesOnly, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
public Long commandId() {
|
||||
return this.commandId;
|
||||
}
|
||||
|
||||
public Long resourceId() {
|
||||
return this.resourceId;
|
||||
}
|
||||
|
||||
public Long getOfficeId() {
|
||||
return this.officeId;
|
||||
}
|
||||
|
||||
public void setOfficeId(final Long officeId) {
|
||||
this.officeId = officeId;
|
||||
}
|
||||
|
||||
public Long getGroupId() {
|
||||
return this.groupId;
|
||||
}
|
||||
|
||||
public Long getClientId() {
|
||||
return this.clientId;
|
||||
}
|
||||
|
||||
public Long getLoanId() {
|
||||
return this.loanId;
|
||||
}
|
||||
|
||||
public Long getSavingsId() {
|
||||
return this.savingsId;
|
||||
}
|
||||
|
||||
public String getTransactionId() {
|
||||
return this.transactionId;
|
||||
}
|
||||
|
||||
public Map<String, Object> getCreditReport() {
|
||||
return this.creditBureauReportData;
|
||||
}
|
||||
|
||||
public Map<String, Object> getChanges() {
|
||||
Map<String, Object> checkIfEmpty = null;
|
||||
if (this.changes != null && !this.changes.isEmpty()) {
|
||||
@@ -224,18 +190,6 @@ public class CommandProcessingResult implements Serializable {
|
||||
return !noChanges;
|
||||
}
|
||||
|
||||
public Long getProductId() {
|
||||
return this.productId;
|
||||
}
|
||||
|
||||
public Long getGsimId() {
|
||||
return this.gsimId;
|
||||
}
|
||||
|
||||
public Long getGlimId() {
|
||||
return this.glimId;
|
||||
}
|
||||
|
||||
public boolean isRollbackTransaction() {
|
||||
return this.rollbackTransaction != null && this.rollbackTransaction;
|
||||
}
|
||||
@@ -243,8 +197,4 @@ public class CommandProcessingResult implements Serializable {
|
||||
public void setRollbackTransaction(Boolean rollbackTransaction) {
|
||||
this.rollbackTransaction = rollbackTransaction;
|
||||
}
|
||||
|
||||
public Long getSubResourceId() {
|
||||
return subResourceId;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-36
@@ -19,51 +19,21 @@
|
||||
package org.apache.fineract.infrastructure.core.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Immutable data object representing generic enumeration value.
|
||||
* </p>
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@AllArgsConstructor
|
||||
public class EnumOptionData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
private final String code;
|
||||
private final String value;
|
||||
|
||||
public EnumOptionData(final Long id, final String code, final String value) {
|
||||
this.id = id;
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof EnumOptionData)) {
|
||||
return false;
|
||||
}
|
||||
EnumOptionData that = (EnumOptionData) o;
|
||||
return id.equals(that.id) && code.equals(that.code) && value.equals(that.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, code, value);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.client;
|
||||
|
||||
import org.apache.fineract.avro.client.v1.ClientDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.client.data.ClientData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface ClientDataMapper {
|
||||
|
||||
ClientDataV1 map(ClientData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.fixeddeposit;
|
||||
|
||||
import org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.savings.data.FixedDepositAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface FixedDepositAccountDataMapper {
|
||||
|
||||
FixedDepositAccountDataV1 map(FixedDepositAccountData source);
|
||||
|
||||
+2
-1
@@ -20,9 +20,10 @@ package org.apache.fineract.infrastructure.event.external.service.serialization.
|
||||
|
||||
import org.apache.fineract.avro.generic.v1.CommandProcessingResultV1;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface CommandProcessingResultMapper {
|
||||
|
||||
CommandProcessingResultV1 map(CommandProcessingResult source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan;
|
||||
|
||||
import org.apache.fineract.avro.loan.v1.LoanAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface LoanAccountDataMapper {
|
||||
|
||||
LoanAccountDataV1 map(LoanAccountData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan;
|
||||
|
||||
import org.apache.fineract.avro.loan.v1.LoanChargeDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface LoanChargeDataMapper {
|
||||
|
||||
LoanChargeDataV1 map(LoanChargeData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan;
|
||||
|
||||
import org.apache.fineract.avro.loan.v1.LoanProductDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.loanproduct.data.LoanProductData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface LoanProductDataMapper {
|
||||
|
||||
LoanProductDataV1 map(LoanProductData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan;
|
||||
|
||||
import org.apache.fineract.avro.loan.v1.LoanTransactionDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface LoanTransactionDataMapper {
|
||||
|
||||
LoanTransactionDataV1 map(LoanTransactionData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.recurringdeposit;
|
||||
|
||||
import org.apache.fineract.avro.recurringdeposit.v1.RecurringDepositAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.savings.data.RecurringDepositAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface RecurringDepositAccountDataMapper {
|
||||
|
||||
RecurringDepositAccountDataV1 map(RecurringDepositAccountData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.savings;
|
||||
|
||||
import org.apache.fineract.avro.savings.v1.SavingsAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.savings.data.SavingsAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface SavingsAccountDataMapper {
|
||||
|
||||
SavingsAccountDataV1 map(SavingsAccountData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.savings;
|
||||
|
||||
import org.apache.fineract.avro.savings.v1.SavingsAccountTransactionDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface SavingsAccountTransactionDataMapper {
|
||||
|
||||
SavingsAccountTransactionDataV1 map(SavingsAccountTransactionData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.share;
|
||||
|
||||
import org.apache.fineract.avro.share.v1.ShareAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface ShareAccountDataMapper {
|
||||
|
||||
ShareAccountDataV1 map(ShareAccountData source);
|
||||
|
||||
+2
-1
@@ -19,10 +19,11 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.share;
|
||||
|
||||
import org.apache.fineract.avro.share.v1.ShareProductDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.support.AvroMapperConfig;
|
||||
import org.apache.fineract.portfolio.shareproducts.data.ShareProductData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Mapper(config = AvroMapperConfig.class)
|
||||
public interface ShareProductDataMapper {
|
||||
|
||||
ShareProductDataV1 map(ShareProductData source);
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* 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.infrastructure.event.external.service.serialization.mapper.support;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AvroDateTimeMapper {
|
||||
|
||||
public String mapOffsetDateTime(OffsetDateTime source) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(source);
|
||||
}
|
||||
|
||||
public String mapLocalDateTime(LocalDateTime source) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(source);
|
||||
}
|
||||
|
||||
public String mapLocalDate(LocalDate source) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
return DateTimeFormatter.ISO_LOCAL_DATE.format(source);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 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.infrastructure.event.external.service.serialization.mapper.support;
|
||||
|
||||
import org.mapstruct.Builder;
|
||||
import org.mapstruct.MapperConfig;
|
||||
import org.mapstruct.MappingConstants;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
@MapperConfig(componentModel = MappingConstants.ComponentModel.SPRING, unmappedTargetPolicy = ReportingPolicy.ERROR, builder = @Builder(disableBuilder = true), uses = {
|
||||
AvroDateTimeMapper.class, AvroMonthDayMapper.class })
|
||||
public class AvroMapperConfig {}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 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.infrastructure.event.external.service.serialization.mapper.support;
|
||||
|
||||
import java.time.MonthDay;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AvroMonthDayMapper {
|
||||
|
||||
public String mapMonthDay(MonthDay source) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
return source.toString();
|
||||
}
|
||||
}
|
||||
+4
-50
@@ -19,11 +19,14 @@
|
||||
package org.apache.fineract.organisation.monetary.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Immutable data object representing currency.
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
public class CurrencyData implements Serializable {
|
||||
|
||||
private final String code;
|
||||
@@ -31,9 +34,7 @@ public class CurrencyData implements Serializable {
|
||||
private final int decimalPlaces;
|
||||
private final Integer inMultiplesOf;
|
||||
private final String displaySymbol;
|
||||
@SuppressWarnings("unused")
|
||||
private final String nameCode;
|
||||
@SuppressWarnings("unused")
|
||||
private final String displayLabel;
|
||||
|
||||
public static CurrencyData blank() {
|
||||
@@ -71,18 +72,6 @@ public class CurrencyData implements Serializable {
|
||||
this.displayLabel = null;
|
||||
}
|
||||
|
||||
public String code() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public int decimalPlaces() {
|
||||
return this.decimalPlaces;
|
||||
}
|
||||
|
||||
public Integer currencyInMultiplesOf() {
|
||||
return this.inMultiplesOf;
|
||||
}
|
||||
|
||||
private String generateDisplayLabel() {
|
||||
|
||||
final StringBuilder builder = new StringBuilder(this.name).append(' ');
|
||||
@@ -95,39 +84,4 @@ public class CurrencyData implements Serializable {
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof CurrencyData)) {
|
||||
return false;
|
||||
}
|
||||
CurrencyData that = (CurrencyData) o;
|
||||
return (decimalPlaces == that.decimalPlaces) && Objects.equals(code, that.code) && Objects.equals(name, that.name)
|
||||
&& Objects.equals(inMultiplesOf, that.inMultiplesOf) && Objects.equals(displaySymbol, that.displaySymbol)
|
||||
&& Objects.equals(nameCode, that.nameCode) && Objects.equals(displayLabel, that.displayLabel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(code, name, decimalPlaces, inMultiplesOf, displaySymbol, nameCode, displayLabel);
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public int getDecimalPlaces() {
|
||||
return this.decimalPlaces;
|
||||
}
|
||||
|
||||
public Integer getInMultiplesOf() {
|
||||
return this.inMultiplesOf;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-21
@@ -22,10 +22,12 @@ import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Immutable data object for office data.
|
||||
*/
|
||||
@Getter
|
||||
public class OfficeData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
@@ -36,7 +38,6 @@ public class OfficeData implements Serializable {
|
||||
private final String hierarchy;
|
||||
private final Long parentId;
|
||||
private final String parentName;
|
||||
@SuppressWarnings("unused")
|
||||
private final Collection<OfficeData> allowedParents;
|
||||
|
||||
// import fields
|
||||
@@ -58,18 +59,6 @@ public class OfficeData implements Serializable {
|
||||
return new OfficeData(id, name, null, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
public LocalDate getOpeningDate() {
|
||||
return openingDate;
|
||||
}
|
||||
|
||||
public Integer getRowIndex() {
|
||||
return rowIndex;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public static OfficeData dropdown(final Long id, final String name, final String nameDecorated) {
|
||||
return new OfficeData(id, name, nameDecorated, null, null, null, null, null, null);
|
||||
}
|
||||
@@ -99,12 +88,4 @@ public class OfficeData implements Serializable {
|
||||
public boolean hasIdentifyOf(final Long officeId) {
|
||||
return this.id.equals(officeId);
|
||||
}
|
||||
|
||||
public String name() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getHierarchy() {
|
||||
return this.hierarchy;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -369,7 +369,7 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement
|
||||
final OfficeData officeData = this.officeReadPlatformService.retrieveOffice(defaultOfficeId);
|
||||
String officeName = "";
|
||||
if (officeData != null) {
|
||||
officeName = officeData.name();
|
||||
officeName = officeData.getName();
|
||||
}
|
||||
|
||||
TellerData tellerData = findTeller(tellerId);
|
||||
|
||||
+4
-4
@@ -246,10 +246,10 @@ public class StandingInstructionApiResource {
|
||||
}
|
||||
if (associationParameters.contains("template")) {
|
||||
final StandingInstructionData templateData = this.standingInstructionReadPlatformService.retrieveTemplate(
|
||||
standingInstructionData.fromClient().officeId(), standingInstructionData.fromClient().id(),
|
||||
standingInstructionData.fromAccount().accountId(), standingInstructionData.fromAccountType().getValue(),
|
||||
standingInstructionData.toClient().officeId(), standingInstructionData.toClient().id(),
|
||||
standingInstructionData.toAccount().accountId(), standingInstructionData.toAccountType().getValue(),
|
||||
standingInstructionData.fromClient().getOfficeId(), standingInstructionData.fromClient().getId(),
|
||||
standingInstructionData.fromAccount().getId(), standingInstructionData.fromAccountType().getValue(),
|
||||
standingInstructionData.toClient().getOfficeId(), standingInstructionData.toClient().getId(),
|
||||
standingInstructionData.toAccount().getId(), standingInstructionData.toAccountType().getValue(),
|
||||
standingInstructionData.transferType().getValue());
|
||||
standingInstructionData = StandingInstructionData.withTemplateData(standingInstructionData, templateData);
|
||||
}
|
||||
|
||||
+3
-2
@@ -22,6 +22,7 @@ import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
import org.apache.fineract.organisation.office.data.OfficeData;
|
||||
@@ -30,7 +31,7 @@ import org.apache.fineract.portfolio.client.data.ClientData;
|
||||
/**
|
||||
* Immutable data object representing a savings account.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public final class AccountTransferData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
@@ -69,7 +70,7 @@ public final class AccountTransferData implements Serializable {
|
||||
CurrencyData currency = null;
|
||||
BigDecimal transferAmount = BigDecimal.ZERO;
|
||||
if (fromAccount != null) {
|
||||
currency = fromAccount.currency();
|
||||
currency = fromAccount.getCurrency();
|
||||
if (fromAccount.getAmtForTransfer() != null) {
|
||||
transferAmount = fromAccount.getAmtForTransfer();
|
||||
}
|
||||
|
||||
+8
-62
@@ -20,14 +20,17 @@ package org.apache.fineract.portfolio.account.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
|
||||
/**
|
||||
* Immutable data object representing a savings account.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@RequiredArgsConstructor
|
||||
public class PortfolioAccountData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
@@ -66,64 +69,7 @@ public class PortfolioAccountData implements Serializable {
|
||||
this.amtForTransfer = null;
|
||||
}
|
||||
|
||||
public PortfolioAccountData(final Long id, final String accountNo, final String externalId, final Long groupId, final String groupName,
|
||||
final Long clientId, final String clientName, final Long productId, final String productName, final Long fieldOfficerId,
|
||||
final String fieldOfficerName, final CurrencyData currency, final BigDecimal amtForTransfer) {
|
||||
this.id = id;
|
||||
this.accountNo = accountNo;
|
||||
this.externalId = externalId;
|
||||
this.groupId = groupId;
|
||||
this.groupName = groupName;
|
||||
this.clientId = clientId;
|
||||
this.clientName = clientName;
|
||||
this.productId = productId;
|
||||
this.productName = productName;
|
||||
this.fieldOfficerId = fieldOfficerId;
|
||||
this.fieldOfficerName = fieldOfficerName;
|
||||
this.currency = currency;
|
||||
this.amtForTransfer = amtForTransfer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof PortfolioAccountData)) {
|
||||
return false;
|
||||
}
|
||||
final PortfolioAccountData rhs = (PortfolioAccountData) obj;
|
||||
return new EqualsBuilder().append(this.id, rhs.id).append(this.accountNo, rhs.accountNo).append(this.productId, rhs.productId)
|
||||
.append(this.productName, rhs.productName).isEquals();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder(17, 37).append(this.id).append(this.accountNo).append(this.productId).append(this.productName)
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
public Long clientId() {
|
||||
return this.clientId;
|
||||
}
|
||||
|
||||
public CurrencyData currency() {
|
||||
return this.currency;
|
||||
}
|
||||
|
||||
public String currencyCode() {
|
||||
return this.currency.code();
|
||||
}
|
||||
|
||||
public BigDecimal getAmtForTransfer() {
|
||||
return this.amtForTransfer;
|
||||
}
|
||||
|
||||
public Long accountId() {
|
||||
return this.id;
|
||||
public String getCurrencyCode() {
|
||||
return this.currency.getCode();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -91,7 +91,7 @@ public class ExecuteStandingInstructionsTasklet implements Tasklet {
|
||||
if (data.toAccountType().isLoanAccount()
|
||||
&& (recurrenceType.isDuesRecurrence() || (isDueForTransfer && instructionType.isDuesAmoutTransfer()))) {
|
||||
StandingInstructionDuesData standingInstructionDuesData = standingInstructionReadPlatformService
|
||||
.retriveLoanDuesData(data.toAccount().accountId());
|
||||
.retriveLoanDuesData(data.toAccount().getId());
|
||||
if (data.instructionType().isDuesAmoutTransfer()) {
|
||||
transactionAmount = standingInstructionDuesData.totalDueAmount();
|
||||
}
|
||||
@@ -105,7 +105,7 @@ public class ExecuteStandingInstructionsTasklet implements Tasklet {
|
||||
final boolean isRegularTransaction = true;
|
||||
final boolean isExceptionForBalanceCheck = false;
|
||||
AccountTransferDTO accountTransferDTO = new AccountTransferDTO(transactionDate, transactionAmount, data.fromAccountType(),
|
||||
data.toAccountType(), data.fromAccount().accountId(), data.toAccount().accountId(),
|
||||
data.toAccountType(), data.fromAccount().getId(), data.toAccount().getId(),
|
||||
data.name() + " Standing instruction trasfer ", null, null, null, null, data.toTransferType(), null, null,
|
||||
data.transferType().getValue(), null, null, null, null, null, fromSavingsAccount, isRegularTransaction,
|
||||
isExceptionForBalanceCheck);
|
||||
|
||||
+11
-11
@@ -136,12 +136,12 @@ public class AccountTransfersReadPlatformServiceImpl implements AccountTransfers
|
||||
fromAccount = this.portfolioAccountReadPlatformService.retrieveOne(fromAccountId, accountType);
|
||||
|
||||
// override provided fromClient with client of account
|
||||
mostRelevantFromClientId = fromAccount.clientId();
|
||||
mostRelevantFromClientId = fromAccount.getClientId();
|
||||
}
|
||||
|
||||
if (mostRelevantFromClientId != null) {
|
||||
fromClient = this.clientReadPlatformService.retrieveOne(mostRelevantFromClientId);
|
||||
mostRelevantFromOfficeId = fromClient.officeId();
|
||||
mostRelevantFromOfficeId = fromClient.getOfficeId();
|
||||
long[] loanStatus = null;
|
||||
if (mostRelevantFromAccountType == 1) {
|
||||
loanStatus = new long[] { 300, 700 };
|
||||
@@ -166,13 +166,13 @@ public class AccountTransfersReadPlatformServiceImpl implements AccountTransfers
|
||||
|
||||
if (toAccountId != null && fromAccount != null) {
|
||||
toAccount = this.portfolioAccountReadPlatformService.retrieveOne(toAccountId, mostRelevantToAccountType,
|
||||
fromAccount.currencyCode());
|
||||
mostRelevantToClientId = toAccount.clientId();
|
||||
fromAccount.getCurrencyCode());
|
||||
mostRelevantToClientId = toAccount.getClientId();
|
||||
}
|
||||
|
||||
if (mostRelevantToClientId != null) {
|
||||
toClient = this.clientReadPlatformService.retrieveOne(mostRelevantToClientId);
|
||||
mostRelevantToOfficeId = toClient.officeId();
|
||||
mostRelevantToOfficeId = toClient.getOfficeId();
|
||||
|
||||
toClientOptions = this.clientReadPlatformService.retrieveAllForLookupByOfficeId(mostRelevantToOfficeId);
|
||||
|
||||
@@ -199,7 +199,7 @@ public class AccountTransfersReadPlatformServiceImpl implements AccountTransfers
|
||||
private Collection<PortfolioAccountData> retrieveToAccounts(final PortfolioAccountData excludeThisAccountFromOptions,
|
||||
final Integer toAccountType, final Long toClientId) {
|
||||
|
||||
final String currencyCode = excludeThisAccountFromOptions != null ? excludeThisAccountFromOptions.currencyCode() : null;
|
||||
final String currencyCode = excludeThisAccountFromOptions != null ? excludeThisAccountFromOptions.getCurrencyCode() : null;
|
||||
|
||||
PortfolioAccountDTO portfolioAccountDTO = new PortfolioAccountDTO(toAccountType, toClientId, currencyCode, null, null);
|
||||
Collection<PortfolioAccountData> accountOptions = this.portfolioAccountReadPlatformService
|
||||
@@ -491,12 +491,12 @@ public class AccountTransfersReadPlatformServiceImpl implements AccountTransfers
|
||||
fromAccount = this.portfolioAccountReadPlatformService.retrieveOneByPaidInAdvance(fromAccountId, accountType);
|
||||
|
||||
// override provided fromClient with client of account
|
||||
mostRelevantFromClientId = fromAccount.clientId();
|
||||
mostRelevantFromClientId = fromAccount.getClientId();
|
||||
}
|
||||
|
||||
if (mostRelevantFromClientId != null) {
|
||||
fromClient = this.clientReadPlatformService.retrieveOne(mostRelevantFromClientId);
|
||||
mostRelevantFromOfficeId = fromClient.officeId();
|
||||
mostRelevantFromOfficeId = fromClient.getOfficeId();
|
||||
long[] loanStatus = null;
|
||||
if (mostRelevantFromAccountType == 1) {
|
||||
loanStatus = new long[] { 300, 700 };
|
||||
@@ -521,13 +521,13 @@ public class AccountTransfersReadPlatformServiceImpl implements AccountTransfers
|
||||
|
||||
if (toAccountId != null && fromAccount != null) {
|
||||
toAccount = this.portfolioAccountReadPlatformService.retrieveOne(toAccountId, mostRelevantToAccountType,
|
||||
fromAccount.currencyCode());
|
||||
mostRelevantToClientId = toAccount.clientId();
|
||||
fromAccount.getCurrencyCode());
|
||||
mostRelevantToClientId = toAccount.getClientId();
|
||||
}
|
||||
|
||||
if (mostRelevantToClientId != null) {
|
||||
toClient = this.clientReadPlatformService.retrieveOne(mostRelevantToClientId);
|
||||
mostRelevantToOfficeId = toClient.officeId();
|
||||
mostRelevantToOfficeId = toClient.getOfficeId();
|
||||
|
||||
toClientOptions = this.clientReadPlatformService.retrieveAllForLookupByOfficeId(mostRelevantToOfficeId);
|
||||
|
||||
|
||||
+6
-6
@@ -162,12 +162,12 @@ public class StandingInstructionReadPlatformServiceImpl implements StandingInstr
|
||||
fromAccount = this.portfolioAccountReadPlatformService.retrieveOne(fromAccountId, accountType);
|
||||
|
||||
// override provided fromClient with client of account
|
||||
mostRelevantFromClientId = fromAccount.clientId();
|
||||
mostRelevantFromClientId = fromAccount.getClientId();
|
||||
}
|
||||
|
||||
if (mostRelevantFromClientId != null) {
|
||||
fromClient = this.clientReadPlatformService.retrieveOne(mostRelevantFromClientId);
|
||||
mostRelevantFromOfficeId = fromClient.officeId();
|
||||
mostRelevantFromOfficeId = fromClient.getOfficeId();
|
||||
long[] loanStatus = null;
|
||||
if (mostRelevantFromAccountType == 1) {
|
||||
loanStatus = new long[] { 300, 700 };
|
||||
@@ -192,13 +192,13 @@ public class StandingInstructionReadPlatformServiceImpl implements StandingInstr
|
||||
|
||||
if (toAccountId != null && fromAccount != null) {
|
||||
toAccount = this.portfolioAccountReadPlatformService.retrieveOne(toAccountId, mostRelevantToAccountType,
|
||||
fromAccount.currencyCode());
|
||||
mostRelevantToClientId = toAccount.clientId();
|
||||
fromAccount.getCurrencyCode());
|
||||
mostRelevantToClientId = toAccount.getClientId();
|
||||
}
|
||||
|
||||
if (mostRelevantToClientId != null) {
|
||||
toClient = this.clientReadPlatformService.retrieveOne(mostRelevantToClientId);
|
||||
mostRelevantToOfficeId = toClient.officeId();
|
||||
mostRelevantToOfficeId = toClient.getOfficeId();
|
||||
|
||||
toClientOptions = this.clientReadPlatformService.retrieveAllForLookupByOfficeId(mostRelevantToOfficeId);
|
||||
|
||||
@@ -243,7 +243,7 @@ public class StandingInstructionReadPlatformServiceImpl implements StandingInstr
|
||||
private Collection<PortfolioAccountData> retrieveToAccounts(final PortfolioAccountData excludeThisAccountFromOptions,
|
||||
final Integer toAccountType, final Long toClientId) {
|
||||
|
||||
final String currencyCode = excludeThisAccountFromOptions != null ? excludeThisAccountFromOptions.currencyCode() : null;
|
||||
final String currencyCode = excludeThisAccountFromOptions != null ? excludeThisAccountFromOptions.getCurrencyCode() : null;
|
||||
|
||||
PortfolioAccountDTO portfolioAccountDTO = new PortfolioAccountDTO(toAccountType, toClientId, currencyCode, null, null);
|
||||
Collection<PortfolioAccountData> accountOptions = this.portfolioAccountReadPlatformService
|
||||
|
||||
+4
-21
@@ -19,6 +19,8 @@
|
||||
package org.apache.fineract.portfolio.accountdetails.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanApplicationTimelineData;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanStatusEnumData;
|
||||
@@ -26,7 +28,8 @@ import org.apache.fineract.portfolio.loanaccount.data.LoanStatusEnumData;
|
||||
/**
|
||||
* Immutable data object for loan accounts.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public class LoanAccountSummaryData {
|
||||
|
||||
private final Long id;
|
||||
@@ -66,24 +69,4 @@ public class LoanAccountSummaryData {
|
||||
this.amountPaid = amountPaid;
|
||||
}
|
||||
|
||||
public LoanAccountSummaryData(final Long id, final String accountNo, final String parentAccountNumber, final String externalId,
|
||||
final Long productId, final String loanProductName, final String shortLoanProductName, final LoanStatusEnumData loanStatus,
|
||||
final EnumOptionData loanType, final Integer loanCycle, final LoanApplicationTimelineData timeline, final Boolean inArrears,
|
||||
final BigDecimal originalLoan, final BigDecimal loanBalance, final BigDecimal amountPaid) {
|
||||
this.id = id;
|
||||
this.accountNo = accountNo;
|
||||
this.parentAccountNumber = parentAccountNumber;
|
||||
this.externalId = externalId;
|
||||
this.productId = productId;
|
||||
this.productName = loanProductName;
|
||||
this.shortProductName = shortLoanProductName;
|
||||
this.status = loanStatus;
|
||||
this.loanType = loanType;
|
||||
this.loanCycle = loanCycle;
|
||||
this.timeline = timeline;
|
||||
this.inArrears = inArrears;
|
||||
this.loanBalance = loanBalance;
|
||||
this.originalLoan = originalLoan;
|
||||
this.amountPaid = amountPaid;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-5
@@ -19,11 +19,12 @@
|
||||
package org.apache.fineract.portfolio.accountdetails.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountApplicationTimelineData;
|
||||
import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountStatusEnumData;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public class ShareAccountSummaryData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
@@ -62,8 +63,4 @@ public class ShareAccountSummaryData implements Serializable {
|
||||
this.timeline = timeline;
|
||||
}
|
||||
|
||||
public String getAccountNo() {
|
||||
return this.accountNo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-148
@@ -24,8 +24,8 @@ import java.time.LocalTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.portfolio.calendar.domain.CalendarFrequencyType;
|
||||
import org.apache.fineract.portfolio.calendar.domain.CalendarRemindBy;
|
||||
@@ -38,6 +38,8 @@ import org.apache.fineract.portfolio.common.domain.NthDayType;
|
||||
/**
|
||||
* Immutable data object representing a Calendar.
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
public final class CalendarData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
@@ -375,90 +377,6 @@ public final class CalendarData implements Serializable {
|
||||
this.frequencyNthDayTypeOptions = frequencyNthDayTypeOptions;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getEntityId() {
|
||||
return this.entityId;
|
||||
}
|
||||
|
||||
public EnumOptionData getEntityType() {
|
||||
return this.entityType;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return this.location;
|
||||
}
|
||||
|
||||
public LocalDate getStartDate() {
|
||||
return this.startDate;
|
||||
}
|
||||
|
||||
public LocalDate getEndDate() {
|
||||
return this.endDate;
|
||||
}
|
||||
|
||||
public OffsetDateTime getCreatedDate() {
|
||||
return this.createdDate;
|
||||
}
|
||||
|
||||
public Integer getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
public EnumOptionData getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public boolean isRepeating() {
|
||||
return this.repeating;
|
||||
}
|
||||
|
||||
public String getRecurrence() {
|
||||
return this.recurrence;
|
||||
}
|
||||
|
||||
public EnumOptionData getRemindBy() {
|
||||
return this.remindBy;
|
||||
}
|
||||
|
||||
public Integer getFirstReminder() {
|
||||
return this.firstReminder;
|
||||
}
|
||||
|
||||
public Integer getSecondReminder() {
|
||||
return this.secondReminder;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getEntityTypeOptions() {
|
||||
return this.entityTypeOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getCalendarTypeOptions() {
|
||||
return this.calendarTypeOptions;
|
||||
}
|
||||
|
||||
public List<EnumOptionData> getRemindByOptions() {
|
||||
return this.remindByOptions;
|
||||
}
|
||||
|
||||
public String getHumanReadable() {
|
||||
return this.humanReadable;
|
||||
}
|
||||
|
||||
public Long getCalendarInstanceId() {
|
||||
return this.calendarInstanceId;
|
||||
}
|
||||
|
||||
public boolean isStartDateBeforeOrEqual(final LocalDate compareDate) {
|
||||
if (this.startDate != null && compareDate != null) {
|
||||
if (this.startDate.isBefore(compareDate) || this.startDate.equals(compareDate)) {
|
||||
@@ -493,66 +411,4 @@ public final class CalendarData implements Serializable {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Integer interval() {
|
||||
return this.interval;
|
||||
}
|
||||
|
||||
public EnumOptionData frequencyType() {
|
||||
return this.frequency;
|
||||
}
|
||||
|
||||
public EnumOptionData getRepeatsOnDay() {
|
||||
return this.repeatsOnDay;
|
||||
}
|
||||
|
||||
public EnumOptionData getRepeatsOnNthDayOfMonth() {
|
||||
return this.repeatsOnNthDayOfMonth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof CalendarData)) {
|
||||
return false;
|
||||
}
|
||||
CalendarData that = (CalendarData) o;
|
||||
return (repeating == that.repeating) && Objects.equals(id, that.id) && Objects.equals(calendarInstanceId, that.calendarInstanceId)
|
||||
&& Objects.equals(entityId, that.entityId) && Objects.equals(entityType, that.entityType)
|
||||
&& Objects.equals(title, that.title) && Objects.equals(description, that.description)
|
||||
&& Objects.equals(location, that.location) && Objects.equals(startDate, that.startDate)
|
||||
&& Objects.equals(endDate, that.endDate) && Objects.equals(meetingTime, that.meetingTime)
|
||||
&& Objects.equals(duration, that.duration) && Objects.equals(type, that.type) && Objects.equals(recurrence, that.recurrence)
|
||||
&& Objects.equals(frequency, that.frequency) && Objects.equals(interval, that.interval)
|
||||
&& Objects.equals(repeatsOnDay, that.repeatsOnDay) && Objects.equals(repeatsOnNthDayOfMonth, that.repeatsOnNthDayOfMonth)
|
||||
&& Objects.equals(remindBy, that.remindBy) && Objects.equals(firstReminder, that.firstReminder)
|
||||
&& Objects.equals(secondReminder, that.secondReminder)
|
||||
&& CollectionUtils.isEqualCollection(recurringDates, that.recurringDates)
|
||||
&& CollectionUtils.isEqualCollection(nextTenRecurringDates, that.nextTenRecurringDates)
|
||||
&& Objects.equals(humanReadable, that.humanReadable)
|
||||
&& Objects.equals(recentEligibleMeetingDate, that.recentEligibleMeetingDate)
|
||||
&& Objects.equals(createdDate, that.createdDate) && Objects.equals(lastUpdatedDate, that.lastUpdatedDate)
|
||||
&& Objects.equals(createdByUserId, that.createdByUserId) && Objects.equals(createdByUsername, that.createdByUsername)
|
||||
&& Objects.equals(lastUpdatedByUserId, that.lastUpdatedByUserId)
|
||||
&& Objects.equals(lastUpdatedByUsername, that.lastUpdatedByUsername)
|
||||
&& Objects.equals(repeatsOnDayOfMonth, that.repeatsOnDayOfMonth)
|
||||
&& Objects.equals(entityTypeOptions, that.entityTypeOptions)
|
||||
&& Objects.equals(calendarTypeOptions, that.calendarTypeOptions) && Objects.equals(remindByOptions, that.remindByOptions)
|
||||
&& Objects.equals(frequencyOptions, that.frequencyOptions) && Objects.equals(repeatsOnDayOptions, that.repeatsOnDayOptions)
|
||||
&& Objects.equals(frequencyNthDayTypeOptions, that.frequencyNthDayTypeOptions) && Objects.equals(rowIndex, that.rowIndex)
|
||||
&& Objects.equals(dateFormat, that.dateFormat) && Objects.equals(locale, that.locale)
|
||||
&& Objects.equals(centerId, that.centerId) && Objects.equals(typeId, that.typeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, calendarInstanceId, entityId, entityType, title, description, location, startDate, endDate, meetingTime,
|
||||
duration, type, repeating, recurrence, frequency, interval, repeatsOnDay, repeatsOnNthDayOfMonth, remindBy, firstReminder,
|
||||
secondReminder, recurringDates, nextTenRecurringDates, humanReadable, recentEligibleMeetingDate, createdDate,
|
||||
lastUpdatedDate, createdByUserId, createdByUsername, lastUpdatedByUserId, lastUpdatedByUsername, repeatsOnDayOfMonth,
|
||||
entityTypeOptions, calendarTypeOptions, remindByOptions, frequencyOptions, repeatsOnDayOptions, frequencyNthDayTypeOptions,
|
||||
rowIndex, dateFormat, locale, centerId, typeId);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-26
@@ -25,6 +25,7 @@ import java.time.MonthDay;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
@@ -38,6 +39,7 @@ import org.apache.fineract.portfolio.tax.data.TaxGroupData;
|
||||
/**
|
||||
* Immutable data object for charge data.
|
||||
*/
|
||||
@Getter
|
||||
public final class ChargeData implements Comparable<ChargeData>, Serializable {
|
||||
|
||||
private final Long id;
|
||||
@@ -354,10 +356,6 @@ public final class ChargeData implements Comparable<ChargeData>, Serializable {
|
||||
amountPercentageAppliedTo, chargeOptions, isActive, chargeAmountOrPercentage);
|
||||
}
|
||||
|
||||
public boolean isPenalty() {
|
||||
return this.penalty;
|
||||
}
|
||||
|
||||
public boolean isOverdueInstallmentCharge() {
|
||||
boolean isOverdueInstallmentCharge = false;
|
||||
if (this.chargeTimeType != null) {
|
||||
@@ -366,27 +364,7 @@ public final class ChargeData implements Comparable<ChargeData>, Serializable {
|
||||
return isOverdueInstallmentCharge;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public EnumOptionData getChargeCalculationType() {
|
||||
return chargeCalculationType;
|
||||
}
|
||||
|
||||
public EnumOptionData getChargeTimeType() {
|
||||
return chargeTimeType;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public CurrencyData getCurrency() {
|
||||
return currency;
|
||||
public boolean isIsPaymentType() {
|
||||
return this.isPaymentType;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -159,8 +159,8 @@ public class ClientIdentifiersApiResource {
|
||||
// need to fetch client info
|
||||
final ClientData clientInfo = this.clientReadPlatformService.retrieveClientByIdentifier(e.getDocumentTypeId(),
|
||||
e.getIdentifierKey());
|
||||
rethrowas = new DuplicateClientIdentifierException(clientInfo.displayName(), clientInfo.officeName(), e.getIdentifierType(),
|
||||
e.getIdentifierKey());
|
||||
rethrowas = new DuplicateClientIdentifierException(clientInfo.getDisplayName(), clientInfo.getOfficeName(),
|
||||
e.getIdentifierType(), e.getIdentifierKey());
|
||||
}
|
||||
throw rethrowas;
|
||||
}
|
||||
@@ -216,8 +216,8 @@ public class ClientIdentifiersApiResource {
|
||||
if (e.getDocumentTypeId() != null) {
|
||||
final ClientData clientInfo = this.clientReadPlatformService.retrieveClientByIdentifier(e.getDocumentTypeId(),
|
||||
e.getIdentifierKey());
|
||||
reThrowAs = new DuplicateClientIdentifierException(clientInfo.displayName(), clientInfo.officeName(), e.getIdentifierType(),
|
||||
e.getIdentifierKey());
|
||||
reThrowAs = new DuplicateClientIdentifierException(clientInfo.getDisplayName(), clientInfo.getOfficeName(),
|
||||
e.getIdentifierType(), e.getIdentifierKey());
|
||||
}
|
||||
throw reThrowAs;
|
||||
}
|
||||
|
||||
+1
-1
@@ -190,7 +190,7 @@ public class ClientsApiResource {
|
||||
|
||||
ClientData clientData = this.clientReadPlatformService.retrieveOne(clientId);
|
||||
if (settings.isTemplate()) {
|
||||
final ClientData templateData = this.clientReadPlatformService.retrieveTemplate(clientData.officeId(),
|
||||
final ClientData templateData = this.clientReadPlatformService.retrieveTemplate(clientData.getOfficeId(),
|
||||
staffInSelectedOfficeOnly);
|
||||
clientData = ClientData.templateOnTop(clientData, templateData);
|
||||
Collection<SavingsAccountData> savingAccountOptions = this.savingsAccountReadPlatformService.retrieveForLookup(clientId, null);
|
||||
|
||||
+2
-30
@@ -20,22 +20,18 @@ package org.apache.fineract.portfolio.client.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.portfolio.collateralmanagement.domain.ClientCollateralManagement;
|
||||
|
||||
@Getter
|
||||
public final class ClientCollateralManagementData implements Serializable {
|
||||
|
||||
private final BigDecimal quantity;
|
||||
|
||||
private final Long id;
|
||||
|
||||
private final BigDecimal pctToBase;
|
||||
|
||||
private final BigDecimal unitPrice;
|
||||
|
||||
private final BigDecimal total;
|
||||
|
||||
private final BigDecimal totalCollateral;
|
||||
|
||||
private final String name;
|
||||
|
||||
private ClientCollateralManagementData(final BigDecimal quantity, final Long id, final BigDecimal pctToBase, final BigDecimal unitPrice,
|
||||
@@ -55,28 +51,4 @@ public final class ClientCollateralManagementData implements Serializable {
|
||||
clientCollateralManagements.getCollaterals().getPctToBase(), clientCollateralManagements.getCollaterals().getBasePrice(),
|
||||
total, totalCollateral, clientCollateralManagements.getCollaterals().getName());
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity() {
|
||||
return this.quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getTotal() {
|
||||
return this.total;
|
||||
}
|
||||
|
||||
public BigDecimal getPctToBase() {
|
||||
return this.pctToBase;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalCollateral() {
|
||||
return this.totalCollateral;
|
||||
}
|
||||
|
||||
public BigDecimal getUnitPrice() {
|
||||
return this.unitPrice;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-74
@@ -23,6 +23,7 @@ import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.builder.CompareToBuilder;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
@@ -41,7 +42,7 @@ import org.apache.fineract.portfolio.savings.data.SavingsProductData;
|
||||
/**
|
||||
* Immutable data object representing client data.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public final class ClientData implements Comparable<ClientData>, Serializable {
|
||||
|
||||
private final Long id;
|
||||
@@ -272,22 +273,6 @@ public final class ClientData implements Comparable<ClientData>, Serializable {
|
||||
this.clientCollateralManagements = null;
|
||||
}
|
||||
|
||||
public Integer getRowIndex() {
|
||||
return rowIndex;
|
||||
}
|
||||
|
||||
public Long getSavingsAccountId() {
|
||||
return savingsAccountId;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getOfficeName() {
|
||||
return officeName;
|
||||
}
|
||||
|
||||
public static ClientData template(final Long officeId, final LocalDate joinedDate, final Collection<OfficeData> officeOptions,
|
||||
final Collection<StaffData> staffOptions, final Collection<CodeValueData> narrations,
|
||||
final Collection<CodeValueData> genderOptions, final Collection<SavingsProductData> savingProductOptions,
|
||||
@@ -611,38 +596,6 @@ public final class ClientData implements Comparable<ClientData>, Serializable {
|
||||
this.clientCollateralManagements = clientCollateralManagements;
|
||||
}
|
||||
|
||||
public Long id() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String displayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public String accountNo() {
|
||||
return this.accountNo;
|
||||
}
|
||||
|
||||
public Long officeId() {
|
||||
return this.officeId;
|
||||
}
|
||||
|
||||
public String officeName() {
|
||||
return this.officeName;
|
||||
}
|
||||
|
||||
public Long getImageId() {
|
||||
return this.imageId;
|
||||
}
|
||||
|
||||
public Boolean getImagePresent() {
|
||||
return this.imagePresent;
|
||||
}
|
||||
|
||||
public ClientTimelineData getTimeline() {
|
||||
return this.timeline;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(final ClientData obj) {
|
||||
if (obj == null) {
|
||||
@@ -651,8 +604,6 @@ public final class ClientData implements Comparable<ClientData>, Serializable {
|
||||
return new CompareToBuilder() //
|
||||
.append(this.id, obj.id) //
|
||||
.append(this.displayName, obj.displayName) //
|
||||
.append(this.mobileNo, obj.mobileNo) //
|
||||
.append(this.emailAddress, obj.emailAddress) //
|
||||
.toComparison();
|
||||
}
|
||||
|
||||
@@ -671,8 +622,6 @@ public final class ClientData implements Comparable<ClientData>, Serializable {
|
||||
return new EqualsBuilder() //
|
||||
.append(this.id, rhs.id) //
|
||||
.append(this.displayName, rhs.displayName) //
|
||||
.append(this.mobileNo, rhs.mobileNo) //
|
||||
.append(this.emailAddress, rhs.emailAddress) //
|
||||
.isEquals();
|
||||
}
|
||||
|
||||
@@ -683,25 +632,4 @@ public final class ClientData implements Comparable<ClientData>, Serializable {
|
||||
.append(this.displayName) //
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
public String getExternalId() {
|
||||
return this.externalId;
|
||||
}
|
||||
|
||||
public String getFirstname() {
|
||||
return this.firstname;
|
||||
}
|
||||
|
||||
public String getLastname() {
|
||||
return this.lastname;
|
||||
}
|
||||
|
||||
public LocalDate getActivationDate() {
|
||||
return this.activationDate;
|
||||
}
|
||||
|
||||
public Boolean getIsAddressEnabled() {
|
||||
return this.isAddressEnabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -20,11 +20,13 @@ package org.apache.fineract.portfolio.client.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Immutable data object represent the important time-line events of a loan application and loan.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public class ClientTimelineData implements Serializable {
|
||||
|
||||
private final LocalDate submittedOnDate;
|
||||
|
||||
+4
-26
@@ -20,7 +20,9 @@ package org.apache.fineract.portfolio.floatingrates.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class InterestRatePeriodData {
|
||||
|
||||
private LocalDate fromDate;
|
||||
@@ -41,50 +43,26 @@ public class InterestRatePeriodData {
|
||||
this.blrInterestRate = blrInterestRate;
|
||||
}
|
||||
|
||||
public LocalDate getFromDate() {
|
||||
return this.fromDate;
|
||||
}
|
||||
|
||||
public void setFromDate(LocalDate fromDate) {
|
||||
this.fromDate = fromDate;
|
||||
}
|
||||
|
||||
public BigDecimal getInterestRate() {
|
||||
return this.interestRate;
|
||||
}
|
||||
|
||||
public boolean isDifferentialToBLR() {
|
||||
return this.isDifferentialToBLR;
|
||||
}
|
||||
|
||||
public LocalDate getBlrFromDate() {
|
||||
return this.blrFromDate;
|
||||
}
|
||||
|
||||
public BigDecimal getBlrInterestRate() {
|
||||
return this.blrInterestRate;
|
||||
}
|
||||
|
||||
public BigDecimal getLoanDifferentialInterestRate() {
|
||||
return this.loanDifferentialInterestRate;
|
||||
public boolean isIsDifferentialToBLR() {
|
||||
return this.isDifferentialToBLR;
|
||||
}
|
||||
|
||||
public void setLoanDifferentialInterestRate(BigDecimal loanDifferentialInterestRate) {
|
||||
this.loanDifferentialInterestRate = loanDifferentialInterestRate;
|
||||
}
|
||||
|
||||
public BigDecimal getLoanProductDifferentialInterestRate() {
|
||||
return this.loanProductDifferentialInterestRate;
|
||||
}
|
||||
|
||||
public void setLoanProductDifferentialInterestRate(BigDecimal loanProductDifferentialInterestRate) {
|
||||
this.loanProductDifferentialInterestRate = loanProductDifferentialInterestRate;
|
||||
}
|
||||
|
||||
public BigDecimal getEffectiveInterestRate() {
|
||||
return this.effectiveInterestRate;
|
||||
}
|
||||
|
||||
public void setEffectiveInterestRate(BigDecimal effectiveInterestRate) {
|
||||
this.effectiveInterestRate = effectiveInterestRate;
|
||||
}
|
||||
|
||||
+2
-3
@@ -23,6 +23,7 @@ import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
@@ -35,18 +36,16 @@ import org.apache.fineract.portfolio.client.data.ClientData;
|
||||
/**
|
||||
* Immutable data object representing a general group (so may or may not have a parent).
|
||||
*/
|
||||
@Getter
|
||||
public class GroupGeneralData implements Serializable {
|
||||
|
||||
private final Long id;
|
||||
private final String accountNo;
|
||||
private final String name;
|
||||
private final String externalId;
|
||||
|
||||
private final EnumOptionData status;
|
||||
@SuppressWarnings("unused")
|
||||
private final Boolean active;
|
||||
private final LocalDate activationDate;
|
||||
|
||||
private final Long officeId;
|
||||
private final String officeName;
|
||||
private final Long centerId;
|
||||
|
||||
+6
-30
@@ -19,46 +19,22 @@
|
||||
package org.apache.fineract.portfolio.group.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
|
||||
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@AllArgsConstructor
|
||||
public class GroupRoleData implements Serializable {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final Long id;
|
||||
@SuppressWarnings("unused")
|
||||
private final CodeValueData role;
|
||||
@SuppressWarnings("unused")
|
||||
private final Long clientId;
|
||||
@SuppressWarnings("unused")
|
||||
private final String clientName;
|
||||
|
||||
public static final GroupRoleData template() {
|
||||
return new GroupRoleData(null, null, null, null);
|
||||
}
|
||||
|
||||
public GroupRoleData(final Long id, final CodeValueData role, final Long clientId, final String clientName) {
|
||||
this.id = id;
|
||||
this.role = role;
|
||||
this.clientId = clientId;
|
||||
this.clientName = clientName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof GroupRoleData)) {
|
||||
return false;
|
||||
}
|
||||
GroupRoleData that = (GroupRoleData) o;
|
||||
return Objects.equals(id, that.id) && Objects.equals(role, that.role) && Objects.equals(clientId, that.clientId)
|
||||
&& Objects.equals(clientName, that.clientName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, role, clientId, clientName);
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -378,13 +378,13 @@ public class LoansApiResource {
|
||||
: LoanAccountData.populateGroupDefaults(newLoanAccount, loanAccountGroupData);
|
||||
if (productId != null) {
|
||||
Map<Long, Integer> memberLoanCycle = new HashMap<>();
|
||||
Collection<ClientData> members = loanAccountGroupData.groupData().clientMembers();
|
||||
Collection<ClientData> members = loanAccountGroupData.getGroup().clientMembers();
|
||||
accountLinkingOptions = new ArrayList<>();
|
||||
if (members != null) {
|
||||
for (ClientData clientData : members) {
|
||||
Integer loanCounter = this.loanReadPlatformService.retriveLoanCounter(clientData.id(), productId);
|
||||
memberLoanCycle.put(clientData.id(), loanCounter);
|
||||
accountLinkingOptions.addAll(getaccountLinkingOptions(newLoanAccount, clientData.id(), groupId));
|
||||
Integer loanCounter = this.loanReadPlatformService.retriveLoanCounter(clientData.getId(), productId);
|
||||
memberLoanCycle.put(clientData.getId(), loanCounter);
|
||||
accountLinkingOptions.addAll(getaccountLinkingOptions(newLoanAccount, clientData.getId(), groupId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,10 +417,10 @@ public class LoansApiResource {
|
||||
|
||||
private Collection<PortfolioAccountData> getaccountLinkingOptions(final LoanAccountData newLoanAccount, final Long clientId,
|
||||
final Long groupId) {
|
||||
final CurrencyData currencyData = newLoanAccount.currency();
|
||||
final CurrencyData currencyData = newLoanAccount.getCurrency();
|
||||
String currencyCode = null;
|
||||
if (currencyData != null) {
|
||||
currencyCode = currencyData.code();
|
||||
currencyCode = currencyData.getCode();
|
||||
}
|
||||
final long[] accountStatus = { SavingsAccountStatusType.ACTIVE.getValue() };
|
||||
final PortfolioAccountDTO portfolioAccountDTO = new PortfolioAccountDTO(PortfolioAccountType.SAVINGS.getValue(), clientId,
|
||||
@@ -630,7 +630,7 @@ public class LoansApiResource {
|
||||
final boolean template = ApiParameterHelper.template(uriInfo.getQueryParameters());
|
||||
if (template) {
|
||||
productOptions = this.loanProductReadPlatformService.retrieveAllLoanProductsForLookup();
|
||||
product = this.loanProductReadPlatformService.retrieveLoanProduct(loanBasicDetails.loanProductId());
|
||||
product = this.loanProductReadPlatformService.retrieveLoanProduct(loanBasicDetails.getLoanProductId());
|
||||
loanBasicDetails.setProduct(product);
|
||||
loanTermFrequencyTypeOptions = this.dropdownReadPlatformService.retrieveLoanTermFrequencyTypeOptions();
|
||||
repaymentFrequencyTypeOptions = this.dropdownReadPlatformService.retrieveRepaymentFrequencyTypeOptions();
|
||||
@@ -662,14 +662,14 @@ public class LoansApiResource {
|
||||
|
||||
loanPurposeOptions = this.codeValueReadPlatformService.retrieveCodeValuesByCode("LoanPurpose");
|
||||
loanCollateralOptions = this.codeValueReadPlatformService.retrieveCodeValuesByCode("LoanCollateral");
|
||||
final CurrencyData currencyData = loanBasicDetails.currency();
|
||||
final CurrencyData currencyData = loanBasicDetails.getCurrency();
|
||||
String currencyCode = null;
|
||||
if (currencyData != null) {
|
||||
currencyCode = currencyData.code();
|
||||
currencyCode = currencyData.getCode();
|
||||
}
|
||||
final long[] accountStatus = { SavingsAccountStatusType.ACTIVE.getValue() };
|
||||
PortfolioAccountDTO portfolioAccountDTO = new PortfolioAccountDTO(PortfolioAccountType.SAVINGS.getValue(),
|
||||
loanBasicDetails.clientId(), currencyCode, accountStatus, DepositAccountType.SAVINGS_DEPOSIT.getValue());
|
||||
loanBasicDetails.getClientId(), currencyCode, accountStatus, DepositAccountType.SAVINGS_DEPOSIT.getValue());
|
||||
accountLinkingOptions = this.portfolioAccountReadPlatformService.retrieveAllForLookup(portfolioAccountDTO);
|
||||
|
||||
if (!associationParameters.contains(DataTableApiConstant.linkedAccountAssociateParamName)) {
|
||||
@@ -680,15 +680,15 @@ public class LoansApiResource {
|
||||
calendarOptions = this.loanReadPlatformService.retrieveCalendars(loanBasicDetails.groupId());
|
||||
}
|
||||
|
||||
if (loanBasicDetails.product().canUseForTopup() && loanBasicDetails.clientId() != null) {
|
||||
if (loanBasicDetails.getProduct().isCanUseForTopup() && loanBasicDetails.getClientId() != null) {
|
||||
clientActiveLoanOptions = this.accountDetailsReadPlatformService
|
||||
.retrieveClientActiveLoanAccountSummary(loanBasicDetails.clientId());
|
||||
.retrieveClientActiveLoanAccountSummary(loanBasicDetails.getClientId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Collection<ChargeData> overdueCharges = this.chargeReadPlatformService.retrieveLoanProductCharges(loanBasicDetails.loanProductId(),
|
||||
ChargeTimeType.OVERDUE_INSTALLMENT);
|
||||
Collection<ChargeData> overdueCharges = this.chargeReadPlatformService
|
||||
.retrieveLoanProductCharges(loanBasicDetails.getLoanProductId(), ChargeTimeType.OVERDUE_INSTALLMENT);
|
||||
|
||||
paidInAdvanceTemplate = this.loanReadPlatformService.retrieveTotalPaidInAdvance(loanId);
|
||||
|
||||
|
||||
+5
-28
@@ -20,19 +20,21 @@ package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Immutable data object representing disbursement information.
|
||||
*/
|
||||
public class DisbursementData implements Comparable<DisbursementData> {
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public final class DisbursementData implements Comparable<DisbursementData> {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final Long id;
|
||||
private final LocalDate expectedDisbursementDate;
|
||||
private final LocalDate actualDisbursementDate;
|
||||
private final BigDecimal principal;
|
||||
private final BigDecimal netDisbursalAmount;
|
||||
@SuppressWarnings("unused")
|
||||
private final String loanChargeId;
|
||||
private final BigDecimal chargeAmount;
|
||||
private final BigDecimal waivedChargeAmount;
|
||||
@@ -66,23 +68,6 @@ public class DisbursementData implements Comparable<DisbursementData> {
|
||||
|
||||
}
|
||||
|
||||
public String getLinkAccountId() {
|
||||
return linkAccountId;
|
||||
}
|
||||
|
||||
public DisbursementData(Long id, final LocalDate expectedDisbursementDate, final LocalDate actualDisbursementDate,
|
||||
final BigDecimal principalDisbursed, final BigDecimal netDisbursalAmount, final String loanChargeId, BigDecimal chargeAmount,
|
||||
BigDecimal waivedChargeAmount) {
|
||||
this.id = id;
|
||||
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||
this.actualDisbursementDate = actualDisbursementDate;
|
||||
this.principal = principalDisbursed;
|
||||
this.loanChargeId = loanChargeId;
|
||||
this.chargeAmount = chargeAmount;
|
||||
this.waivedChargeAmount = waivedChargeAmount;
|
||||
this.netDisbursalAmount = netDisbursalAmount;
|
||||
}
|
||||
|
||||
public LocalDate disbursementDate() {
|
||||
LocalDate disbursementDate = this.expectedDisbursementDate;
|
||||
if (this.actualDisbursementDate != null) {
|
||||
@@ -91,14 +76,6 @@ public class DisbursementData implements Comparable<DisbursementData> {
|
||||
return disbursementDate;
|
||||
}
|
||||
|
||||
public BigDecimal amount() {
|
||||
return this.principal;
|
||||
}
|
||||
|
||||
public BigDecimal getChargeAmount() {
|
||||
return this.chargeAmount;
|
||||
}
|
||||
|
||||
public boolean isDisbursed() {
|
||||
return this.actualDisbursementDate != null;
|
||||
}
|
||||
|
||||
+59
-111
@@ -28,6 +28,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import javax.persistence.Transient;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.infrastructure.dataqueries.data.DatatableData;
|
||||
@@ -57,7 +58,7 @@ import org.springframework.util.CollectionUtils;
|
||||
/**
|
||||
* Immutable data object representing loan account data.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public final class LoanAccountData {
|
||||
|
||||
// basic loan details
|
||||
@@ -113,7 +114,7 @@ public final class LoanAccountData {
|
||||
private final EnumOptionData amortizationType;
|
||||
private final EnumOptionData interestType;
|
||||
private final EnumOptionData interestCalculationPeriodType;
|
||||
private final Boolean allowPartialPeriodInterestCalcualtion;
|
||||
private final Boolean allowPartialPeriodInterestCalculation;
|
||||
private final BigDecimal inArrearsTolerance;
|
||||
private final Long transactionProcessingStrategyId;
|
||||
private final String transactionProcessingStrategyName;
|
||||
@@ -355,7 +356,7 @@ public final class LoanAccountData {
|
||||
this.isFloatingInterestRate = false;
|
||||
this.interestRateDifferential = null;
|
||||
|
||||
this.allowPartialPeriodInterestCalcualtion = null;
|
||||
this.allowPartialPeriodInterestCalculation = null;
|
||||
|
||||
this.transactionProcessingStrategyName = null;
|
||||
|
||||
@@ -431,34 +432,6 @@ public final class LoanAccountData {
|
||||
this.delinquencyRange = null;
|
||||
}
|
||||
|
||||
public Integer getRowIndex() {
|
||||
return rowIndex;
|
||||
}
|
||||
|
||||
public Long getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public String getClientName() {
|
||||
return clientName;
|
||||
}
|
||||
|
||||
public BigDecimal getPrincipal() {
|
||||
return principal;
|
||||
}
|
||||
|
||||
public LoanApplicationTimelineData getTimeline() {
|
||||
return timeline;
|
||||
}
|
||||
|
||||
public String getAccountNo() {
|
||||
return accountNo;
|
||||
}
|
||||
|
||||
public String getLoanProductName() {
|
||||
return loanProductName;
|
||||
}
|
||||
|
||||
public static final Comparator<LoanAccountData> ClientNameComparator = new Comparator<LoanAccountData>() {
|
||||
|
||||
@Override
|
||||
@@ -469,10 +442,6 @@ public final class LoanAccountData {
|
||||
}
|
||||
};
|
||||
|
||||
public String getClientAccountNo() {
|
||||
return clientAccountNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to produce a {@link LoanAccountData} with only collateral options for now.
|
||||
*/
|
||||
@@ -778,7 +747,7 @@ public final class LoanAccountData {
|
||||
acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType, acc.transactionProcessingStrategyId,
|
||||
acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod, acc.interestRateFrequencyType,
|
||||
acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate, acc.interestRateDifferential,
|
||||
acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalcualtion, acc.expectedFirstRepaymentOnDate,
|
||||
acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation, acc.expectedFirstRepaymentOnDate,
|
||||
acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods, acc.graceOnInterestPayment,
|
||||
acc.graceOnInterestCharged, acc.interestChargedFromDate, clientAcc.timeline, acc.summary,
|
||||
acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
|
||||
@@ -957,7 +926,7 @@ public final class LoanAccountData {
|
||||
acc.repaymentEvery, acc.repaymentFrequencyType, acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType,
|
||||
acc.transactionProcessingStrategyId, acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod,
|
||||
acc.interestRateFrequencyType, acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalcualtion,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation,
|
||||
acc.expectedFirstRepaymentOnDate, acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods,
|
||||
acc.graceOnInterestPayment, acc.graceOnInterestCharged, acc.interestChargedFromDate, groupAcc.timeline, acc.summary,
|
||||
acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
|
||||
@@ -1060,7 +1029,7 @@ public final class LoanAccountData {
|
||||
|
||||
BigDecimal interestRatePerPeriod = null;
|
||||
Integer numberOfRepayments = null;
|
||||
if (product.useBorrowerCycle() && loanCycleNumber > 0) {
|
||||
if (product.isUseBorrowerCycle() && loanCycleNumber > 0) {
|
||||
Collection<LoanProductBorrowerCycleVariationData> principalVariationsForBorrowerCycle = product
|
||||
.getPrincipalVariationsForBorrowerCycle();
|
||||
Collection<LoanProductBorrowerCycleVariationData> interestForVariationsForBorrowerCycle = product
|
||||
@@ -1108,7 +1077,7 @@ public final class LoanAccountData {
|
||||
final Boolean isVariableInstallmentsAllowed = Boolean.FALSE;
|
||||
final Integer minimumGap = null;
|
||||
final Integer maximumGap = null;
|
||||
final Boolean canUseForTopup = product.canUseForTopup();
|
||||
final Boolean canUseForTopup = product.isCanUseForTopup();
|
||||
final boolean isTopup = false;
|
||||
final Long closureLoanId = null;
|
||||
final String closureLoanAccountNo = null;
|
||||
@@ -1127,8 +1096,8 @@ public final class LoanAccountData {
|
||||
transactionProcessingStrategyName, product.getAmortizationType(), interestRatePerPeriod,
|
||||
product.getInterestRateFrequencyType(), product.getAnnualInterestRate(), product.getInterestType(),
|
||||
product.isFloatingInterestRateCalculationAllowed(), product.getDefaultDifferentialLendingRate(),
|
||||
product.getInterestCalculationPeriodType(), product.getAllowPartialPeriodInterestCalcualtion(),
|
||||
expectedFirstRepaymentOnDate, product.getGraceOnPrincipalPayment(), product.getRecurringMoratoriumOnPrincipalPeriods(),
|
||||
product.getInterestCalculationPeriodType(), product.isAllowPartialPeriodInterestCalculation(), expectedFirstRepaymentOnDate,
|
||||
product.getGraceOnPrincipalPayment(), product.getRecurringMoratoriumOnPrincipalPeriods(),
|
||||
product.getGraceOnInterestPayment(), product.getGraceOnInterestCharged(), interestChargedFromDate, timeline, summary,
|
||||
feeChargesDueAtDisbursementCharged, repaymentSchedule, transactions, charges, collateral, guarantors, calendarData,
|
||||
productOptions, termFrequencyTypeOptions, repaymentFrequencyTypeOptions, repaymentFrequencyNthDayTypeOptions,
|
||||
@@ -1136,14 +1105,14 @@ public final class LoanAccountData {
|
||||
interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions,
|
||||
loanPurposeOptions, loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter,
|
||||
notes, accountLinkingOptions, linkedAccount, disbursementData, product.getMultiDisburseLoan(),
|
||||
product.canDefineInstallmentAmount(), fixedEmi, product.getOutstandingLoanBalance(), emiAmountVariations, memberVariations,
|
||||
product, inArrears, product.getGraceOnArrearsAgeing(), product.overdueFeeCharges(), isNPA, product.getDaysInMonthType(),
|
||||
product.getDaysInYearType(), product.isInterestRecalculationEnabled(), product.toLoanInterestRecalculationData(),
|
||||
originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance, interestRatesPeriods,
|
||||
product.isVariableInstallmentsAllowed(), product.getMinimumGapBetweenInstallments(),
|
||||
product.getMaximumGapBetweenInstallments(), subStatus, canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId,
|
||||
closureLoanAccountNo, topupAmount, product.isEqualAmortization(), rates, isRatesEnabled,
|
||||
product.getFixedPrincipalPercentagePerInstallment(), delinquent, delinquencyRange);
|
||||
product.isCanDefineInstallmentAmount(), fixedEmi, product.getOutstandingLoanBalance(), emiAmountVariations,
|
||||
memberVariations, product, inArrears, product.getGraceOnArrearsAgeing(), product.overdueFeeCharges(), isNPA,
|
||||
product.getDaysInMonthType(), product.getDaysInYearType(), product.isInterestRecalculationEnabled(),
|
||||
product.toLoanInterestRecalculationData(), originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance,
|
||||
interestRatesPeriods, product.isAllowVariableInstallments(), product.getMinimumGap(), product.getMaximumGap(), subStatus,
|
||||
canUseForTopup, clientActiveLoanOptions, isTopup, closureLoanId, closureLoanAccountNo, topupAmount,
|
||||
product.isEqualAmortization(), rates, isRatesEnabled, product.getFixedPrincipalPercentagePerInstallment(), delinquent,
|
||||
delinquencyRange);
|
||||
}
|
||||
|
||||
public static LoanAccountData populateLoanProductDefaults(final LoanAccountData acc, final LoanProductData product) {
|
||||
@@ -1198,7 +1167,7 @@ public final class LoanAccountData {
|
||||
product.getTransactionProcessingStrategyName(), product.getAmortizationType(), product.getInterestRatePerPeriod(),
|
||||
product.getInterestRateFrequencyType(), product.getAnnualInterestRate(), product.getInterestType(),
|
||||
product.isFloatingInterestRateCalculationAllowed(), product.getDefaultDifferentialLendingRate(),
|
||||
product.getInterestCalculationPeriodType(), product.getAllowPartialPeriodInterestCalcualtion(),
|
||||
product.getInterestCalculationPeriodType(), product.isAllowPartialPeriodInterestCalculation(),
|
||||
acc.expectedFirstRepaymentOnDate, product.getGraceOnPrincipalPayment(), product.getRecurringMoratoriumOnPrincipalPeriods(),
|
||||
product.getGraceOnInterestPayment(), product.getGraceOnInterestCharged(), acc.interestChargedFromDate, acc.timeline,
|
||||
acc.summary, acc.feeChargesAtDisbursementCharged, repaymentSchedule, transactions, charges, collateral, guarantors,
|
||||
@@ -1206,15 +1175,15 @@ public final class LoanAccountData {
|
||||
interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions,
|
||||
fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions,
|
||||
acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, notes, acc.accountLinkingOptions,
|
||||
acc.linkedAccount, acc.disbursementDetails, product.getMultiDisburseLoan(), product.canDefineInstallmentAmount(),
|
||||
acc.linkedAccount, acc.disbursementDetails, product.getMultiDisburseLoan(), product.isCanDefineInstallmentAmount(),
|
||||
acc.fixedEmiAmount, product.getOutstandingLoanBalance(), acc.emiAmountVariations, acc.memberVariations, product,
|
||||
acc.inArrears, product.getGraceOnArrearsAgeing(), product.overdueFeeCharges(), acc.isNPA, product.getDaysInMonthType(),
|
||||
product.getDaysInYearType(), product.isInterestRecalculationEnabled(), product.toLoanInterestRecalculationData(),
|
||||
acc.originalSchedule, acc.createStandingInstructionAtDisbursement, paidInAdvance, acc.interestRatesPeriods,
|
||||
product.isVariableInstallmentsAllowed(), product.getMinimumGapBetweenInstallments(),
|
||||
product.getMaximumGapBetweenInstallments(), acc.subStatus, acc.canUseForTopup, acc.clientActiveLoanOptions, acc.isTopup,
|
||||
acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount, product.isEqualAmortization(), acc.rates, acc.isRatesEnabled,
|
||||
product.getFixedPrincipalPercentagePerInstallment(), delinquent, delinquencyRange);
|
||||
product.isAllowVariableInstallments(), product.getMinimumGap(), product.getMaximumGap(), acc.subStatus, acc.canUseForTopup,
|
||||
acc.clientActiveLoanOptions, acc.isTopup, acc.closureLoanId, acc.closureLoanAccountNo, acc.topupAmount,
|
||||
product.isEqualAmortization(), acc.rates, acc.isRatesEnabled, product.getFixedPrincipalPercentagePerInstallment(),
|
||||
delinquent, delinquencyRange);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1333,7 +1302,7 @@ public final class LoanAccountData {
|
||||
final CollectionData delinquent) {
|
||||
LoanProductConfigurableAttributes loanProductConfigurableAttributes = null;
|
||||
if (acc.product != null) {
|
||||
loanProductConfigurableAttributes = acc.product.getLoanProductConfigurableAttributes();
|
||||
loanProductConfigurableAttributes = acc.product.getAllowAttributeOverrides();
|
||||
}
|
||||
|
||||
return new LoanAccountData(acc.id, acc.accountNo, acc.status, acc.externalId, acc.clientId, acc.clientAccountNo, acc.clientName,
|
||||
@@ -1344,7 +1313,7 @@ public final class LoanAccountData {
|
||||
acc.repaymentEvery, acc.repaymentFrequencyType, acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType,
|
||||
acc.transactionProcessingStrategyId, acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod,
|
||||
acc.interestRateFrequencyType, acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalcualtion,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation,
|
||||
acc.expectedFirstRepaymentOnDate, acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods,
|
||||
acc.graceOnInterestPayment, acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary,
|
||||
acc.feeChargesAtDisbursementCharged, repaymentSchedule, transactions, charges, collateral, guarantors, calendarData,
|
||||
@@ -1386,7 +1355,7 @@ public final class LoanAccountData {
|
||||
acc.repaymentEvery, acc.repaymentFrequencyType, acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType,
|
||||
acc.transactionProcessingStrategyId, acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod,
|
||||
acc.interestRateFrequencyType, acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalcualtion,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation,
|
||||
acc.expectedFirstRepaymentOnDate, acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods,
|
||||
acc.graceOnInterestPayment, acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary,
|
||||
acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
|
||||
@@ -1415,7 +1384,7 @@ public final class LoanAccountData {
|
||||
Integer numberOfRepayments = null;
|
||||
Long clientId = mapEntry.getKey();
|
||||
Integer loanCycleNumber = mapEntry.getValue();
|
||||
if (acc.product.useBorrowerCycle() && loanCycleNumber != null && loanCycleNumber > 0) {
|
||||
if (acc.product.isUseBorrowerCycle() && loanCycleNumber != null && loanCycleNumber > 0) {
|
||||
Collection<LoanProductBorrowerCycleVariationData> principalVariationsForBorrowerCycle = acc.product
|
||||
.getPrincipalVariationsForBorrowerCycle();
|
||||
Collection<LoanProductBorrowerCycleVariationData> interestForVariationsForBorrowerCycle = acc.product
|
||||
@@ -1452,7 +1421,7 @@ public final class LoanAccountData {
|
||||
acc.repaymentEvery, acc.repaymentFrequencyType, acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType,
|
||||
acc.transactionProcessingStrategyId, acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod,
|
||||
acc.interestRateFrequencyType, acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalcualtion,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation,
|
||||
acc.expectedFirstRepaymentOnDate, acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods,
|
||||
acc.graceOnInterestPayment, acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary,
|
||||
acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
|
||||
@@ -1486,7 +1455,7 @@ public final class LoanAccountData {
|
||||
acc.repaymentEvery, acc.repaymentFrequencyType, acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType,
|
||||
acc.transactionProcessingStrategyId, acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod,
|
||||
acc.interestRateFrequencyType, acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalcualtion,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation,
|
||||
acc.expectedFirstRepaymentOnDate, acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods,
|
||||
acc.graceOnInterestPayment, acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary,
|
||||
acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
|
||||
@@ -1515,7 +1484,7 @@ public final class LoanAccountData {
|
||||
acc.repaymentEvery, acc.repaymentFrequencyType, calendarData.getRepeatsOnNthDayOfMonth(), calendarData.getRepeatsOnDay(),
|
||||
acc.transactionProcessingStrategyId, acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod,
|
||||
acc.interestRateFrequencyType, acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalcualtion,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation,
|
||||
acc.expectedFirstRepaymentOnDate, acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods,
|
||||
acc.graceOnInterestPayment, acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary,
|
||||
acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
|
||||
@@ -1545,7 +1514,7 @@ public final class LoanAccountData {
|
||||
acc.repaymentEvery, acc.repaymentFrequencyType, acc.repaymentFrequencyNthDayType, acc.repaymentFrequencyDayOfWeekType,
|
||||
acc.transactionProcessingStrategyId, acc.transactionProcessingStrategyName, acc.amortizationType, acc.interestRatePerPeriod,
|
||||
acc.interestRateFrequencyType, acc.annualInterestRate, acc.interestType, acc.isFloatingInterestRate,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalcualtion,
|
||||
acc.interestRateDifferential, acc.interestCalculationPeriodType, acc.allowPartialPeriodInterestCalculation,
|
||||
acc.expectedFirstRepaymentOnDate, acc.graceOnPrincipalPayment, acc.recurringMoratoriumOnPrincipalPeriods,
|
||||
acc.graceOnInterestPayment, acc.graceOnInterestCharged, acc.interestChargedFromDate, acc.timeline, acc.summary,
|
||||
acc.feeChargesAtDisbursementCharged, acc.repaymentSchedule, acc.transactions, acc.charges, acc.collateral, acc.guarantors,
|
||||
@@ -1585,7 +1554,7 @@ public final class LoanAccountData {
|
||||
final EnumOptionData amortizationType, final BigDecimal interestRatePerPeriod, final EnumOptionData interestRateFrequencyType,
|
||||
final BigDecimal annualInterestRate, final EnumOptionData interestType, final boolean isFloatingInterestRate,
|
||||
final BigDecimal interestRateDifferential, final EnumOptionData interestCalculationPeriodType,
|
||||
final Boolean allowPartialPeriodInterestCalcualtion, final LocalDate expectedFirstRepaymentOnDate,
|
||||
final Boolean allowPartialPeriodInterestCalculation, final LocalDate expectedFirstRepaymentOnDate,
|
||||
final Integer graceOnPrincipalPayment, final Integer recurringMoratoriumOnPrincipalPeriods,
|
||||
final Integer graceOnInterestPayment, final Integer graceOnInterestCharged, final LocalDate interestChargedFromDate,
|
||||
final LoanApplicationTimelineData timeline, final LoanSummaryData summary, final BigDecimal feeChargesDueAtDisbursementCharged,
|
||||
@@ -1663,7 +1632,7 @@ public final class LoanAccountData {
|
||||
this.isFloatingInterestRate = isFloatingInterestRate;
|
||||
this.interestRateDifferential = interestRateDifferential;
|
||||
this.interestCalculationPeriodType = interestCalculationPeriodType;
|
||||
this.allowPartialPeriodInterestCalcualtion = allowPartialPeriodInterestCalcualtion;
|
||||
this.allowPartialPeriodInterestCalculation = allowPartialPeriodInterestCalculation;
|
||||
this.expectedFirstRepaymentOnDate = expectedFirstRepaymentOnDate;
|
||||
this.graceOnPrincipalPayment = graceOnPrincipalPayment;
|
||||
this.recurringMoratoriumOnPrincipalPeriods = recurringMoratoriumOnPrincipalPeriods;
|
||||
@@ -1759,7 +1728,7 @@ public final class LoanAccountData {
|
||||
this.fixedEmiAmount = fixedEmiAmount;
|
||||
this.maxOutstandingLoanBalance = maxOutstandingLoanBalance;
|
||||
|
||||
if (this.status != null && LoanStatus.fromInt(this.status.id().intValue()).isApproved()) {
|
||||
if (this.status != null && LoanStatus.fromInt(this.status.getId().intValue()).isApproved()) {
|
||||
this.canDisburse = true;
|
||||
} else {
|
||||
boolean canDisburse = false;
|
||||
@@ -1788,7 +1757,7 @@ public final class LoanAccountData {
|
||||
this.createStandingInstructionAtDisbursement = createStandingInstructionAtDisbursement;
|
||||
this.paidInAdvance = paidInAdvance;
|
||||
if (this.product != null) {
|
||||
this.product.setLoanProductConfigurableAttributes(product.getLoanProductConfigurableAttributes());
|
||||
this.product.setLoanProductConfigurableAttributes(product.getAllowAttributeOverrides());
|
||||
}
|
||||
this.interestRatesPeriods = interestRatesPeriods;
|
||||
this.isVariableInstallmentsAllowed = isVariableInstallmentsAllowed;
|
||||
@@ -1820,14 +1789,6 @@ public final class LoanAccountData {
|
||||
return officeId;
|
||||
}
|
||||
|
||||
public Long loanOfficerId() {
|
||||
return this.loanOfficerId;
|
||||
}
|
||||
|
||||
public Collection<LoanChargeData> charges() {
|
||||
return this.charges;
|
||||
}
|
||||
|
||||
public Long groupOfficeId() {
|
||||
return this.group == null ? null : this.group.officeId();
|
||||
}
|
||||
@@ -1836,14 +1797,6 @@ public final class LoanAccountData {
|
||||
return this.group == null ? null : this.group.getId();
|
||||
}
|
||||
|
||||
public CurrencyData currency() {
|
||||
return this.currency;
|
||||
}
|
||||
|
||||
public Long clientId() {
|
||||
return this.clientId;
|
||||
}
|
||||
|
||||
private static BigDecimal fetchLoanCycleDefaultValue(Collection<LoanProductBorrowerCycleVariationData> borrowerCycleVariationData,
|
||||
Integer loanCycleNumber) {
|
||||
BigDecimal defaultValue = null;
|
||||
@@ -1862,31 +1815,19 @@ public final class LoanAccountData {
|
||||
private static boolean isLoanCycleValuesWhenConditionGreterthan(Integer loanCycleNumber, Integer cycleNumberSelected,
|
||||
LoanProductBorrowerCycleVariationData data) {
|
||||
return data.getBorrowerCycleNumber() < loanCycleNumber
|
||||
&& data.getValueConditionType().equals(LoanProductValueConditionType.GREATERTHAN)
|
||||
&& data.getLoanProductValueConditionType().equals(LoanProductValueConditionType.GREATERTHAN)
|
||||
&& cycleNumberSelected < data.getBorrowerCycleNumber();
|
||||
}
|
||||
|
||||
private static boolean isLoanCycleValuesWhenConditionEqual(Integer loanCycleNumber, LoanProductBorrowerCycleVariationData data) {
|
||||
return data.getBorrowerCycleNumber().equals(loanCycleNumber)
|
||||
&& data.getValueConditionType().equals(LoanProductValueConditionType.EQUAL);
|
||||
}
|
||||
|
||||
public LoanProductData product() {
|
||||
return this.product;
|
||||
&& data.getLoanProductValueConditionType().equals(LoanProductValueConditionType.EQUAL);
|
||||
}
|
||||
|
||||
public void setProduct(LoanProductData product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public GroupGeneralData groupData() {
|
||||
return this.group;
|
||||
}
|
||||
|
||||
public Long loanProductId() {
|
||||
return this.loanProductId;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalOutstandingAmount() {
|
||||
if (this.summary != null) {
|
||||
return this.summary.getTotalOutstanding();
|
||||
@@ -1895,28 +1836,28 @@ public final class LoanAccountData {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isIsInterestRecalculationEnabled() {
|
||||
return this.isInterestRecalculationEnabled;
|
||||
}
|
||||
|
||||
public boolean isInterestRecalculationEnabled() {
|
||||
return this.isInterestRecalculationEnabled;
|
||||
}
|
||||
|
||||
public Long getInterestRecalculationDetailId() {
|
||||
if (isInterestRecalculationEnabled()) {
|
||||
if (isInterestRecalculationEnabled) {
|
||||
return this.interestRecalculationData.getId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return LoanStatus.fromInt(this.status.id().intValue()).isActive();
|
||||
}
|
||||
|
||||
public boolean isMultiDisburseLoan() {
|
||||
return multiDisburseLoan;
|
||||
return LoanStatus.fromInt(this.status.getId().intValue()).isActive();
|
||||
}
|
||||
|
||||
public BigDecimal getTotalPaidFeeCharges() {
|
||||
if (this.summary != null) {
|
||||
return this.summary.getTotalPaidFeeCharges();
|
||||
return this.summary.getFeeChargesPaid();
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
@@ -1936,6 +1877,10 @@ public final class LoanAccountData {
|
||||
return LoanAccountData.collateralTemplate(loanCollateralOptions);
|
||||
}
|
||||
|
||||
public boolean isIsLoanProductLinkedToFloatingRate() {
|
||||
return this.isLoanProductLinkedToFloatingRate;
|
||||
}
|
||||
|
||||
public boolean isLoanProductLinkedToFloatingRate() {
|
||||
return this.isLoanProductLinkedToFloatingRate;
|
||||
}
|
||||
@@ -1948,12 +1893,8 @@ public final class LoanAccountData {
|
||||
return this.isFloatingInterestRate;
|
||||
}
|
||||
|
||||
public BigDecimal getInterestRateDifferential() {
|
||||
return this.interestRateDifferential;
|
||||
}
|
||||
|
||||
public BigDecimal getNetDisbursalAmount() {
|
||||
return netDisbursalAmount;
|
||||
public boolean isIsFloatingInterestRate() {
|
||||
return this.isFloatingInterestRate;
|
||||
}
|
||||
|
||||
public void setDatatables(final List<DatatableData> datatables) {
|
||||
@@ -1961,7 +1902,14 @@ public final class LoanAccountData {
|
||||
}
|
||||
|
||||
public String getStatusStringValue() {
|
||||
return this.status.value();
|
||||
return this.status.getValue();
|
||||
}
|
||||
|
||||
public boolean isTopup() {
|
||||
return isTopup;
|
||||
}
|
||||
|
||||
public boolean isIsTopup() {
|
||||
return isTopup;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-43
@@ -20,12 +20,15 @@ package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
|
||||
/**
|
||||
* Immutable data object represent the important time-line events of a loan application and loan.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public class LoanApplicationTimelineData {
|
||||
|
||||
private final LocalDate submittedOnDate;
|
||||
@@ -99,48 +102,6 @@ public class LoanApplicationTimelineData {
|
||||
writeOffByUsername, writeOffByFirstname, writeOffByLastname);
|
||||
}
|
||||
|
||||
public LoanApplicationTimelineData(final LocalDate submittedOnDate, final String submittedByUsername, final String submittedByFirstname,
|
||||
final String submittedByLastname, final LocalDate rejectedOnDate, final String rejectedByUsername,
|
||||
final String rejectedByFirstname, final String rejectedByLastname, final LocalDate withdrawnOnDate,
|
||||
final String withdrawnByUsername, final String withdrawnByFirstname, final String withdrawnByLastname,
|
||||
final LocalDate approvedOnDate, final String approvedByUsername, final String approvedByFirstname,
|
||||
final String approvedByLastname, final LocalDate expectedDisbursementDate, final LocalDate actualDisbursementDate,
|
||||
final String disbursedByUsername, final String disbursedByFirstname, final String disbursedByLastname,
|
||||
final LocalDate closedOnDate, final String closedByUsername, final String closedByFirstname, final String closedByLastname,
|
||||
final LocalDate expectedMaturityDate, final LocalDate writeOffOnDate, final String writeOffByUsername,
|
||||
final String writeOffByFirstname, final String writeOffByLastname) {
|
||||
this.submittedOnDate = submittedOnDate;
|
||||
this.submittedByUsername = submittedByUsername;
|
||||
this.submittedByFirstname = submittedByFirstname;
|
||||
this.submittedByLastname = submittedByLastname;
|
||||
this.rejectedOnDate = rejectedOnDate;
|
||||
this.rejectedByUsername = rejectedByUsername;
|
||||
this.rejectedByFirstname = rejectedByFirstname;
|
||||
this.rejectedByLastname = rejectedByLastname;
|
||||
this.withdrawnOnDate = withdrawnOnDate;
|
||||
this.withdrawnByUsername = withdrawnByUsername;
|
||||
this.withdrawnByFirstname = withdrawnByFirstname;
|
||||
this.withdrawnByLastname = withdrawnByLastname;
|
||||
this.approvedOnDate = approvedOnDate;
|
||||
this.approvedByUsername = approvedByUsername;
|
||||
this.approvedByFirstname = approvedByFirstname;
|
||||
this.approvedByLastname = approvedByLastname;
|
||||
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||
this.actualDisbursementDate = actualDisbursementDate;
|
||||
this.disbursedByUsername = disbursedByUsername;
|
||||
this.disbursedByFirstname = disbursedByFirstname;
|
||||
this.disbursedByLastname = disbursedByLastname;
|
||||
this.closedOnDate = closedOnDate;
|
||||
this.closedByUsername = closedByUsername;
|
||||
this.closedByFirstname = closedByFirstname;
|
||||
this.closedByLastname = closedByLastname;
|
||||
this.expectedMaturityDate = expectedMaturityDate;
|
||||
this.writeOffOnDate = writeOffOnDate;
|
||||
this.writeOffByUsername = writeOffByUsername;
|
||||
this.writeOffByFirstname = writeOffByFirstname;
|
||||
this.writeOffByLastname = writeOffByLastname;
|
||||
}
|
||||
|
||||
public RepaymentScheduleRelatedLoanData repaymentScheduleRelatedData(final CurrencyData currency, final BigDecimal principal,
|
||||
final BigDecimal approvedPrincipal, final BigDecimal inArrearsTolerance, final BigDecimal totalFeeChargesAtDisbursement) {
|
||||
return new RepaymentScheduleRelatedLoanData(this.expectedDisbursementDate, this.actualDisbursementDate, currency, principal,
|
||||
|
||||
+4
-13
@@ -19,24 +19,15 @@
|
||||
package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public class LoanBorrowerCycleData {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final BigDecimal principal;
|
||||
@SuppressWarnings("unused")
|
||||
private final BigDecimal interestRatePerPeriod;
|
||||
@SuppressWarnings("unused")
|
||||
private final Integer numberOfRepayments;
|
||||
@SuppressWarnings("unused")
|
||||
private final Integer termFrequency;
|
||||
|
||||
public LoanBorrowerCycleData(final BigDecimal principal, final BigDecimal interestRatePerPeriod, final Integer numberOfRepayments,
|
||||
final Integer termFrequency) {
|
||||
|
||||
this.principal = principal;
|
||||
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||
this.numberOfRepayments = numberOfRepayments;
|
||||
this.termFrequency = termFrequency;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-57
@@ -21,6 +21,7 @@ package org.apache.fineract.portfolio.loanaccount.data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
import org.apache.fineract.portfolio.charge.data.ChargeData;
|
||||
@@ -30,6 +31,7 @@ import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
|
||||
/**
|
||||
* Immutable data object for loan charge data.
|
||||
*/
|
||||
@Getter
|
||||
public class LoanChargeData {
|
||||
|
||||
private final Long id;
|
||||
@@ -381,22 +383,6 @@ public class LoanChargeData {
|
||||
return isAccountTransfer && !this.paid && !this.waived;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public LocalDate getDueDate() {
|
||||
return this.dueDate;
|
||||
}
|
||||
|
||||
public Long getLoanId() {
|
||||
return this.loanId;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountOutstanding() {
|
||||
return this.amountOutstanding;
|
||||
}
|
||||
|
||||
public boolean isInstallmentFee() {
|
||||
boolean isInstalmentFee = false;
|
||||
if (this.chargeTimeType != null) {
|
||||
@@ -405,48 +391,7 @@ public class LoanChargeData {
|
||||
return isInstalmentFee;
|
||||
}
|
||||
|
||||
public EnumOptionData getChargeCalculationType() {
|
||||
return chargeCalculationType;
|
||||
}
|
||||
|
||||
public BigDecimal amountOrPercentage() {
|
||||
return this.amountOrPercentage;
|
||||
}
|
||||
|
||||
public Collection<LoanInstallmentChargeData> getInstallmentChargeData() {
|
||||
return this.installmentChargeData;
|
||||
}
|
||||
|
||||
public boolean isPenalty() {
|
||||
return this.penalty;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountAccrued() {
|
||||
return this.amountAccrued;
|
||||
}
|
||||
|
||||
public void updateAmountAccrued(BigDecimal amountAccrued) {
|
||||
this.amountAccrued = amountAccrued;
|
||||
}
|
||||
|
||||
public Long getChargeId() {
|
||||
return this.chargeId;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountWaived() {
|
||||
return this.amountWaived;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountUnrecognized() {
|
||||
return this.amountUnrecognized;
|
||||
}
|
||||
|
||||
public String getExternalId() {
|
||||
return externalId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-33
@@ -19,7 +19,11 @@
|
||||
package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public class LoanChargePaidByData {
|
||||
|
||||
private final Long id;
|
||||
@@ -29,16 +33,6 @@ public class LoanChargePaidByData {
|
||||
private final Long transactionId;
|
||||
private final String name;
|
||||
|
||||
public LoanChargePaidByData(final Long id, final BigDecimal amount, final Integer installmentNumber, final Long chargeId,
|
||||
final Long transactionId, String name) {
|
||||
this.id = id;
|
||||
this.amount = amount;
|
||||
this.installmentNumber = installmentNumber;
|
||||
this.chargeId = chargeId;
|
||||
this.transactionId = transactionId;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public LoanChargePaidByData(final Long id, final BigDecimal amount, final Integer installmentNumber, final Long chargeId,
|
||||
final Long transactionId) {
|
||||
this.id = id;
|
||||
@@ -49,27 +43,4 @@ public class LoanChargePaidByData {
|
||||
this.name = null;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public Integer getInstallmentNumber() {
|
||||
return this.installmentNumber;
|
||||
}
|
||||
|
||||
public Long getChargeId() {
|
||||
return this.chargeId;
|
||||
}
|
||||
|
||||
public Long getTransactionId() {
|
||||
return this.transactionId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-26
@@ -19,7 +19,11 @@
|
||||
package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public class LoanCollateralManagementData {
|
||||
|
||||
private final Long clientCollateralId;
|
||||
@@ -31,30 +35,4 @@ public class LoanCollateralManagementData {
|
||||
private final BigDecimal totalCollateral;
|
||||
|
||||
private final Long id;
|
||||
|
||||
public LoanCollateralManagementData(final Long clientCollateralIdId, final BigDecimal quantity, final BigDecimal total,
|
||||
final BigDecimal totalCollateral, final Long id) {
|
||||
this.clientCollateralId = clientCollateralIdId;
|
||||
this.quantity = quantity;
|
||||
this.totalCollateral = totalCollateral;
|
||||
this.total = total;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getClientCollateralId() {
|
||||
return this.clientCollateralId;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantity() {
|
||||
return this.quantity;
|
||||
}
|
||||
|
||||
public BigDecimal getTotal() {
|
||||
return this.total;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalCollateral() {
|
||||
return this.totalCollateral;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-29
@@ -20,7 +20,9 @@ package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class LoanInstallmentChargeData {
|
||||
|
||||
private final Integer installmentNumber;
|
||||
@@ -70,36 +72,7 @@ public class LoanInstallmentChargeData {
|
||||
this.amountUnrecognized = amountUnrecognized;
|
||||
}
|
||||
|
||||
public Integer getInstallmentNumber() {
|
||||
return this.installmentNumber;
|
||||
}
|
||||
|
||||
public LocalDate getDueDate() {
|
||||
return this.dueDate;
|
||||
}
|
||||
|
||||
public boolean isPaymentPending() {
|
||||
return !(this.paid || this.waived);
|
||||
}
|
||||
|
||||
public BigDecimal getAmountOutstanding() {
|
||||
return this.amountOutstanding;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountWaived() {
|
||||
return this.amountWaived;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountAccrued() {
|
||||
return this.amountAccrued;
|
||||
}
|
||||
|
||||
public BigDecimal getAmountUnrecognized() {
|
||||
return this.amountUnrecognized;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-8
@@ -18,31 +18,29 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.portfolio.calendar.data.CalendarData;
|
||||
|
||||
@Getter
|
||||
public class LoanInterestRecalculationData {
|
||||
|
||||
private final Long id;
|
||||
private final Long loanId;
|
||||
private final EnumOptionData interestRecalculationCompoundingType;
|
||||
private final EnumOptionData rescheduleStrategyType;
|
||||
@SuppressWarnings("unused")
|
||||
private final CalendarData calendarData;
|
||||
private final EnumOptionData recalculationRestFrequencyType;
|
||||
private final Integer recalculationRestFrequencyInterval;
|
||||
/* private final LocalDate recalculationRestFrequencyDate; */
|
||||
private final EnumOptionData recalculationRestFrequencyNthDay;
|
||||
private final EnumOptionData recalculationRestFrequencyWeekday;
|
||||
private final Integer recalculationRestFrequencyOnDay;
|
||||
private final EnumOptionData recalculationCompoundingFrequencyType;
|
||||
private final Integer recalculationCompoundingFrequencyInterval;
|
||||
/* private final LocalDate recalculationCompoundingFrequencyDate; */
|
||||
private final EnumOptionData recalculationCompoundingFrequencyNthDay;
|
||||
private final EnumOptionData recalculationCompoundingFrequencyWeekday;
|
||||
private final Integer recalculationCompoundingFrequencyOnDay;
|
||||
private final Boolean isCompoundingToBePostedAsTransaction;
|
||||
@SuppressWarnings("unused")
|
||||
private final CalendarData compoundingCalendarData;
|
||||
private final Boolean allowCompoundingOnEod;
|
||||
|
||||
@@ -88,8 +86,4 @@ public class LoanInterestRecalculationData {
|
||||
recalculationData.allowCompoundingOnEod);
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-8
@@ -20,7 +20,11 @@ package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public final class LoanRepaymentScheduleInstallmentData {
|
||||
|
||||
private Long id;
|
||||
@@ -31,14 +35,6 @@ public final class LoanRepaymentScheduleInstallmentData {
|
||||
|
||||
private BigDecimal amount;
|
||||
|
||||
private LoanRepaymentScheduleInstallmentData(final Long id, final Integer installmentId, final LocalDate date,
|
||||
final BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
this.date = date;
|
||||
this.installmentId = installmentId;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static LoanRepaymentScheduleInstallmentData instanceOf(final Long id, final Integer installmentId, final LocalDate date,
|
||||
final BigDecimal amount) {
|
||||
return new LoanRepaymentScheduleInstallmentData(id, installmentId, date, amount);
|
||||
|
||||
+3
-13
@@ -18,10 +18,12 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Immutable data object represent loan status enumerations.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public class LoanStatusEnumData {
|
||||
|
||||
private final Long id;
|
||||
@@ -49,16 +51,4 @@ public class LoanStatusEnumData {
|
||||
this.closed = this.closedObligationsMet || this.closedWrittenOff || this.closedRescheduled;
|
||||
this.overpaid = Long.valueOf(700).equals(this.id);
|
||||
}
|
||||
|
||||
public Long id() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String code() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-9
@@ -20,12 +20,13 @@ package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
|
||||
/**
|
||||
* Immutable data object representing loan summary information.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public class LoanSummaryData {
|
||||
|
||||
private final CurrencyData currency;
|
||||
@@ -116,12 +117,4 @@ public class LoanSummaryData {
|
||||
this.writeoffReason = writeoffReason;
|
||||
this.totalRecovered = totalRecovered;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalOutstanding() {
|
||||
return this.totalOutstanding;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalPaidFeeCharges() {
|
||||
return feeChargesPaid;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-17
@@ -20,12 +20,13 @@ package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTermVariationType;
|
||||
|
||||
@Getter
|
||||
public class LoanTermVariationsData implements Comparable<LoanTermVariationsData> {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final Long id;
|
||||
private final EnumOptionData termType;
|
||||
private LocalDate termVariationApplicableFrom;
|
||||
@@ -54,22 +55,10 @@ public class LoanTermVariationsData implements Comparable<LoanTermVariationsData
|
||||
this.isSpecificToInstallment = isSpecificToInstallment;
|
||||
}
|
||||
|
||||
public EnumOptionData getTermType() {
|
||||
return this.termType;
|
||||
}
|
||||
|
||||
public LoanTermVariationType getTermVariationType() {
|
||||
return LoanTermVariationType.fromInt(this.termType.getId().intValue());
|
||||
}
|
||||
|
||||
public LocalDate getTermApplicableFrom() {
|
||||
return this.termVariationApplicableFrom;
|
||||
}
|
||||
|
||||
public BigDecimal getDecimalValue() {
|
||||
return this.decimalValue;
|
||||
}
|
||||
|
||||
public boolean isApplicable(final LocalDate fromDate, final LocalDate dueDate) {
|
||||
return occursOnDayFromAndUpTo(fromDate, dueDate, this.termVariationApplicableFrom);
|
||||
}
|
||||
@@ -86,11 +75,11 @@ public class LoanTermVariationsData implements Comparable<LoanTermVariationsData
|
||||
return target != null && !target.isAfter(date);
|
||||
}
|
||||
|
||||
public LocalDate getDateValue() {
|
||||
return this.dateValue;
|
||||
public boolean isSpecificToInstallment() {
|
||||
return this.isSpecificToInstallment;
|
||||
}
|
||||
|
||||
public boolean isSpecificToInstallment() {
|
||||
public boolean isIsSpecificToInstallment() {
|
||||
return this.isSpecificToInstallment;
|
||||
}
|
||||
|
||||
@@ -104,7 +93,7 @@ public class LoanTermVariationsData implements Comparable<LoanTermVariationsData
|
||||
|
||||
@Override
|
||||
public int compareTo(LoanTermVariationsData o) {
|
||||
int comparsion = getTermApplicableFrom().compareTo(o.getTermApplicableFrom());
|
||||
int comparsion = getTermVariationApplicableFrom().compareTo(o.getTermVariationApplicableFrom());
|
||||
if (comparsion == 0) {
|
||||
if (o.getTermVariationType().isDueDateVariation() || o.getTermVariationType().isInsertInstallment()) {
|
||||
comparsion = 1;
|
||||
|
||||
+2
-2
@@ -54,7 +54,7 @@ public class LoanTermVariationsDataWrapper {
|
||||
boolean hasVariation = false;
|
||||
if (iterator.hasNext()) {
|
||||
LoanTermVariationsData loanTermVariationsData = iterator.next();
|
||||
if (!loanTermVariationsData.getTermApplicableFrom().isAfter(date)) {
|
||||
if (!loanTermVariationsData.getTermVariationApplicableFrom().isAfter(date)) {
|
||||
hasVariation = true;
|
||||
}
|
||||
iterator.previous();
|
||||
@@ -123,7 +123,7 @@ public class LoanTermVariationsDataWrapper {
|
||||
public LoanTermVariationsData fetchLoanTermDueDateVariationsData(final LocalDate onDate) {
|
||||
LoanTermVariationsData data = null;
|
||||
for (LoanTermVariationsData termVariationsData : this.dueDateVariation) {
|
||||
if (onDate.isEqual(termVariationsData.getTermApplicableFrom())) {
|
||||
if (onDate.isEqual(termVariationsData.getTermVariationApplicableFrom())) {
|
||||
data = termVariationsData;
|
||||
break;
|
||||
}
|
||||
|
||||
+3
-34
@@ -22,6 +22,7 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
import org.apache.fineract.portfolio.account.data.AccountTransferData;
|
||||
@@ -31,7 +32,7 @@ import org.apache.fineract.portfolio.paymenttype.data.PaymentTypeData;
|
||||
/**
|
||||
* Immutable data object representing a loan transaction.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public class LoanTransactionData {
|
||||
|
||||
private final Long id;
|
||||
@@ -186,14 +187,6 @@ public class LoanTransactionData {
|
||||
this.loanRepaymentScheduleInstallments = loanRepaymentScheduleInstallments;
|
||||
}
|
||||
|
||||
public Long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public Integer getRowIndex() {
|
||||
return rowIndex;
|
||||
}
|
||||
|
||||
public static LoanTransactionData templateOnTop(final LoanTransactionData loanTransactionData,
|
||||
final Collection<PaymentTypeData> paymentTypeOptions) {
|
||||
return new LoanTransactionData(loanTransactionData.id, loanTransactionData.officeId, loanTransactionData.officeName,
|
||||
@@ -344,38 +337,14 @@ public class LoanTransactionData {
|
||||
this.possibleNextRepaymentDate = possibleNextRepaymentDate;
|
||||
}
|
||||
|
||||
public LocalDate dateOf() {
|
||||
return this.date;
|
||||
}
|
||||
|
||||
public boolean isNotDisbursement() {
|
||||
return type.id() == 1;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public BigDecimal getNetDisbursalAmount() {
|
||||
return netDisbursalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getUnrecognizedIncomePortion() {
|
||||
return this.unrecognizedIncomePortion;
|
||||
}
|
||||
|
||||
public BigDecimal getInterestPortion() {
|
||||
return this.interestPortion;
|
||||
return type.getId() == 1;
|
||||
}
|
||||
|
||||
public void setWriteOffReasonOptions(Collection<CodeValueData> writeOffReasonOptions) {
|
||||
this.writeOffReasonOptions = writeOffReasonOptions;
|
||||
}
|
||||
|
||||
public Collection<LoanChargePaidByData> getLoanChargePaidByList() {
|
||||
return loanChargePaidByList;
|
||||
}
|
||||
|
||||
public void setLoanChargePaidByList(Collection<LoanChargePaidByData> loanChargePaidByList) {
|
||||
this.loanChargePaidByList = loanChargePaidByList;
|
||||
}
|
||||
|
||||
+3
-98
@@ -18,10 +18,12 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Immutable data object represent loan status enumerations.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public class LoanTransactionEnumData {
|
||||
|
||||
private final Long id;
|
||||
@@ -80,18 +82,6 @@ public class LoanTransactionEnumData {
|
||||
this.chargeback = Long.valueOf(25).equals(this.id);
|
||||
}
|
||||
|
||||
public Long id() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the transaction involves either a payment (disbursement) or a receipt (repayments, repayments
|
||||
* during disbursement etc)
|
||||
@@ -111,89 +101,4 @@ public class LoanTransactionEnumData {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isDisbursement() {
|
||||
return this.disbursement;
|
||||
}
|
||||
|
||||
public boolean isRepaymentAtDisbursement() {
|
||||
return this.repaymentAtDisbursement;
|
||||
}
|
||||
|
||||
public boolean isRepayment() {
|
||||
return this.repayment;
|
||||
}
|
||||
|
||||
public boolean isMerchantIssuedRefund() {
|
||||
return this.merchantIssuedRefund;
|
||||
}
|
||||
|
||||
public boolean isPayoutRefund() {
|
||||
return this.payoutRefund;
|
||||
}
|
||||
|
||||
public boolean isGoodwillCredit() {
|
||||
return this.goodwillCredit;
|
||||
}
|
||||
|
||||
public boolean isChargeRefund() {
|
||||
return this.chargeRefund;
|
||||
}
|
||||
|
||||
public boolean isWaiveInterest() {
|
||||
return this.waiveInterest;
|
||||
}
|
||||
|
||||
public boolean isWaiveCharges() {
|
||||
return this.waiveCharges;
|
||||
}
|
||||
|
||||
public boolean isWriteOff() {
|
||||
return this.writeOff;
|
||||
}
|
||||
|
||||
public boolean isRecoveryRepayment() {
|
||||
return this.recoveryRepayment;
|
||||
}
|
||||
|
||||
public boolean isAccrual() {
|
||||
return this.accrual;
|
||||
}
|
||||
|
||||
public boolean isInitiateTransfer() {
|
||||
return this.initiateTransfer;
|
||||
}
|
||||
|
||||
public boolean isApproveTransfer() {
|
||||
return this.approveTransfer;
|
||||
}
|
||||
|
||||
public boolean isWithdrawTransfer() {
|
||||
return this.withdrawTransfer;
|
||||
}
|
||||
|
||||
public boolean isRejectTransfer() {
|
||||
return this.rejectTransfer;
|
||||
}
|
||||
|
||||
public boolean isChargePayment() {
|
||||
return this.chargePayment;
|
||||
}
|
||||
|
||||
public boolean isRefund() {
|
||||
return this.refund;
|
||||
}
|
||||
|
||||
public boolean isRefundForActiveLoans() {
|
||||
return this.refundForActiveLoans;
|
||||
}
|
||||
|
||||
public boolean isCreditBalanceRefund() {
|
||||
return this.creditBalanceRefund;
|
||||
}
|
||||
|
||||
public boolean isChargeback() {
|
||||
return this.chargeback;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-8
@@ -19,17 +19,13 @@
|
||||
package org.apache.fineract.portfolio.loanaccount.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public class PaidInAdvanceData {
|
||||
|
||||
private final BigDecimal paidInAdvance;
|
||||
|
||||
public PaidInAdvanceData(final BigDecimal paidInAdvance) {
|
||||
this.paidInAdvance = paidInAdvance;
|
||||
}
|
||||
|
||||
public BigDecimal getPaidInAdvance() {
|
||||
return paidInAdvance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -6768,7 +6768,7 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
|
||||
if (this.isMultiDisburmentLoan()) {
|
||||
List<DisbursementData> disbursementData = getDisbursmentData();
|
||||
Collections.sort(disbursementData);
|
||||
firstDisbursalAmount = disbursementData.get(disbursementData.size() - 1).amount();
|
||||
firstDisbursalAmount = disbursementData.get(disbursementData.size() - 1).getPrincipal();
|
||||
} else {
|
||||
firstDisbursalAmount = this.getLoanRepaymentScheduleDetail().getPrincipal().getAmount();
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@ public class LoanRepaymentDataComparator implements Comparator<LoanTransactionDa
|
||||
|
||||
@Override
|
||||
public int compare(final LoanTransactionData o1, final LoanTransactionData o2) {
|
||||
return o2.dateOf().compareTo(o1.dateOf());
|
||||
return o2.getDate().compareTo(o1.getDate());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-15
@@ -22,6 +22,7 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.organisation.staff.data.StaffData;
|
||||
@@ -30,6 +31,7 @@ import org.apache.fineract.portfolio.client.data.ClientData;
|
||||
import org.apache.fineract.portfolio.loanaccount.guarantor.domain.GuarantorType;
|
||||
import org.apache.fineract.portfolio.loanaccount.guarantor.service.GuarantorEnumerations;
|
||||
|
||||
@Getter
|
||||
public class GuarantorData {
|
||||
|
||||
private final Long id;
|
||||
@@ -122,14 +124,6 @@ public class GuarantorData {
|
||||
this.accountLinkingOptions = null;
|
||||
}
|
||||
|
||||
public Long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public Integer getRowIndex() {
|
||||
return rowIndex;
|
||||
}
|
||||
|
||||
public static GuarantorData template(final List<EnumOptionData> guarantorTypeOptions,
|
||||
final Collection<CodeValueData> allowedClientRelationshipTypes, Collection<PortfolioAccountData> accountLinkingOptions) {
|
||||
final Collection<GuarantorFundingData> guarantorFundingDetails = null;
|
||||
@@ -152,8 +146,8 @@ public class GuarantorData {
|
||||
public static GuarantorData mergeClientData(final ClientData clientData, final GuarantorData guarantorData) {
|
||||
return new GuarantorData(guarantorData.id, guarantorData.loanId, guarantorData.clientRelationshipType, guarantorData.entityId,
|
||||
guarantorData.guarantorType, clientData.getFirstname(), clientData.getLastname(), null, null, null, null, null, null, null,
|
||||
null, null, null, clientData.officeName(), clientData.getActivationDate(), clientData.getExternalId(), guarantorData.status,
|
||||
guarantorData.guarantorFundingDetails, null, guarantorData.allowedClientRelationshipTypes,
|
||||
null, null, null, clientData.getOfficeName(), clientData.getActivationDate(), clientData.getExternalId(),
|
||||
guarantorData.status, guarantorData.guarantorFundingDetails, null, guarantorData.allowedClientRelationshipTypes,
|
||||
guarantorData.accountLinkingOptions);
|
||||
}
|
||||
|
||||
@@ -209,9 +203,4 @@ public class GuarantorData {
|
||||
public boolean isStaffMember() {
|
||||
return GuarantorType.STAFF.getValue().equals(this.guarantorType.getId().intValue());
|
||||
}
|
||||
|
||||
public Long getEntityId() {
|
||||
return this.entityId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -71,7 +71,7 @@ public class TransferFeeChargeForLoansTasklet implements Tasklet {
|
||||
final boolean isExceptionForBalanceCheck = false;
|
||||
final AccountTransferDTO accountTransferDTO = new AccountTransferDTO(DateUtils.getBusinessLocalDate(),
|
||||
installmentChargeData.getAmountOutstanding(), PortfolioAccountType.SAVINGS, PortfolioAccountType.LOAN,
|
||||
portfolioAccountData.accountId(), chargeData.getLoanId(), "Loan Charge Payment", null, null, null, null,
|
||||
portfolioAccountData.getId(), chargeData.getLoanId(), "Loan Charge Payment", null, null, null, null,
|
||||
LoanTransactionType.CHARGE_PAYMENT.getValue(), chargeData.getId(),
|
||||
installmentChargeData.getInstallmentNumber(), AccountTransferType.CHARGE_PAYMENT.getValue(), null, null,
|
||||
null, null, null, null, isRegularTransaction, isExceptionForBalanceCheck);
|
||||
@@ -84,7 +84,7 @@ public class TransferFeeChargeForLoansTasklet implements Tasklet {
|
||||
final boolean isExceptionForBalanceCheck = false;
|
||||
final AccountTransferDTO accountTransferDTO = new AccountTransferDTO(DateUtils.getBusinessLocalDate(),
|
||||
chargeData.getAmountOutstanding(), PortfolioAccountType.SAVINGS, PortfolioAccountType.LOAN,
|
||||
portfolioAccountData.accountId(), chargeData.getLoanId(), "Loan Charge Payment", null, null, null, null,
|
||||
portfolioAccountData.getId(), chargeData.getLoanId(), "Loan Charge Payment", null, null, null, null,
|
||||
LoanTransactionType.CHARGE_PAYMENT.getValue(), chargeData.getId(), null,
|
||||
AccountTransferType.CHARGE_PAYMENT.getValue(), null, null, null, null, null, null, isRegularTransaction,
|
||||
isExceptionForBalanceCheck);
|
||||
|
||||
+2
-5
@@ -20,6 +20,7 @@ package org.apache.fineract.portfolio.loanaccount.loanschedule.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collection;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
|
||||
/**
|
||||
@@ -31,7 +32,7 @@ import org.apache.fineract.organisation.monetary.data.CurrencyData;
|
||||
* (both fees and penalties)</li>
|
||||
* </ul>
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Getter
|
||||
public class LoanScheduleData {
|
||||
|
||||
/**
|
||||
@@ -106,10 +107,6 @@ public class LoanScheduleData {
|
||||
this.totalOutstanding = null;
|
||||
}
|
||||
|
||||
public Collection<LoanSchedulePeriodData> getPeriods() {
|
||||
return this.periods;
|
||||
}
|
||||
|
||||
public void updateFuturePeriods(Collection<LoanSchedulePeriodData> futurePeriods) {
|
||||
this.futurePeriods = futurePeriods;
|
||||
}
|
||||
|
||||
+23
-48
@@ -21,12 +21,14 @@ package org.apache.fineract.portfolio.loanaccount.loanschedule.data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import lombok.Getter;
|
||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||
|
||||
/**
|
||||
* Immutable data object that represents a period of a loan schedule.
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
public final class LoanSchedulePeriodData {
|
||||
|
||||
private final Integer period;
|
||||
@@ -42,7 +44,6 @@ public final class LoanSchedulePeriodData {
|
||||
private final BigDecimal principalWrittenOff;
|
||||
private final BigDecimal principalOutstanding;
|
||||
private final BigDecimal principalLoanBalanceOutstanding;
|
||||
@SuppressWarnings("unused")
|
||||
private final BigDecimal interestOriginalDue;
|
||||
private final BigDecimal interestDue;
|
||||
private final BigDecimal interestPaid;
|
||||
@@ -59,8 +60,6 @@ public final class LoanSchedulePeriodData {
|
||||
private final BigDecimal penaltyChargesWaived;
|
||||
private final BigDecimal penaltyChargesWrittenOff;
|
||||
private final BigDecimal penaltyChargesOutstanding;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final BigDecimal totalOriginalDueForPeriod;
|
||||
private final BigDecimal totalDueForPeriod;
|
||||
private final BigDecimal totalPaidForPeriod;
|
||||
@@ -341,111 +340,87 @@ public final class LoanSchedulePeriodData {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Integer periodNumber() {
|
||||
return this.period;
|
||||
}
|
||||
|
||||
public LocalDate periodFromDate() {
|
||||
return this.fromDate;
|
||||
}
|
||||
|
||||
public LocalDate periodDueDate() {
|
||||
return this.dueDate;
|
||||
}
|
||||
|
||||
public Integer daysInPeriod() {
|
||||
return this.daysInPeriod;
|
||||
}
|
||||
|
||||
public BigDecimal principalDisbursed() {
|
||||
public BigDecimal getPrincipalDisbursed() {
|
||||
return defaultToZeroIfNull(this.principalDisbursed);
|
||||
}
|
||||
|
||||
public BigDecimal principalDue() {
|
||||
public BigDecimal getPrincipalDue() {
|
||||
return defaultToZeroIfNull(this.principalDue);
|
||||
}
|
||||
|
||||
public BigDecimal principalPaid() {
|
||||
public BigDecimal getPrincipalPaid() {
|
||||
return defaultToZeroIfNull(this.principalPaid);
|
||||
}
|
||||
|
||||
public BigDecimal principalWrittenOff() {
|
||||
public BigDecimal getPrincipalWrittenOff() {
|
||||
return defaultToZeroIfNull(this.principalWrittenOff);
|
||||
}
|
||||
|
||||
public BigDecimal principalOutstanding() {
|
||||
public BigDecimal getPrincipalOutstanding() {
|
||||
return defaultToZeroIfNull(this.principalOutstanding);
|
||||
}
|
||||
|
||||
public BigDecimal interestDue() {
|
||||
public BigDecimal getInterestDue() {
|
||||
return defaultToZeroIfNull(this.interestDue);
|
||||
}
|
||||
|
||||
public BigDecimal interestPaid() {
|
||||
public BigDecimal getInterestPaid() {
|
||||
return defaultToZeroIfNull(this.interestPaid);
|
||||
}
|
||||
|
||||
public BigDecimal interestWaived() {
|
||||
public BigDecimal getInterestWaived() {
|
||||
return defaultToZeroIfNull(this.interestWaived);
|
||||
}
|
||||
|
||||
public BigDecimal interestWrittenOff() {
|
||||
public BigDecimal getInterestWrittenOff() {
|
||||
return defaultToZeroIfNull(this.interestWrittenOff);
|
||||
}
|
||||
|
||||
public BigDecimal interestOutstanding() {
|
||||
public BigDecimal getInterestOutstanding() {
|
||||
return defaultToZeroIfNull(this.interestOutstanding);
|
||||
}
|
||||
|
||||
public BigDecimal feeChargesDue() {
|
||||
public BigDecimal getFeeChargesDue() {
|
||||
return defaultToZeroIfNull(this.feeChargesDue);
|
||||
}
|
||||
|
||||
public BigDecimal feeChargesWaived() {
|
||||
public BigDecimal getFeeChargesWaived() {
|
||||
return defaultToZeroIfNull(this.feeChargesWaived);
|
||||
}
|
||||
|
||||
public BigDecimal feeChargesWrittenOff() {
|
||||
public BigDecimal getFeeChargesWrittenOff() {
|
||||
return defaultToZeroIfNull(this.feeChargesWrittenOff);
|
||||
}
|
||||
|
||||
public BigDecimal feeChargesPaid() {
|
||||
public BigDecimal getFeeChargesPaid() {
|
||||
return defaultToZeroIfNull(this.feeChargesPaid);
|
||||
}
|
||||
|
||||
public BigDecimal feeChargesOutstanding() {
|
||||
public BigDecimal getFeeChargesOutstanding() {
|
||||
return defaultToZeroIfNull(this.feeChargesOutstanding);
|
||||
}
|
||||
|
||||
public BigDecimal penaltyChargesDue() {
|
||||
public BigDecimal getPenaltyChargesDue() {
|
||||
return defaultToZeroIfNull(this.penaltyChargesDue);
|
||||
}
|
||||
|
||||
public BigDecimal penaltyChargesWaived() {
|
||||
public BigDecimal getPenaltyChargesWaived() {
|
||||
return defaultToZeroIfNull(this.penaltyChargesWaived);
|
||||
}
|
||||
|
||||
public BigDecimal penaltyChargesWrittenOff() {
|
||||
public BigDecimal getPenaltyChargesWrittenOff() {
|
||||
return defaultToZeroIfNull(this.penaltyChargesWrittenOff);
|
||||
}
|
||||
|
||||
public BigDecimal penaltyChargesPaid() {
|
||||
public BigDecimal getPenaltyChargesPaid() {
|
||||
return defaultToZeroIfNull(this.penaltyChargesPaid);
|
||||
}
|
||||
|
||||
public BigDecimal penaltyChargesOutstanding() {
|
||||
public BigDecimal getPenaltyChargesOutstanding() {
|
||||
return defaultToZeroIfNull(this.penaltyChargesOutstanding);
|
||||
}
|
||||
|
||||
public BigDecimal totalOverdue() {
|
||||
public BigDecimal getTotalOverdue() {
|
||||
return defaultToZeroIfNull(this.totalOverdue);
|
||||
}
|
||||
|
||||
public BigDecimal principalLoanBalanceOutstanding() {
|
||||
return this.principalLoanBalanceOutstanding;
|
||||
}
|
||||
|
||||
public Boolean getComplete() {
|
||||
return this.complete;
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -1005,7 +1005,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
// due date changes should be applied only for that dueDate
|
||||
if (loanApplicationTerms.getLoanTermVariations().hasDueDateVariation(scheduledDueDate)) {
|
||||
LoanTermVariationsData loanTermVariationsData = loanApplicationTerms.getLoanTermVariations().nextDueDateVariation();
|
||||
if (loanTermVariationsData.getTermApplicableFrom().isEqual(modifiedScheduledDueDate)) {
|
||||
if (loanTermVariationsData.getTermVariationApplicableFrom().isEqual(modifiedScheduledDueDate)) {
|
||||
modifiedScheduledDueDate = loanTermVariationsData.getDateValue();
|
||||
if (!loanTermVariationsData.isSpecificToInstallment()) {
|
||||
scheduleParams.setActualRepaymentDate(modifiedScheduledDueDate);
|
||||
@@ -1044,7 +1044,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
switch (loanTermVariationsData.getTermVariationType()) {
|
||||
case INSERT_INSTALLMENT:
|
||||
scheduleParams.setActualRepaymentDate(previousRepaymentDate);
|
||||
modifiedScheduledDueDate = loanTermVariationsData.getTermApplicableFrom();
|
||||
modifiedScheduledDueDate = loanTermVariationsData.getTermVariationApplicableFrom();
|
||||
if (loanTermVariationsData.getDecimalValue() != null) {
|
||||
if (loanApplicationTerms.getInterestMethod().isDecliningBalance()
|
||||
&& loanApplicationTerms.getAmortizationMethod().isEqualInstallment()) {
|
||||
@@ -1057,7 +1057,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
loanTermVariationsData.setProcessed(true);
|
||||
break;
|
||||
case DELETE_INSTALLMENT:
|
||||
if (loanTermVariationsData.getTermApplicableFrom().isEqual(modifiedScheduledDueDate)) {
|
||||
if (loanTermVariationsData.getTermVariationApplicableFrom().isEqual(modifiedScheduledDueDate)) {
|
||||
skipPeriod = true;
|
||||
loanTermVariationsData.setProcessed(true);
|
||||
}
|
||||
@@ -1161,11 +1161,11 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
}
|
||||
switch (loanTermVariationsData.getTermVariationType()) {
|
||||
case INSERT_INSTALLMENT:
|
||||
modifiedScheduledDueDate = loanTermVariationsData.getTermApplicableFrom();
|
||||
modifiedScheduledDueDate = loanTermVariationsData.getTermVariationApplicableFrom();
|
||||
variationsData.add(loanTermVariationsData);
|
||||
break;
|
||||
case DELETE_INSTALLMENT:
|
||||
if (loanTermVariationsData.getTermApplicableFrom().isEqual(modifiedScheduledDueDate)) {
|
||||
if (loanTermVariationsData.getTermVariationApplicableFrom().isEqual(modifiedScheduledDueDate)) {
|
||||
skipPeriod = true;
|
||||
variationsData.add(loanTermVariationsData);
|
||||
}
|
||||
@@ -1922,10 +1922,10 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
for (DisbursementData disbursementData : loanApplicationTerms.getDisbursementDatas()) {
|
||||
if (disbursementData.disbursementDate().equals(disbursementDate)) {
|
||||
final LoanScheduleModelDisbursementPeriod disbursementPeriod = LoanScheduleModelDisbursementPeriod.disbursement(
|
||||
disbursementData.disbursementDate(), Money.of(currency, disbursementData.amount()),
|
||||
disbursementData.disbursementDate(), Money.of(currency, disbursementData.getPrincipal()),
|
||||
chargesDueAtTimeOfDisbursement);
|
||||
periods.add(disbursementPeriod);
|
||||
principal = principal.add(disbursementData.amount());
|
||||
principal = principal.add(disbursementData.getPrincipal());
|
||||
} else if (!excludePastUndisbursed || disbursementData.isDisbursed()
|
||||
|| !disbursementData.disbursementDate().isBefore(DateUtils.getLocalDateOfTenant())) {
|
||||
/*
|
||||
@@ -1937,7 +1937,7 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
if (prevsum != null) {
|
||||
sumToNow = prevsum.getAmount();
|
||||
}
|
||||
sumToNow = sumToNow.add(disbursementData.amount());
|
||||
sumToNow = sumToNow.add(disbursementData.getPrincipal());
|
||||
disurseDetail.put(disbursementData.disbursementDate(), Money.of(currency, sumToNow));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ public class DecliningBalanceInterestLoanScheduleGenerator extends AbstractLoanS
|
||||
for (LoanTermVariationsData loanTermVariation : termVariations) {
|
||||
if (loanTermVariation.getTermVariationType().isInterestRateVariation()
|
||||
&& loanTermVariation.isApplicable(periodStartDate, periodEndDate)) {
|
||||
LocalDate fromDate = loanTermVariation.getTermApplicableFrom();
|
||||
LocalDate fromDate = loanTermVariation.getTermVariationApplicableFrom();
|
||||
if (fromDate == null) {
|
||||
fromDate = periodStartDate;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1693,7 +1693,7 @@ public final class LoanApplicationTerms {
|
||||
if (isMultiDisburseLoan()) {
|
||||
for (DisbursementData disbursement : getDisbursementDatas()) {
|
||||
if (disbursement.isDisbursed()) {
|
||||
disbursedAmount = disbursedAmount.plus(disbursement.amount());
|
||||
disbursedAmount = disbursedAmount.plus(disbursement.getPrincipal());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user