diff --git a/fineract-provider/config/checkstyle/checkstyle.xml b/fineract-provider/config/checkstyle/checkstyle.xml
index 51ae8c938..e26accf3e 100644
--- a/fineract-provider/config/checkstyle/checkstyle.xml
+++ b/fineract-provider/config/checkstyle/checkstyle.xml
@@ -71,6 +71,10 @@
+
+
+
@@ -158,11 +162,6 @@
-
-
-
-
financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
final Account financialAccount;
/***
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java
index 6ae8df598..50f88e43e 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RecurringDepositTest.java
@@ -35,7 +35,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.integrationtests.common.ClientHelper;
import org.apache.fineract.integrationtests.common.CommonConstants;
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
@@ -3137,7 +3137,7 @@ public class RecurringDepositTest {
}
private Account getMappedLiabilityFinancialAccount() {
- final Integer liabilityTransferFinancialActivityId = FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue();
+ final Integer liabilityTransferFinancialActivityId = FinancialActivity.LIABILITY_TRANSFER.getValue();
List financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
final Account financialAccount;
/***
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureInvalidException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureInvalidException.java
index 4befc5b70..fd9cb2603 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureInvalidException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/exception/GLClosureInvalidException.java
@@ -27,7 +27,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class GLClosureInvalidException extends AbstractPlatformDomainRuleException {
/*** enum of reasons for invalid Accounting Closure **/
- public static enum GL_CLOSURE_INVALID_REASON {
+ public static enum GlClosureInvalidReason {
FUTURE_DATE, ACCOUNTING_CLOSED;
public String errorMessage() {
@@ -45,7 +45,7 @@ public class GLClosureInvalidException extends AbstractPlatformDomainRuleExcepti
}
}
- public GLClosureInvalidException(final GL_CLOSURE_INVALID_REASON reason, final Date date) {
+ public GLClosureInvalidException(final GlClosureInvalidReason reason, final Date date) {
super(reason.errorCode(), reason.errorMessage(), date);
}
}
\ No newline at end of file
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java
index a600689e7..a87f57ef9 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java
@@ -27,7 +27,7 @@ import org.apache.fineract.accounting.closure.domain.GLClosureRepository;
import org.apache.fineract.accounting.closure.exception.GLClosureDuplicateException;
import org.apache.fineract.accounting.closure.exception.GLClosureInvalidDeleteException;
import org.apache.fineract.accounting.closure.exception.GLClosureInvalidException;
-import org.apache.fineract.accounting.closure.exception.GLClosureInvalidException.GL_CLOSURE_INVALID_REASON;
+import org.apache.fineract.accounting.closure.exception.GLClosureInvalidException.GlClosureInvalidReason;
import org.apache.fineract.accounting.closure.exception.GLClosureNotFoundException;
import org.apache.fineract.accounting.closure.serialization.GLClosureCommandFromApiJsonDeserializer;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
@@ -75,12 +75,12 @@ public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosure
// ensure closure date is not in the future
final Date todaysDate = new Date();
final Date closureDate = command.DateValueOfParameterNamed(GLClosureJsonInputParams.CLOSING_DATE.getValue());
- if (closureDate.after(todaysDate)) { throw new GLClosureInvalidException(GL_CLOSURE_INVALID_REASON.FUTURE_DATE, closureDate); }
+ if (closureDate.after(todaysDate)) { throw new GLClosureInvalidException(GlClosureInvalidReason.FUTURE_DATE, closureDate); }
// shouldn't be before an existing accounting closure
final GLClosure latestGLClosure = this.glClosureRepository.getLatestGLClosureByBranch(officeId);
if (latestGLClosure != null) {
if (latestGLClosure.getClosingDate().after(closureDate)) { throw new GLClosureInvalidException(
- GL_CLOSURE_INVALID_REASON.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate()); }
+ GlClosureInvalidReason.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate()); }
}
final GLClosure glClosure = GLClosure.fromJson(office, command);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java
index 6e5e37856..9098e1519 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/common/AccountingConstants.java
@@ -28,13 +28,13 @@ import org.apache.fineract.accounting.glaccount.domain.GLAccountType;
public class AccountingConstants {
/*** Accounting placeholders for cash based accounting for loan products ***/
- public static enum CASH_ACCOUNTS_FOR_LOAN {
+ public static enum CashAccountsForLoan {
FUND_SOURCE(1), LOAN_PORTFOLIO(2), INTEREST_ON_LOANS(3), INCOME_FROM_FEES(4), INCOME_FROM_PENALTIES(5), LOSSES_WRITTEN_OFF(6), TRANSFERS_SUSPENSE(
10), OVERPAYMENT(11), INCOME_FROM_RECOVERY(12);
private final Integer value;
- private CASH_ACCOUNTS_FOR_LOAN(final Integer value) {
+ private CashAccountsForLoan(final Integer value) {
this.value = value;
}
@@ -47,27 +47,27 @@ public class AccountingConstants {
return this.value;
}
- private static final Map intToEnumMap = new HashMap<>();
+ private static final Map intToEnumMap = new HashMap<>();
static {
- for (final CASH_ACCOUNTS_FOR_LOAN type : CASH_ACCOUNTS_FOR_LOAN.values()) {
+ for (final CashAccountsForLoan type : CashAccountsForLoan.values()) {
intToEnumMap.put(type.value, type);
}
}
- public static CASH_ACCOUNTS_FOR_LOAN fromInt(final int i) {
- final CASH_ACCOUNTS_FOR_LOAN type = intToEnumMap.get(Integer.valueOf(i));
+ public static CashAccountsForLoan fromInt(final int i) {
+ final CashAccountsForLoan type = intToEnumMap.get(Integer.valueOf(i));
return type;
}
}
/*** Accounting placeholders for accrual based accounting for loan products ***/
- public static enum ACCRUAL_ACCOUNTS_FOR_LOAN {
+ public static enum AccrualAccountsForLoan {
FUND_SOURCE(1), LOAN_PORTFOLIO(2), INTEREST_ON_LOANS(3), INCOME_FROM_FEES(4), INCOME_FROM_PENALTIES(5), LOSSES_WRITTEN_OFF(6), INTEREST_RECEIVABLE(
7), FEES_RECEIVABLE(8), PENALTIES_RECEIVABLE(9), TRANSFERS_SUSPENSE(10), OVERPAYMENT(11), INCOME_FROM_RECOVERY(12);
private final Integer value;
- private ACCRUAL_ACCOUNTS_FOR_LOAN(final Integer value) {
+ private AccrualAccountsForLoan(final Integer value) {
this.value = value;
}
@@ -80,15 +80,15 @@ public class AccountingConstants {
return this.value;
}
- private static final Map intToEnumMap = new HashMap<>();
+ private static final Map intToEnumMap = new HashMap<>();
static {
- for (final ACCRUAL_ACCOUNTS_FOR_LOAN type : ACCRUAL_ACCOUNTS_FOR_LOAN.values()) {
+ for (final AccrualAccountsForLoan type : AccrualAccountsForLoan.values()) {
intToEnumMap.put(type.value, type);
}
}
- public static ACCRUAL_ACCOUNTS_FOR_LOAN fromInt(final int i) {
- final ACCRUAL_ACCOUNTS_FOR_LOAN type = intToEnumMap.get(Integer.valueOf(i));
+ public static AccrualAccountsForLoan fromInt(final int i) {
+ final AccrualAccountsForLoan type = intToEnumMap.get(Integer.valueOf(i));
return type;
}
@@ -98,7 +98,7 @@ public class AccountingConstants {
* Enum of all accounting related input parameter names used while
* creating/updating a loan product
***/
- public static enum LOAN_PRODUCT_ACCOUNTING_PARAMS {
+ public static enum LoanProductAccountingParams {
FUND_SOURCE("fundSourceAccountId"), LOAN_PORTFOLIO("loanPortfolioAccountId"), INTEREST_ON_LOANS("interestOnLoanAccountId"), INCOME_FROM_FEES(
"incomeFromFeeAccountId"), INCOME_FROM_PENALTIES("incomeFromPenaltyAccountId"), LOSSES_WRITTEN_OFF("writeOffAccountId"), OVERPAYMENT(
"overpaymentLiabilityAccountId"), INTEREST_RECEIVABLE("receivableInterestAccountId"), FEES_RECEIVABLE(
@@ -110,7 +110,7 @@ public class AccountingConstants {
private final String value;
- private LOAN_PRODUCT_ACCOUNTING_PARAMS(final String value) {
+ private LoanProductAccountingParams(final String value) {
this.value = value;
}
@@ -124,7 +124,7 @@ public class AccountingConstants {
}
}
- public static enum LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS {
+ public static enum LoanProductAccountingDataParams {
FUND_SOURCE("fundSourceAccount"), LOAN_PORTFOLIO("loanPortfolioAccount"), INTEREST_ON_LOANS("interestOnLoanAccount"), INCOME_FROM_FEES(
"incomeFromFeeAccount"), INCOME_FROM_PENALTIES("incomeFromPenaltyAccount"), LOSSES_WRITTEN_OFF("writeOffAccount"), OVERPAYMENT(
"overpaymentLiabilityAccount"), INTEREST_RECEIVABLE("receivableInterestAccount"), FEES_RECEIVABLE("receivableFeeAccount"), PENALTIES_RECEIVABLE(
@@ -133,7 +133,7 @@ public class AccountingConstants {
private final String value;
- private LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS(final String value) {
+ private LoanProductAccountingDataParams(final String value) {
this.value = value;
}
@@ -148,13 +148,13 @@ public class AccountingConstants {
}
/*** Accounting placeholders for cash based accounting for savings products ***/
- public static enum CASH_ACCOUNTS_FOR_SAVINGS {
+ public static enum CashAccountsForSavings {
SAVINGS_REFERENCE(1), SAVINGS_CONTROL(2), INTEREST_ON_SAVINGS(3), INCOME_FROM_FEES(4), INCOME_FROM_PENALTIES(5), TRANSFERS_SUSPENSE(
10), OVERDRAFT_PORTFOLIO_CONTROL(11), INCOME_FROM_INTEREST(12), LOSSES_WRITTEN_OFF(13), ESCHEAT_LIABILITY(14);
private final Integer value;
- private CASH_ACCOUNTS_FOR_SAVINGS(final Integer value) {
+ private CashAccountsForSavings(final Integer value) {
this.value = value;
}
@@ -167,15 +167,15 @@ public class AccountingConstants {
return this.value;
}
- private static final Map intToEnumMap = new HashMap<>();
+ private static final Map intToEnumMap = new HashMap<>();
static {
- for (final CASH_ACCOUNTS_FOR_SAVINGS type : CASH_ACCOUNTS_FOR_SAVINGS.values()) {
+ for (final CashAccountsForSavings type : CashAccountsForSavings.values()) {
intToEnumMap.put(type.value, type);
}
}
- public static CASH_ACCOUNTS_FOR_SAVINGS fromInt(final int i) {
- final CASH_ACCOUNTS_FOR_SAVINGS type = intToEnumMap.get(Integer.valueOf(i));
+ public static CashAccountsForSavings fromInt(final int i) {
+ final CashAccountsForSavings type = intToEnumMap.get(Integer.valueOf(i));
return type;
}
}
@@ -184,7 +184,7 @@ public class AccountingConstants {
* Enum of all accounting related input parameter names used while
* creating/updating a savings product
***/
- public static enum SAVINGS_PRODUCT_ACCOUNTING_PARAMS {
+ public static enum SavingProductAccountingParams {
SAVINGS_REFERENCE("savingsReferenceAccountId"), SAVINGS_CONTROL("savingsControlAccountId"), INCOME_FROM_FEES(
"incomeFromFeeAccountId"), INCOME_FROM_PENALTIES("incomeFromPenaltyAccountId"), INTEREST_ON_SAVINGS(
"interestOnSavingsAccountId"), PAYMENT_CHANNEL_FUND_SOURCE_MAPPING("paymentChannelToFundSourceMappings"), PAYMENT_TYPE(
@@ -195,7 +195,7 @@ public class AccountingConstants {
private final String value;
- private SAVINGS_PRODUCT_ACCOUNTING_PARAMS(final String value) {
+ private SavingProductAccountingParams(final String value) {
this.value = value;
}
@@ -209,7 +209,7 @@ public class AccountingConstants {
}
}
- public static enum SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS {
+ public static enum SavingProductAccountingDataParams {
SAVINGS_REFERENCE("savingsReferenceAccount"), SAVINGS_CONTROL("savingsControlAccount"), INCOME_FROM_FEES("incomeFromFeeAccount"), INCOME_FROM_PENALTIES(
"incomeFromPenaltyAccount"), INTEREST_ON_SAVINGS("interestOnSavingsAccount"), PAYMENT_TYPE("paymentType"), FUND_SOURCE(
"fundSourceAccount"), TRANSFERS_SUSPENSE("transfersInSuspenseAccount"), PENALTY_INCOME_ACCOUNT_MAPPING(
@@ -219,7 +219,7 @@ public class AccountingConstants {
private final String value;
- private SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS(final String value) {
+ private SavingProductAccountingDataParams(final String value) {
this.value = value;
}
@@ -233,7 +233,7 @@ public class AccountingConstants {
}
}
- public static enum FINANCIAL_ACTIVITY {
+ public static enum FinancialActivity {
ASSET_TRANSFER(100, "assetTransfer", GLAccountType.ASSET), LIABILITY_TRANSFER(200, "liabilityTransfer", GLAccountType.LIABILITY), CASH_AT_MAINVAULT(
101, "cashAtMainVault", GLAccountType.ASSET), CASH_AT_TELLER(102, "cashAtTeller", GLAccountType.ASSET), OPENING_BALANCES_TRANSFER_CONTRA(
300, "openingBalancesTransferContra", GLAccountType.EQUITY), ASSET_FUND_SOURCE(103, "fundSource", GLAccountType.ASSET), PAYABLE_DIVIDENDS(
@@ -246,13 +246,13 @@ public class AccountingConstants {
private static List financialActivities;
static {
financialActivities = new ArrayList<>();
- for (final FINANCIAL_ACTIVITY type : FINANCIAL_ACTIVITY.values()) {
+ for (final FinancialActivity type : FinancialActivity.values()) {
FinancialActivityData financialActivityData = convertToFinancialActivityData(type);
financialActivities.add(financialActivityData);
}
}
- private FINANCIAL_ACTIVITY(final Integer value, final String code, final GLAccountType mappedGLAccountType) {
+ private FinancialActivity(final Integer value, final String code, final GLAccountType mappedGLAccountType) {
this.value = value;
this.code = code;
this.mappedGLAccountType = mappedGLAccountType;
@@ -279,20 +279,20 @@ public class AccountingConstants {
return this.value.toString();
}
- private static final Map intToEnumMap = new HashMap<>();
+ private static final Map intToEnumMap = new HashMap<>();
static {
- for (final FINANCIAL_ACTIVITY type : FINANCIAL_ACTIVITY.values()) {
+ for (final FinancialActivity type : FinancialActivity.values()) {
intToEnumMap.put(type.value, type);
}
}
- public static FINANCIAL_ACTIVITY fromInt(final int financialActivityId) {
- final FINANCIAL_ACTIVITY type = intToEnumMap.get(Integer.valueOf(financialActivityId));
+ public static FinancialActivity fromInt(final int financialActivityId) {
+ final FinancialActivity type = intToEnumMap.get(Integer.valueOf(financialActivityId));
return type;
}
public static FinancialActivityData toFinancialActivityData(final int financialActivityId) {
- final FINANCIAL_ACTIVITY type = fromInt(financialActivityId);
+ final FinancialActivity type = fromInt(financialActivityId);
return convertToFinancialActivityData(type);
}
@@ -300,19 +300,19 @@ public class AccountingConstants {
return financialActivities;
}
- private static FinancialActivityData convertToFinancialActivityData(final FINANCIAL_ACTIVITY type) {
+ private static FinancialActivityData convertToFinancialActivityData(final FinancialActivity type) {
FinancialActivityData financialActivityData = new FinancialActivityData(type.value, type.code, type.getMappedGLAccountType());
return financialActivityData;
}
}
/*** Accounting placeholders for cash based accounting for Share products ***/
- public static enum CASH_ACCOUNTS_FOR_SHARES {
+ public static enum CashAccountsForShares {
SHARES_REFERENCE(1), SHARES_SUSPENSE(2), INCOME_FROM_FEES(3), SHARES_EQUITY(4);
private final Integer value;
- private CASH_ACCOUNTS_FOR_SHARES(final Integer value) {
+ private CashAccountsForShares(final Integer value) {
this.value = value;
}
@@ -325,15 +325,15 @@ public class AccountingConstants {
return this.value;
}
- private static final Map intToEnumMap = new HashMap<>();
+ private static final Map intToEnumMap = new HashMap<>();
static {
- for (final CASH_ACCOUNTS_FOR_SHARES type : CASH_ACCOUNTS_FOR_SHARES.values()) {
+ for (final CashAccountsForShares type : CashAccountsForShares.values()) {
intToEnumMap.put(type.value, type);
}
}
- public static CASH_ACCOUNTS_FOR_SHARES fromInt(final int i) {
- final CASH_ACCOUNTS_FOR_SHARES type = intToEnumMap.get(Integer.valueOf(i));
+ public static CashAccountsForShares fromInt(final int i) {
+ final CashAccountsForShares type = intToEnumMap.get(Integer.valueOf(i));
return type;
}
}
@@ -342,13 +342,13 @@ public class AccountingConstants {
* Enum of all accounting related input parameter names used while
* creating/updating a savings product
***/
- public static enum SHARES_PRODUCT_ACCOUNTING_PARAMS {
+ public static enum SharesProductAccountingParams {
SHARES_REFERENCE("shareReferenceId"), SHARES_SUSPENSE("shareSuspenseId"), INCOME_FROM_FEES("incomeFromFeeAccountId"), SHARES_EQUITY(
"shareEquityId");
private final String value;
- private SHARES_PRODUCT_ACCOUNTING_PARAMS(final String value) {
+ private SharesProductAccountingParams(final String value) {
this.value = value;
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountInvalidException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountInvalidException.java
index faebea306..30ce965af 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountInvalidException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/exception/FinancialActivityAccountInvalidException.java
@@ -18,7 +18,7 @@
*/
package org.apache.fineract.accounting.financialactivityaccount.exception;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
@@ -30,7 +30,7 @@ public class FinancialActivityAccountInvalidException extends AbstractPlatformDo
private final static String errorCode = "error.msg.financialActivityAccount.invalid";
- public FinancialActivityAccountInvalidException(final FINANCIAL_ACTIVITY financialActivity, final GLAccount glAccount) {
+ public FinancialActivityAccountInvalidException(final FinancialActivity financialActivity, final GLAccount glAccount) {
super(errorCode, "Financial Activity '" + financialActivity.getCode() + "' with Id :" + financialActivity.getValue()
+ "' can only be associated with a Ledger Account of Type " + financialActivity.getMappedGLAccountType().getCode()
+ " the provided Ledger Account '" + glAccount.getName() + "(" + glAccount.getGlCode()
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/serialization/FinancialActivityAccountDataValidator.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/serialization/FinancialActivityAccountDataValidator.java
index 1ac8c8af6..3f34f370a 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/serialization/FinancialActivityAccountDataValidator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/serialization/FinancialActivityAccountDataValidator.java
@@ -26,7 +26,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.financialactivityaccount.api.FinancialActivityAccountsJsonInputParams;
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
@@ -64,10 +64,10 @@ public final class FinancialActivityAccountDataValidator {
final Integer financialActivityId = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(paramNameForFinancialActivity, element);
baseDataValidator.reset().parameter(paramNameForFinancialActivity).value(financialActivityId).notNull().isOneOfTheseValues(
- FINANCIAL_ACTIVITY.ASSET_TRANSFER.getValue(), FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(),
- FINANCIAL_ACTIVITY.CASH_AT_MAINVAULT.getValue(), FINANCIAL_ACTIVITY.CASH_AT_TELLER.getValue(),
- FINANCIAL_ACTIVITY.OPENING_BALANCES_TRANSFER_CONTRA.getValue(), FINANCIAL_ACTIVITY.ASSET_FUND_SOURCE.getValue(),
- FINANCIAL_ACTIVITY.PAYABLE_DIVIDENDS.getValue());
+ FinancialActivity.ASSET_TRANSFER.getValue(), FinancialActivity.LIABILITY_TRANSFER.getValue(),
+ FinancialActivity.CASH_AT_MAINVAULT.getValue(), FinancialActivity.CASH_AT_TELLER.getValue(),
+ FinancialActivity.OPENING_BALANCES_TRANSFER_CONTRA.getValue(), FinancialActivity.ASSET_FUND_SOURCE.getValue(),
+ FinancialActivity.PAYABLE_DIVIDENDS.getValue());
final Long glAccountId = this.fromApiJsonHelper.extractLongNamed(paramNameForGLAccount, element);
baseDataValidator.reset().parameter(paramNameForGLAccount).value(glAccountId).notNull().integerGreaterThanZero();
@@ -92,9 +92,9 @@ public final class FinancialActivityAccountDataValidator {
final Integer financialActivityId = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(paramNameForFinancialActivity,
element);
baseDataValidator.reset().parameter(paramNameForFinancialActivity).value(financialActivityId).ignoreIfNull().isOneOfTheseValues(
- FINANCIAL_ACTIVITY.ASSET_TRANSFER.getValue(), FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(),
- FINANCIAL_ACTIVITY.OPENING_BALANCES_TRANSFER_CONTRA.getValue(), FINANCIAL_ACTIVITY.ASSET_FUND_SOURCE.getValue(),
- FINANCIAL_ACTIVITY.PAYABLE_DIVIDENDS.getValue());
+ FinancialActivity.ASSET_TRANSFER.getValue(), FinancialActivity.LIABILITY_TRANSFER.getValue(),
+ FinancialActivity.OPENING_BALANCES_TRANSFER_CONTRA.getValue(), FinancialActivity.ASSET_FUND_SOURCE.getValue(),
+ FinancialActivity.PAYABLE_DIVIDENDS.getValue());
}
if (this.fromApiJsonHelper.parameterExists(paramNameForGLAccount, element)) {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountReadPlatformServiceImpl.java
index 929743ba7..b9e4e6cee 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountReadPlatformServiceImpl.java
@@ -22,7 +22,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.common.AccountingDropdownReadPlatformService;
import org.apache.fineract.accounting.financialactivityaccount.data.FinancialActivityAccountData;
import org.apache.fineract.accounting.financialactivityaccount.data.FinancialActivityData;
@@ -75,7 +75,7 @@ public class FinancialActivityAccountReadPlatformServiceImpl implements Financia
public FinancialActivityAccountData addTemplateDetails(FinancialActivityAccountData financialActivityAccountData) {
final Map> accountOptions = this.accountingDropdownReadPlatformService.retrieveAccountMappingOptions();
financialActivityAccountData.setAccountingMappingOptions(accountOptions);
- financialActivityAccountData.setFinancialActivityOptions(FINANCIAL_ACTIVITY.getAllFinancialActivities());
+ financialActivityAccountData.setFinancialActivityOptions(FinancialActivity.getAllFinancialActivities());
return financialActivityAccountData;
}
@@ -110,7 +110,7 @@ public class FinancialActivityAccountReadPlatformServiceImpl implements Financia
final String glCode = rs.getString("glCode");
final GLAccountData glAccountData = new GLAccountData(glAccountId, glAccountName, glCode);
- final FinancialActivityData financialActivityData = FINANCIAL_ACTIVITY.toFinancialActivityData(financialActivityId);
+ final FinancialActivityData financialActivityData = FinancialActivity.toFinancialActivityData(financialActivityId);
final FinancialActivityAccountData financialActivityAccountData = new FinancialActivityAccountData(id, financialActivityData,
glAccountData);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java
index ed6a8f134..a5c469bb3 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/financialactivityaccount/service/FinancialActivityAccountWritePlatformServiceImpl.java
@@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.Map;
import javax.persistence.PersistenceException;
import org.apache.commons.lang3.exception.ExceptionUtils;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.financialactivityaccount.api.FinancialActivityAccountsJsonInputParams;
import org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccount;
import org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccountRepositoryWrapper;
@@ -91,7 +91,7 @@ public class FinancialActivityAccountWritePlatformServiceImpl implements Financi
* Activity Type
**/
private void validateFinancialActivityAndAccountMapping(FinancialActivityAccount financialActivityAccount) {
- FINANCIAL_ACTIVITY financialActivity = FINANCIAL_ACTIVITY.fromInt(financialActivityAccount.getFinancialActivityType());
+ FinancialActivity financialActivity = FinancialActivity.fromInt(financialActivityAccount.getFinancialActivityType());
GLAccount glAccount = financialActivityAccount.getGlAccount();
if (!financialActivity.getMappedGLAccountType().getValue().equals(glAccount.getType())) { throw new FinancialActivityAccountInvalidException(
financialActivity, glAccount); }
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidDeleteException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidDeleteException.java
index e90fb5c45..e74308df4 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidDeleteException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidDeleteException.java
@@ -27,7 +27,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class GLAccountInvalidDeleteException extends AbstractPlatformDomainRuleException {
/*** Enum of reasons for invalid delete **/
- public static enum GL_ACCOUNT_INVALID_DELETE_REASON {
+ public static enum GlAccountInvalidDeleteReason {
TRANSANCTIONS_LOGGED, HAS_CHILDREN;
public String errorMessage() {
@@ -45,7 +45,7 @@ public class GLAccountInvalidDeleteException extends AbstractPlatformDomainRuleE
}
}
- public GLAccountInvalidDeleteException(final GL_ACCOUNT_INVALID_DELETE_REASON reason, final Long glAccountId) {
+ public GLAccountInvalidDeleteException(final GlAccountInvalidDeleteReason reason, final Long glAccountId) {
super(reason.errorCode(), reason.errorMessage(), glAccountId);
}
}
\ No newline at end of file
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUpdateException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUpdateException.java
index 70a7aedf9..2582345bd 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUpdateException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/exception/GLAccountInvalidUpdateException.java
@@ -27,7 +27,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class GLAccountInvalidUpdateException extends AbstractPlatformDomainRuleException {
/*** Enum of reasons for invalid delete **/
- public static enum GL_ACCOUNT_INVALID_UPDATE_REASON {
+ public static enum GlAccountInvalidUpdateReason {
TRANSANCTIONS_LOGGED;
public String errorMessage() {
@@ -41,7 +41,7 @@ public class GLAccountInvalidUpdateException extends AbstractPlatformDomainRuleE
}
}
- public GLAccountInvalidUpdateException(final GL_ACCOUNT_INVALID_UPDATE_REASON reason, final Long glAccountId) {
+ public GLAccountInvalidUpdateException(final GlAccountInvalidUpdateReason reason, final Long glAccountId) {
super(reason.errorCode(), reason.errorMessage(), glAccountId);
}
}
\ No newline at end of file
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java
index f58524545..209a60ccc 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/service/GLAccountWritePlatformServiceJpaRepositoryImpl.java
@@ -29,10 +29,10 @@ import org.apache.fineract.accounting.glaccount.domain.GLAccountType;
import org.apache.fineract.accounting.glaccount.exception.GLAccountDisableException;
import org.apache.fineract.accounting.glaccount.exception.GLAccountDuplicateException;
import org.apache.fineract.accounting.glaccount.exception.GLAccountInvalidDeleteException;
-import org.apache.fineract.accounting.glaccount.exception.GLAccountInvalidDeleteException.GL_ACCOUNT_INVALID_DELETE_REASON;
+import org.apache.fineract.accounting.glaccount.exception.GLAccountInvalidDeleteException.GlAccountInvalidDeleteReason;
import org.apache.fineract.accounting.glaccount.exception.GLAccountInvalidParentException;
import org.apache.fineract.accounting.glaccount.exception.GLAccountInvalidUpdateException;
-import org.apache.fineract.accounting.glaccount.exception.GLAccountInvalidUpdateException.GL_ACCOUNT_INVALID_UPDATE_REASON;
+import org.apache.fineract.accounting.glaccount.exception.GLAccountInvalidUpdateException.GlAccountInvalidUpdateReason;
import org.apache.fineract.accounting.glaccount.exception.GLAccountNotFoundException;
import org.apache.fineract.accounting.glaccount.exception.InvalidParentGLAccountHeadException;
import org.apache.fineract.accounting.glaccount.serialization.GLAccountCommandFromApiJsonDeserializer;
@@ -160,7 +160,7 @@ public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccount
final List journalEntriesForAccount = this.glJournalEntryRepository
.findFirstJournalEntryForAccount(glAccountId);
if (journalEntriesForAccount.size() > 0) { throw new GLAccountInvalidUpdateException(
- GL_ACCOUNT_INVALID_UPDATE_REASON.TRANSANCTIONS_LOGGED, glAccountId); }
+ GlAccountInvalidUpdateReason.TRANSANCTIONS_LOGGED, glAccountId); }
}
}
@@ -195,12 +195,12 @@ public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccount
// validate this isn't a header account that has children
if (glAccount.isHeaderAccount() && glAccount.getChildren().size() > 0) { throw new GLAccountInvalidDeleteException(
- GL_ACCOUNT_INVALID_DELETE_REASON.HAS_CHILDREN, glAccountId); }
+ GlAccountInvalidDeleteReason.HAS_CHILDREN, glAccountId); }
// does this account have transactions logged against it
final List journalEntriesForAccount = this.glJournalEntryRepository.findFirstJournalEntryForAccount(glAccountId);
if (journalEntriesForAccount.size() > 0) { throw new GLAccountInvalidDeleteException(
- GL_ACCOUNT_INVALID_DELETE_REASON.TRANSANCTIONS_LOGGED, glAccountId); }
+ GlAccountInvalidDeleteReason.TRANSANCTIONS_LOGGED, glAccountId); }
this.glAccountRepository.delete(glAccount);
return new CommandProcessingResultBuilder().withEntityId(glAccountId).build();
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/exception/JournalEntryInvalidException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/exception/JournalEntryInvalidException.java
index 750b73ea6..7cbba1798 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/exception/JournalEntryInvalidException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/exception/JournalEntryInvalidException.java
@@ -27,7 +27,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class JournalEntryInvalidException extends AbstractPlatformDomainRuleException {
/*** enum of reasons for invalid Journal Entry **/
- public static enum GL_JOURNAL_ENTRY_INVALID_REASON {
+ public static enum GlJournalEntryInvalidReason {
FUTURE_DATE, ACCOUNTING_CLOSED, NO_DEBITS_OR_CREDITS, DEBIT_CREDIT_SUM_MISMATCH_WITH_AMOUNT, DEBIT_CREDIT_SUM_MISMATCH, DEBIT_CREDIT_ACCOUNT_OR_AMOUNT_EMPTY, GL_ACCOUNT_DISABLED, GL_ACCOUNT_MANUAL_ENTRIES_NOT_PERMITTED, INVALID_DEBIT_OR_CREDIT_ACCOUNTS;
public String errorMessage() {
@@ -71,7 +71,7 @@ public class JournalEntryInvalidException extends AbstractPlatformDomainRuleExce
}
}
- public JournalEntryInvalidException(final GL_JOURNAL_ENTRY_INVALID_REASON reason, final Date date, final String accountName,
+ public JournalEntryInvalidException(final GlJournalEntryInvalidReason reason, final Date date, final String accountName,
final String accountGLCode) {
super(reason.errorCode(), reason.errorMessage(), date, accountName, accountGLCode);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
index a7760dd9e..210b75e3f 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
@@ -27,11 +27,11 @@ import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.accounting.closure.domain.GLClosure;
import org.apache.fineract.accounting.closure.domain.GLClosureRepository;
-import org.apache.fineract.accounting.common.AccountingConstants.ACCRUAL_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SAVINGS;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SHARES;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.AccrualAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForSavings;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForShares;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccount;
import org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccountRepositoryWrapper;
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
@@ -50,7 +50,7 @@ import org.apache.fineract.accounting.journalentry.domain.JournalEntry;
import org.apache.fineract.accounting.journalentry.domain.JournalEntryRepository;
import org.apache.fineract.accounting.journalentry.domain.JournalEntryType;
import org.apache.fineract.accounting.journalentry.exception.JournalEntryInvalidException;
-import org.apache.fineract.accounting.journalentry.exception.JournalEntryInvalidException.GL_JOURNAL_ENTRY_INVALID_REASON;
+import org.apache.fineract.accounting.journalentry.exception.JournalEntryInvalidException.GlJournalEntryInvalidReason;
import org.apache.fineract.accounting.producttoaccountmapping.domain.PortfolioProductType;
import org.apache.fineract.accounting.producttoaccountmapping.domain.ProductToGLAccountMapping;
import org.apache.fineract.accounting.producttoaccountmapping.domain.ProductToGLAccountMappingRepository;
@@ -502,7 +502,7 @@ public class AccountingProcessorHelper {
}
public void createCreditJournalEntryOrReversalForLoan(final Office office, final String currencyCode,
- final CASH_ACCOUNTS_FOR_LOAN accountMappingType, final Long loanProductId, final Long paymentTypeId, final Long loanId,
+ final CashAccountsForLoan accountMappingType, final Long loanProductId, final Long paymentTypeId, final Long loanId,
final String transactionId, final Date transactionDate, final BigDecimal amount, final Boolean isReversal) {
final int accountMappingTypeId = accountMappingType.getValue();
createCreditJournalEntryOrReversalForLoan(office, currencyCode, accountMappingTypeId, loanProductId, paymentTypeId, loanId,
@@ -510,7 +510,7 @@ public class AccountingProcessorHelper {
}
public void createCreditJournalEntryOrReversalForLoan(final Office office, final String currencyCode,
- final ACCRUAL_ACCOUNTS_FOR_LOAN accountMappingType, final Long loanProductId, final Long paymentTypeId, final Long loanId,
+ final AccrualAccountsForLoan accountMappingType, final Long loanProductId, final Long paymentTypeId, final Long loanId,
final String transactionId, final Date transactionDate, final BigDecimal amount, final Boolean isReversal) {
final int accountMappingTypeId = accountMappingType.getValue();
createCreditJournalEntryOrReversalForLoan(office, currencyCode, accountMappingTypeId, loanProductId, paymentTypeId, loanId,
@@ -528,7 +528,7 @@ public class AccountingProcessorHelper {
**/
if (latestGLClosure != null) {
if (latestGLClosure.getClosingDate().after(transactionDate) || latestGLClosure.getClosingDate().equals(transactionDate)) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate(), null, null); }
+ GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate(), null, null); }
}
}
@@ -579,7 +579,7 @@ public class AccountingProcessorHelper {
* @param taxDetails
*/
public void createCashBasedJournalEntriesAndReversalsForSavingsTax(final Office office, final String currencyCode,
- final CASH_ACCOUNTS_FOR_SAVINGS accountTypeToBeDebited, final CASH_ACCOUNTS_FOR_SAVINGS accountTypeToBeCredited,
+ final CashAccountsForSavings accountTypeToBeDebited, final CashAccountsForSavings accountTypeToBeCredited,
final Long savingsProductId, final Long paymentTypeId, final Long savingsId, final String transactionId,
final Date transactionDate, final BigDecimal amount, final Boolean isReversal, final List taxDetails) {
@@ -738,7 +738,7 @@ public class AccountingProcessorHelper {
* @param chargePaymentDTOs chargePaymentDTOs
*/
public void createCashBasedJournalEntriesAndReversalsForSavingsCharges(final Office office, final String currencyCode,
- final CASH_ACCOUNTS_FOR_SAVINGS accountTypeToBeDebited, final CASH_ACCOUNTS_FOR_SAVINGS accountTypeToBeCredited,
+ final CashAccountsForSavings accountTypeToBeDebited, final CashAccountsForSavings accountTypeToBeCredited,
final Long savingsProductId, final Long paymentTypeId, final Long loanId, final String transactionId,
final Date transactionDate, final BigDecimal totalAmount, final Boolean isReversal,
final List chargePaymentDTOs) {
@@ -969,7 +969,7 @@ public class AccountingProcessorHelper {
}
public void createCashBasedJournalEntriesForSharesCharges(final Office office, final String currencyCode,
- final CASH_ACCOUNTS_FOR_SHARES accountTypeToBeDebited, final CASH_ACCOUNTS_FOR_SHARES accountTypeToBeCredited,
+ final CashAccountsForShares accountTypeToBeDebited, final CashAccountsForShares accountTypeToBeCredited,
final Long shareProductId, final Long paymentTypeId, final Long shareAccountId, final String transactionId,
final Date transactionDate, final BigDecimal totalAmount, final List chargePaymentDTOs) {
@@ -980,7 +980,7 @@ public class AccountingProcessorHelper {
}
public void createCashBasedJournalEntryForSharesCharges(final Office office, final String currencyCode,
- final CASH_ACCOUNTS_FOR_SHARES accountTypeToBeCredited, final Long shareProductId, final Long shareAccountId,
+ final CashAccountsForShares accountTypeToBeCredited, final Long shareProductId, final Long shareAccountId,
final String transactionId, final Date transactionDate, final BigDecimal totalAmount,
final List chargePaymentDTOs) {
final Map creditDetailsMap = new LinkedHashMap<>();
@@ -1011,7 +1011,7 @@ public class AccountingProcessorHelper {
}
public void revertCashBasedJournalEntryForSharesCharges(final Office office, final String currencyCode,
- final CASH_ACCOUNTS_FOR_SHARES accountTypeToBeCredited, final Long shareProductId, final Long shareAccountId,
+ final CashAccountsForShares accountTypeToBeCredited, final Long shareProductId, final Long shareAccountId,
final String transactionId, final Date transactionDate, final BigDecimal totalAmount,
final List chargePaymentDTOs) {
final Map creditDetailsMap = new LinkedHashMap<>();
@@ -1094,7 +1094,7 @@ public class AccountingProcessorHelper {
* payment channels). Note that fund source placeholder ID would be
* same for both cash and accrual accounts
***/
- if (accountMappingTypeId == CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue()) {
+ if (accountMappingTypeId == CashAccountsForLoan.FUND_SOURCE.getValue()) {
final ProductToGLAccountMapping paymentChannelSpecificAccountMapping = this.accountMappingRepository
.findByProductIdAndProductTypeAndFinancialAccountTypeAndPaymentTypeId(loanProductId,
PortfolioProductType.LOAN.getValue(), accountMappingTypeId, paymentTypeId);
@@ -1104,7 +1104,7 @@ public class AccountingProcessorHelper {
}
if (accountMapping == null) { throw new ProductToGLAccountMappingNotFoundException(PortfolioProductType.LOAN, loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.OVERPAYMENT.toString()); }
+ AccrualAccountsForLoan.OVERPAYMENT.toString()); }
glAccount = accountMapping.getGlAccount();
}
return glAccount;
@@ -1121,8 +1121,8 @@ public class AccountingProcessorHelper {
*****/
// Vishwas TODO: remove this condition as it should always be true
- if (accountMappingTypeId == CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue()
- || accountMappingTypeId == CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue()) {
+ if (accountMappingTypeId == CashAccountsForLoan.INCOME_FROM_FEES.getValue()
+ || accountMappingTypeId == CashAccountsForLoan.INCOME_FROM_PENALTIES.getValue()) {
final ProductToGLAccountMapping chargeSpecificIncomeAccountMapping = this.accountMappingRepository
.findByProductIdAndProductTypeAndFinancialAccountTypeAndChargeId(loanProductId, PortfolioProductType.LOAN.getValue(),
accountMappingTypeId, chargeId);
@@ -1144,8 +1144,8 @@ public class AccountingProcessorHelper {
*****/
// Vishwas TODO: remove this condition as it should always be true
- if (accountMappingTypeId == CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES.getValue()
- || accountMappingTypeId == CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue()) {
+ if (accountMappingTypeId == CashAccountsForSavings.INCOME_FROM_FEES.getValue()
+ || accountMappingTypeId == CashAccountsForLoan.INCOME_FROM_PENALTIES.getValue()) {
final ProductToGLAccountMapping chargeSpecificIncomeAccountMapping = this.accountMappingRepository
.findByProductIdAndProductTypeAndFinancialAccountTypeAndChargeId(savingsProductId,
PortfolioProductType.SAVING.getValue(), accountMappingTypeId, chargeId);
@@ -1171,7 +1171,7 @@ public class AccountingProcessorHelper {
* payment channels). Note that fund source placeholder ID would be
* same for both cash and accrual accounts
***/
- if (accountMappingTypeId == CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue()) {
+ if (accountMappingTypeId == CashAccountsForSavings.SAVINGS_REFERENCE.getValue()) {
final ProductToGLAccountMapping paymentChannelSpecificAccountMapping = this.accountMappingRepository
.findByProductIdAndProductTypeAndFinancialAccountTypeAndPaymentTypeId(savingsProductId,
PortfolioProductType.SAVING.getValue(), accountMappingTypeId, paymentTypeId);
@@ -1194,7 +1194,7 @@ public class AccountingProcessorHelper {
ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(shareProductId,
PortfolioProductType.SHARES.getValue(), accountMappingTypeId);
- if (accountMappingTypeId == CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue()) {
+ if (accountMappingTypeId == CashAccountsForShares.SHARES_REFERENCE.getValue()) {
final ProductToGLAccountMapping paymentChannelSpecificAccountMapping = this.accountMappingRepository
.findByProductIdAndProductTypeAndFinancialAccountTypeAndPaymentTypeId(shareProductId,
PortfolioProductType.SHARES.getValue(), accountMappingTypeId, paymentTypeId);
@@ -1228,7 +1228,7 @@ public class AccountingProcessorHelper {
private boolean isOrganizationAccount(final int accountMappingTypeId) {
boolean isOrganizationAccount = false;
- if (FINANCIAL_ACTIVITY.fromInt(accountMappingTypeId) != null) {
+ if (FinancialActivity.fromInt(accountMappingTypeId) != null) {
isOrganizationAccount = true;
}
return isOrganizationAccount;
@@ -1274,7 +1274,7 @@ public class AccountingProcessorHelper {
public void createDebitJournalEntryOrReversalForClientChargePayments(final Office office, final String currencyCode,
final Long clientId, final Long transactionId, final Date transactionDate, final BigDecimal amount, final Boolean isReversal) {
final GLAccount account = financialActivityAccountRepository.findByFinancialActivityTypeWithNotFoundDetection(
- FINANCIAL_ACTIVITY.ASSET_FUND_SOURCE.getValue()).getGlAccount();
+ FinancialActivity.ASSET_FUND_SOURCE.getValue()).getGlAccount();
if (isReversal) {
createCreditJournalEntryForClientPayments(office, currencyCode, account, clientId, transactionId, transactionDate, amount);
} else {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java
index 2923ca05a..778af31b5 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java
@@ -26,9 +26,9 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.fineract.accounting.closure.domain.GLClosure;
-import org.apache.fineract.accounting.common.AccountingConstants.ACCRUAL_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.AccrualAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
import org.apache.fineract.accounting.journalentry.data.ChargePaymentDTO;
import org.apache.fineract.accounting.journalentry.data.LoanDTO;
@@ -125,15 +125,15 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
// reversal)
if(loanTransactionDTO.isLoanToLoanTransfer()){
this.helper.createAccrualBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), FINANCIAL_ACTIVITY.ASSET_TRANSFER.getValue(), loanProductId,
+ AccrualAccountsForLoan.LOAN_PORTFOLIO.getValue(), FinancialActivity.ASSET_TRANSFER.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, disbursalAmount, isReversed);
} else if (loanTransactionDTO.isAccountTransfer()) {
this.helper.createAccrualBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(), loanProductId,
+ AccrualAccountsForLoan.LOAN_PORTFOLIO.getValue(), FinancialActivity.LIABILITY_TRANSFER.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, disbursalAmount, isReversed);
} else {
this.helper.createAccrualBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), loanProductId,
+ AccrualAccountsForLoan.LOAN_PORTFOLIO.getValue(), AccrualAccountsForLoan.FUND_SOURCE.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, disbursalAmount, isReversed);
}
@@ -206,7 +206,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
if (principalAmount != null && !(principalAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(principalAmount);
GLAccount account = this.helper.getLinkedGLAccountForLoanProduct(loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), paymentTypeId);
+ AccrualAccountsForLoan.LOAN_PORTFOLIO.getValue(), paymentTypeId);
accountMap.put(account, principalAmount);
}
@@ -214,7 +214,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
if (interestAmount != null && !(interestAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(interestAmount);
GLAccount account = this.helper.getLinkedGLAccountForLoanProduct(loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_RECEIVABLE.getValue(), paymentTypeId);
+ AccrualAccountsForLoan.INTEREST_RECEIVABLE.getValue(), paymentTypeId);
if (accountMap.containsKey(account)) {
BigDecimal amount = accountMap.get(account).add(interestAmount);
accountMap.put(account, amount);
@@ -229,7 +229,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
if (isIncomeFromFee) {
GLAccount account = this.helper.getLinkedGLAccountForLoanProduct(loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue(), paymentTypeId);
+ AccrualAccountsForLoan.INCOME_FROM_FEES.getValue(), paymentTypeId);
if (accountMap.containsKey(account)) {
BigDecimal amount = accountMap.get(account).add(feesAmount);
accountMap.put(account, amount);
@@ -238,7 +238,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
}
} else {
GLAccount account = this.helper.getLinkedGLAccountForLoanProduct(loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.FEES_RECEIVABLE.getValue(), paymentTypeId);
+ AccrualAccountsForLoan.FEES_RECEIVABLE.getValue(), paymentTypeId);
if (accountMap.containsKey(account)) {
BigDecimal amount = accountMap.get(account).add(feesAmount);
accountMap.put(account, amount);
@@ -253,7 +253,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
totalDebitAmount = totalDebitAmount.add(penaltiesAmount);
if (isIncomeFromFee) {
GLAccount account = this.helper.getLinkedGLAccountForLoanProduct(loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue(), paymentTypeId);
+ AccrualAccountsForLoan.INCOME_FROM_PENALTIES.getValue(), paymentTypeId);
if (accountMap.containsKey(account)) {
BigDecimal amount = accountMap.get(account).add(penaltiesAmount);
accountMap.put(account, amount);
@@ -262,7 +262,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
}
} else {
GLAccount account = this.helper.getLinkedGLAccountForLoanProduct(loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.PENALTIES_RECEIVABLE.getValue(), paymentTypeId);
+ AccrualAccountsForLoan.PENALTIES_RECEIVABLE.getValue(), paymentTypeId);
if (accountMap.containsKey(account)) {
BigDecimal amount = accountMap.get(account).add(penaltiesAmount);
accountMap.put(account, amount);
@@ -275,7 +275,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
if (overPaymentAmount != null && !(overPaymentAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(overPaymentAmount);
GLAccount account = this.helper.getLinkedGLAccountForLoanProduct(loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue(), paymentTypeId);
+ AccrualAccountsForLoan.OVERPAYMENT.getValue(), paymentTypeId);
if (accountMap.containsKey(account)) {
BigDecimal amount = accountMap.get(account).add(overPaymentAmount);
accountMap.put(account, amount);
@@ -296,20 +296,20 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
if (!(totalDebitAmount.compareTo(BigDecimal.ZERO) == 0)) {
if (writeOff) {
this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
+ AccrualAccountsForLoan.LOSSES_WRITTEN_OFF.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
transactionDate, totalDebitAmount, isReversal);
} else {
if(loanTransactionDTO.isLoanToLoanTransfer()){
this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode,
- FINANCIAL_ACTIVITY.ASSET_TRANSFER.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
+ FinancialActivity.ASSET_TRANSFER.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
transactionDate, totalDebitAmount, isReversal);
} else if (loanTransactionDTO.isAccountTransfer()) {
this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode,
- FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
+ FinancialActivity.LIABILITY_TRANSFER.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
transactionDate, totalDebitAmount, isReversal);
} else {
this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
+ AccrualAccountsForLoan.FUND_SOURCE.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
transactionDate, totalDebitAmount, isReversal);
}
}
@@ -338,7 +338,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
final Long paymentTypeId = loanTransactionDTO.getPaymentTypeId();
this.helper.createAccrualBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY.getValue(), loanProductId,
+ AccrualAccountsForLoan.FUND_SOURCE.getValue(), AccrualAccountsForLoan.INCOME_FROM_RECOVERY.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, amount, isReversal);
}
@@ -378,20 +378,20 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
// create journal entries for recognizing interest (or reversal)
if (interestAmount != null && !(interestAmount.compareTo(BigDecimal.ZERO) == 0)) {
this.helper.createAccrualBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_RECEIVABLE.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS.getValue(),
+ AccrualAccountsForLoan.INTEREST_RECEIVABLE.getValue(), AccrualAccountsForLoan.INTEREST_ON_LOANS.getValue(),
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, interestAmount, isReversed);
}
// create journal entries for the fees application (or reversal)
if (feesAmount != null && !(feesAmount.compareTo(BigDecimal.ZERO) == 0)) {
this.helper.createAccrualBasedJournalEntriesAndReversalsForLoanCharges(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.FEES_RECEIVABLE.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue(),
+ AccrualAccountsForLoan.FEES_RECEIVABLE.getValue(), AccrualAccountsForLoan.INCOME_FROM_FEES.getValue(),
loanProductId, loanId, transactionId, transactionDate, feesAmount, isReversed, loanTransactionDTO.getFeePayments());
}
// create journal entries for the penalties application (or reversal)
if (penaltiesAmount != null && !(penaltiesAmount.compareTo(BigDecimal.ZERO) == 0)) {
this.helper.createAccrualBasedJournalEntriesAndReversalsForLoanCharges(office, currencyCode,
- ACCRUAL_ACCOUNTS_FOR_LOAN.PENALTIES_RECEIVABLE.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue(),
+ AccrualAccountsForLoan.PENALTIES_RECEIVABLE.getValue(), AccrualAccountsForLoan.INCOME_FROM_PENALTIES.getValue(),
loanProductId, loanId, transactionId, transactionDate, penaltiesAmount, isReversed,
loanTransactionDTO.getPenaltyPayments());
}
@@ -412,11 +412,11 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
if (loanTransactionDTO.isAccountTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue(), FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(), loanProductId,
+ CashAccountsForLoan.OVERPAYMENT.getValue(), FinancialActivity.LIABILITY_TRANSFER.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, refundAmount, isReversal);
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue(), CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), loanProductId,
+ CashAccountsForLoan.OVERPAYMENT.getValue(), CashAccountsForLoan.FUND_SOURCE.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, refundAmount, isReversal);
}
}
@@ -443,13 +443,13 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
if (principalAmount != null && !(principalAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(principalAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.LOAN_PORTFOLIO,
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, principalAmount, !isReversal);
}
if (interestAmount != null && !(interestAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(interestAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.INTEREST_ON_LOANS,
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, interestAmount, !isReversal);
}
@@ -464,7 +464,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
: chargePaymentDTO.getAmount()));
}
this.helper.createCreditJournalEntryOrReversalForLoanCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue(), loanProductId, loanId, transactionId, transactionDate, feesAmount,
+ CashAccountsForLoan.INCOME_FROM_FEES.getValue(), loanProductId, loanId, transactionId, transactionDate, feesAmount,
!isReversal, chargePaymentDTOs);
}
@@ -479,18 +479,18 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
}
this.helper.createCreditJournalEntryOrReversalForLoanCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue(), loanProductId, loanId, transactionId, transactionDate,
+ CashAccountsForLoan.INCOME_FROM_PENALTIES.getValue(), loanProductId, loanId, transactionId, transactionDate,
penaltiesAmount, !isReversal, chargePaymentDTOs);
}
if (overPaymentAmount != null && !(overPaymentAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(overPaymentAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT, loanProductId,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.OVERPAYMENT, loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, overPaymentAmount, !isReversal);
}
/*** create a single debit entry (or reversal) for the entire amount **/
- this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(),
+ this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.FUND_SOURCE.getValue(),
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, totalDebitAmount, !isReversal);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForLoan.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForLoan.java
index 3606426b3..c916567c1 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForLoan.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForLoan.java
@@ -23,8 +23,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.fineract.accounting.closure.domain.GLClosure;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.journalentry.data.ChargePaymentDTO;
import org.apache.fineract.accounting.journalentry.data.LoanDTO;
import org.apache.fineract.accounting.journalentry.data.LoanTransactionDTO;
@@ -90,7 +90,7 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
final BigDecimal principalAmount = loanTransactionDTO.getPrincipal();
if (principalAmount != null && !(principalAmount.compareTo(BigDecimal.ZERO) == 0)) {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.getValue(), CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(),
+ CashAccountsForLoan.LOSSES_WRITTEN_OFF.getValue(), CashAccountsForLoan.LOAN_PORTFOLIO.getValue(),
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, principalAmount,
loanTransactionDTO.isReversed());
@@ -133,15 +133,15 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
final Long paymentTypeId = loanTransactionDTO.getPaymentTypeId();
if(loanTransactionDTO.isLoanToLoanTransfer()){
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), FINANCIAL_ACTIVITY.ASSET_TRANSFER.getValue(), loanProductId,
+ CashAccountsForLoan.LOAN_PORTFOLIO.getValue(), FinancialActivity.ASSET_TRANSFER.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, disbursalAmount, isReversal);
} else if (loanTransactionDTO.isAccountTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(), loanProductId,
+ CashAccountsForLoan.LOAN_PORTFOLIO.getValue(), FinancialActivity.LIABILITY_TRANSFER.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, disbursalAmount, isReversal);
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), loanProductId,
+ CashAccountsForLoan.LOAN_PORTFOLIO.getValue(), CashAccountsForLoan.FUND_SOURCE.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, disbursalAmount, isReversal);
}
@@ -173,11 +173,11 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
if (loanTransactionDTO.isAccountTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue(), FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(), loanProductId,
+ CashAccountsForLoan.OVERPAYMENT.getValue(), FinancialActivity.LIABILITY_TRANSFER.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, refundAmount, isReversal);
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue(), CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), loanProductId,
+ CashAccountsForLoan.OVERPAYMENT.getValue(), CashAccountsForLoan.FUND_SOURCE.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, refundAmount, isReversal);
}
}
@@ -212,45 +212,45 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
if (principalAmount != null && !(principalAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(principalAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.LOAN_PORTFOLIO,
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, principalAmount, isReversal);
}
if (interestAmount != null && !(interestAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(interestAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.INTEREST_ON_LOANS,
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, interestAmount, isReversal);
}
if (feesAmount != null && !(feesAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(feesAmount);
this.helper.createCreditJournalEntryOrReversalForLoanCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue(), loanProductId, loanId, transactionId, transactionDate, feesAmount,
+ CashAccountsForLoan.INCOME_FROM_FEES.getValue(), loanProductId, loanId, transactionId, transactionDate, feesAmount,
isReversal, loanTransactionDTO.getFeePayments());
}
if (penaltiesAmount != null && !(penaltiesAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(penaltiesAmount);
this.helper.createCreditJournalEntryOrReversalForLoanCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue(), loanProductId, loanId, transactionId, transactionDate,
+ CashAccountsForLoan.INCOME_FROM_PENALTIES.getValue(), loanProductId, loanId, transactionId, transactionDate,
penaltiesAmount, isReversal, loanTransactionDTO.getPenaltyPayments());
}
if (overPaymentAmount != null && !(overPaymentAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(overPaymentAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT, loanProductId,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.OVERPAYMENT, loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, overPaymentAmount, isReversal);
}
/*** create a single debit entry (or reversal) for the entire amount **/
if(loanTransactionDTO.isLoanToLoanTransfer()){
- this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, FINANCIAL_ACTIVITY.ASSET_TRANSFER.getValue(),
+ this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, FinancialActivity.ASSET_TRANSFER.getValue(),
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, totalDebitAmount, isReversal);
} else if (loanTransactionDTO.isAccountTransfer()) {
- this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(),
+ this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, FinancialActivity.LIABILITY_TRANSFER.getValue(),
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, totalDebitAmount, isReversal);
} else {
- this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(),
+ this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.FUND_SOURCE.getValue(),
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, totalDebitAmount, isReversal);
}
}
@@ -276,8 +276,8 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
final boolean isReversal = loanTransactionDTO.isReversed();
final Long paymentTypeId = loanTransactionDTO.getPaymentTypeId();
- this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(),
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
+ this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode, CashAccountsForLoan.FUND_SOURCE.getValue(),
+ CashAccountsForLoan.INCOME_FROM_RECOVERY.getValue(), loanProductId, paymentTypeId, loanId, transactionId,
transactionDate, amount, isReversal);
}
@@ -310,12 +310,12 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
if (loanTransactionDTO.getTransactionType().isInitiateTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE.getValue(), CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), loanProductId,
+ CashAccountsForLoan.TRANSFERS_SUSPENSE.getValue(), CashAccountsForLoan.LOAN_PORTFOLIO.getValue(), loanProductId,
null, loanId, transactionId, transactionDate, principalAmount, isReversal);
} else if (loanTransactionDTO.getTransactionType().isApproveTransfer()
|| loanTransactionDTO.getTransactionType().isWithdrawTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForLoan(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), CASH_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE.getValue(), loanProductId,
+ CashAccountsForLoan.LOAN_PORTFOLIO.getValue(), CashAccountsForLoan.TRANSFERS_SUSPENSE.getValue(), loanProductId,
null, loanId, transactionId, transactionDate, principalAmount, isReversal);
}
}
@@ -341,13 +341,13 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
if (principalAmount != null && !(principalAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(principalAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.LOAN_PORTFOLIO,
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, principalAmount, !isReversal);
}
if (interestAmount != null && !(interestAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(interestAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.INTEREST_ON_LOANS,
loanProductId, paymentTypeId, loanId, transactionId, transactionDate, interestAmount, !isReversal);
}
@@ -361,7 +361,7 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
chargePaymentDTO.getAmount().floatValue() < 0 ? chargePaymentDTO.getAmount().multiply(new BigDecimal(-1)):chargePaymentDTO.getAmount() ));
}
this.helper.createCreditJournalEntryOrReversalForLoanCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue(), loanProductId, loanId, transactionId, transactionDate, feesAmount,
+ CashAccountsForLoan.INCOME_FROM_FEES.getValue(), loanProductId, loanId, transactionId, transactionDate, feesAmount,
!isReversal, chargePaymentDTOs);
}
@@ -375,18 +375,18 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
}
this.helper.createCreditJournalEntryOrReversalForLoanCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue(), loanProductId, loanId, transactionId, transactionDate,
+ CashAccountsForLoan.INCOME_FROM_PENALTIES.getValue(), loanProductId, loanId, transactionId, transactionDate,
penaltiesAmount, !isReversal, chargePaymentDTOs);
}
if (overPaymentAmount != null && !(overPaymentAmount.compareTo(BigDecimal.ZERO) == 0)) {
totalDebitAmount = totalDebitAmount.add(overPaymentAmount);
- this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT, loanProductId,
+ this.helper.createCreditJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.OVERPAYMENT, loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, overPaymentAmount, !isReversal);
}
/*** create a single debit entry (or reversal) for the entire amount **/
- this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), loanProductId,
+ this.helper.createDebitJournalEntryOrReversalForLoan(office, currencyCode, CashAccountsForLoan.FUND_SOURCE.getValue(), loanProductId,
paymentTypeId, loanId, transactionId, transactionDate, totalDebitAmount, !isReversal);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java
index d201fcf42..8ea65e152 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForSavings.java
@@ -22,8 +22,8 @@ import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.fineract.accounting.closure.domain.GLClosure;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SAVINGS;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForSavings;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.journalentry.data.ChargePaymentDTO;
import org.apache.fineract.accounting.journalentry.data.SavingsDTO;
import org.apache.fineract.accounting.journalentry.data.SavingsTransactionDTO;
@@ -63,48 +63,48 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
if (savingsTransactionDTO.getTransactionType().isWithdrawal() && savingsTransactionDTO.isOverdraftTransaction()) {
if (savingsTransactionDTO.isAccountTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(),
- FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(), savingsProductId, paymentTypeId, savingsId, transactionId,
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.getValue(),
+ FinancialActivity.LIABILITY_TRANSFER.getValue(), savingsProductId, paymentTypeId, savingsId, transactionId,
transactionDate, overdraftAmount, isReversal);
if (amount.subtract(overdraftAmount).compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(), FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(),
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue(), FinancialActivity.LIABILITY_TRANSFER.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate,
amount.subtract(overdraftAmount), isReversal);
}
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue(), savingsProductId, paymentTypeId, savingsId,
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.getValue(),
+ CashAccountsForSavings.SAVINGS_REFERENCE.getValue(), savingsProductId, paymentTypeId, savingsId,
transactionId, transactionDate, overdraftAmount, isReversal);
if (amount.subtract(overdraftAmount).compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue(), savingsProductId, paymentTypeId, savingsId,
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue(),
+ CashAccountsForSavings.SAVINGS_REFERENCE.getValue(), savingsProductId, paymentTypeId, savingsId,
transactionId, transactionDate, amount.subtract(overdraftAmount), isReversal);
}
}
} else if (savingsTransactionDTO.getTransactionType().isDeposit() && savingsTransactionDTO.isOverdraftTransaction()) {
if (savingsTransactionDTO.isAccountTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
+ FinancialActivity.LIABILITY_TRANSFER.getValue(),
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
transactionId, transactionDate, overdraftAmount, isReversal);
if (amount.subtract(overdraftAmount).compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(),
+ FinancialActivity.LIABILITY_TRANSFER.getValue(), CashAccountsForSavings.SAVINGS_CONTROL.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate,
amount.subtract(overdraftAmount), isReversal);
}
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
+ CashAccountsForSavings.SAVINGS_REFERENCE.getValue(),
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
transactionId, transactionDate, overdraftAmount, isReversal);
if (amount.subtract(overdraftAmount).compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
+ CashAccountsForSavings.SAVINGS_REFERENCE.getValue(),
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
transactionId, transactionDate, amount.subtract(overdraftAmount), isReversal);
}
}
@@ -114,11 +114,11 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
else if (savingsTransactionDTO.getTransactionType().isDeposit()) {
if (savingsTransactionDTO.isAccountTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(),
+ FinancialActivity.LIABILITY_TRANSFER.getValue(), CashAccountsForSavings.SAVINGS_CONTROL.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(),
+ CashAccountsForSavings.SAVINGS_REFERENCE.getValue(), CashAccountsForSavings.SAVINGS_CONTROL.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
}
@@ -126,25 +126,25 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
/** Handle Deposits and reversals of Dividend pay outs **/
else if (savingsTransactionDTO.getTransactionType().isDividendPayout()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- FINANCIAL_ACTIVITY.PAYABLE_DIVIDENDS.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(),
+ FinancialActivity.PAYABLE_DIVIDENDS.getValue(), CashAccountsForSavings.SAVINGS_CONTROL.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
/** Handle withdrawals and reversals of withdrawals **/
else if (savingsTransactionDTO.getTransactionType().isWithdrawal()) {
if (savingsTransactionDTO.isAccountTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(), FINANCIAL_ACTIVITY.LIABILITY_TRANSFER.getValue(),
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue(), FinancialActivity.LIABILITY_TRANSFER.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue(),
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue(), CashAccountsForSavings.SAVINGS_REFERENCE.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
}
else if (savingsTransactionDTO.getTransactionType().isEscheat()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.ESCHEAT_LIABILITY.getValue(),
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue(), CashAccountsForSavings.ESCHEAT_LIABILITY.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
/**
@@ -156,13 +156,13 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
// zero
if (savingsTransactionDTO.getAmount().compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
+ CashAccountsForSavings.INTEREST_ON_SAVINGS.getValue(),
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
transactionId, transactionDate, overdraftAmount, isReversal);
if (amount.subtract(overdraftAmount).compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
+ CashAccountsForSavings.INTEREST_ON_SAVINGS.getValue(),
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
transactionId, transactionDate, amount.subtract(overdraftAmount), isReversal);
}
}
@@ -173,14 +173,14 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
// zero
if (savingsTransactionDTO.getAmount().compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(),
+ CashAccountsForSavings.INTEREST_ON_SAVINGS.getValue(), CashAccountsForSavings.SAVINGS_CONTROL.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
}
else if (savingsTransactionDTO.getTransactionType().isWithholdTax()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavingsTax(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL, CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE, savingsProductId,
+ CashAccountsForSavings.SAVINGS_CONTROL, CashAccountsForSavings.SAVINGS_REFERENCE, savingsProductId,
paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal,
savingsTransactionDTO.getTaxPayments());
}
@@ -190,23 +190,23 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
// Is the Charge a penalty?
if (penaltyPayments.size() > 0) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavingsCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_PENALTIES,
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL, CashAccountsForSavings.INCOME_FROM_PENALTIES,
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, overdraftAmount, isReversal,
penaltyPayments);
if (amount.subtract(overdraftAmount).compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavingsCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_PENALTIES,
+ CashAccountsForSavings.SAVINGS_CONTROL, CashAccountsForSavings.INCOME_FROM_PENALTIES,
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate,
amount.subtract(overdraftAmount), isReversal, penaltyPayments);
}
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForSavingsCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES,
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL, CashAccountsForSavings.INCOME_FROM_FEES,
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, overdraftAmount, isReversal,
feePayments);
if (amount.subtract(overdraftAmount).compareTo(BigDecimal.ZERO) == 1) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavingsCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES, savingsProductId,
+ CashAccountsForSavings.SAVINGS_CONTROL, CashAccountsForSavings.INCOME_FROM_FEES, savingsProductId,
paymentTypeId, savingsId, transactionId, transactionDate, amount.subtract(overdraftAmount), isReversal,
feePayments);
}
@@ -217,11 +217,11 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
// Is the Charge a penalty?
if (penaltyPayments.size() > 0) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavingsCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_PENALTIES, savingsProductId,
+ CashAccountsForSavings.SAVINGS_CONTROL, CashAccountsForSavings.INCOME_FROM_PENALTIES, savingsProductId,
paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal, penaltyPayments);
} else {
this.helper.createCashBasedJournalEntriesAndReversalsForSavingsCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES, savingsProductId,
+ CashAccountsForSavings.SAVINGS_CONTROL, CashAccountsForSavings.INCOME_FROM_FEES, savingsProductId,
paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal, feePayments);
}
}
@@ -229,7 +229,7 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
/** Handle Transfers proposal **/
else if (savingsTransactionDTO.getTransactionType().isInitiateTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.TRANSFERS_SUSPENSE.getValue(),
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue(), CashAccountsForSavings.TRANSFERS_SUSPENSE.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
@@ -237,23 +237,23 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
else if (savingsTransactionDTO.getTransactionType().isWithdrawTransfer()
|| savingsTransactionDTO.getTransactionType().isApproveTransfer()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.TRANSFERS_SUSPENSE.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(),
+ CashAccountsForSavings.TRANSFERS_SUSPENSE.getValue(), CashAccountsForSavings.SAVINGS_CONTROL.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
/** overdraft **/
else if (savingsTransactionDTO.getTransactionType().isOverdraftInterest()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue(), CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_INTEREST.getValue(),
+ CashAccountsForSavings.SAVINGS_REFERENCE.getValue(), CashAccountsForSavings.INCOME_FROM_INTEREST.getValue(),
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
} else if (savingsTransactionDTO.getTransactionType().isWrittenoff()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavings(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.LOSSES_WRITTEN_OFF.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
+ CashAccountsForSavings.LOSSES_WRITTEN_OFF.getValue(),
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingsProductId, paymentTypeId, savingsId,
transactionId, transactionDate, amount, isReversal);
} else if (savingsTransactionDTO.getTransactionType().isOverdraftFee()) {
this.helper.createCashBasedJournalEntriesAndReversalsForSavingsCharges(office, currencyCode,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES, savingsProductId,
+ CashAccountsForSavings.SAVINGS_REFERENCE, CashAccountsForSavings.INCOME_FROM_FEES, savingsProductId,
paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal, feePayments);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForShares.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForShares.java
index 0d0ef8069..72cb90bc0 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForShares.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForShares.java
@@ -22,7 +22,7 @@ import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.fineract.accounting.closure.domain.GLClosure;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SHARES;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForShares;
import org.apache.fineract.accounting.journalentry.data.ChargePaymentDTO;
import org.apache.fineract.accounting.journalentry.data.SharesDTO;
import org.apache.fineract.accounting.journalentry.data.SharesTransactionDTO;
@@ -65,8 +65,8 @@ public class CashBasedAccountingProcessorForShares implements AccountingProcesso
paymentTypeId, amount, chargeAmount, feePayments);
} else if (transactionDTO.getTransactionType().isChargePayment()) {
- this.helper.createCashBasedJournalEntriesForSharesCharges(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE,
- CASH_ACCOUNTS_FOR_SHARES.INCOME_FROM_FEES, shareProductId, paymentTypeId, shareAccountId, transactionId,
+ this.helper.createCashBasedJournalEntriesForSharesCharges(office, currencyCode, CashAccountsForShares.SHARES_REFERENCE,
+ CashAccountsForShares.INCOME_FROM_FEES, shareProductId, paymentTypeId, shareAccountId, transactionId,
transactionDate, amount, feePayments);
}
}
@@ -77,15 +77,15 @@ public class CashBasedAccountingProcessorForShares implements AccountingProcesso
final Date transactionDate, final String transactionId, final Office office, final Long paymentTypeId, final BigDecimal amount,
final BigDecimal chargeAmount, final List feePayments) {
if (chargeAmount == null || chargeAmount.compareTo(BigDecimal.ZERO) != 1) {
- this.helper.createJournalEntriesForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_EQUITY.getValue(),
- CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue(), shareProductId, paymentTypeId, shareAccountId, transactionId,
+ this.helper.createJournalEntriesForShares(office, currencyCode, CashAccountsForShares.SHARES_EQUITY.getValue(),
+ CashAccountsForShares.SHARES_REFERENCE.getValue(), shareProductId, paymentTypeId, shareAccountId, transactionId,
transactionDate, amount);
} else {
- this.helper.createDebitJournalEntryForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_EQUITY.getValue(),
+ this.helper.createDebitJournalEntryForShares(office, currencyCode, CashAccountsForShares.SHARES_EQUITY.getValue(),
shareProductId, paymentTypeId, shareAccountId, transactionId, transactionDate, amount.add(chargeAmount));
- this.helper.createCreditJournalEntryForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue(),
+ this.helper.createCreditJournalEntryForShares(office, currencyCode, CashAccountsForShares.SHARES_REFERENCE.getValue(),
shareProductId, paymentTypeId, shareAccountId, transactionId, transactionDate, amount);
- this.helper.createCashBasedJournalEntryForSharesCharges(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.INCOME_FROM_FEES,
+ this.helper.createCashBasedJournalEntryForSharesCharges(office, currencyCode, CashAccountsForShares.INCOME_FROM_FEES,
shareProductId, shareAccountId, transactionId, transactionDate, chargeAmount, feePayments);
}
}
@@ -95,15 +95,15 @@ public class CashBasedAccountingProcessorForShares implements AccountingProcesso
final Long paymentTypeId, final BigDecimal amount, final BigDecimal chargeAmount, final List feePayments) {
if (transactionDTO.getTransactionStatus().isApplied()) {
if (chargeAmount == null || chargeAmount.compareTo(BigDecimal.ZERO) != 1) {
- this.helper.createJournalEntriesForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue(),
- CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE.getValue(), shareProductId, paymentTypeId, shareAccountId, transactionId,
+ this.helper.createJournalEntriesForShares(office, currencyCode, CashAccountsForShares.SHARES_REFERENCE.getValue(),
+ CashAccountsForShares.SHARES_SUSPENSE.getValue(), shareProductId, paymentTypeId, shareAccountId, transactionId,
transactionDate, amount);
} else {
- this.helper.createDebitJournalEntryForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue(),
+ this.helper.createDebitJournalEntryForShares(office, currencyCode, CashAccountsForShares.SHARES_REFERENCE.getValue(),
shareProductId, paymentTypeId, shareAccountId, transactionId, transactionDate, amount);
- this.helper.createCreditJournalEntryForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE.getValue(),
+ this.helper.createCreditJournalEntryForShares(office, currencyCode, CashAccountsForShares.SHARES_SUSPENSE.getValue(),
shareProductId, paymentTypeId, shareAccountId, transactionId, transactionDate, amount.subtract(chargeAmount));
- this.helper.createCashBasedJournalEntryForSharesCharges(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.INCOME_FROM_FEES,
+ this.helper.createCashBasedJournalEntryForSharesCharges(office, currencyCode, CashAccountsForShares.INCOME_FROM_FEES,
shareProductId, shareAccountId, transactionId, transactionDate, chargeAmount, feePayments);
}
} else if (transactionDTO.getTransactionStatus().isApproved()) {
@@ -111,21 +111,21 @@ public class CashBasedAccountingProcessorForShares implements AccountingProcesso
if (chargeAmount != null && chargeAmount.compareTo(BigDecimal.ZERO) == 1) {
amountForJE = amount.subtract(chargeAmount);
}
- this.helper.createJournalEntriesForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE.getValue(),
- CASH_ACCOUNTS_FOR_SHARES.SHARES_EQUITY.getValue(), shareProductId, paymentTypeId, shareAccountId, transactionId,
+ this.helper.createJournalEntriesForShares(office, currencyCode, CashAccountsForShares.SHARES_SUSPENSE.getValue(),
+ CashAccountsForShares.SHARES_EQUITY.getValue(), shareProductId, paymentTypeId, shareAccountId, transactionId,
transactionDate, amountForJE);
} else if (transactionDTO.getTransactionStatus().isRejected()) {
if (chargeAmount != null && chargeAmount.compareTo(BigDecimal.ZERO) == 1) {
- this.helper.revertCashBasedJournalEntryForSharesCharges(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.INCOME_FROM_FEES,
+ this.helper.revertCashBasedJournalEntryForSharesCharges(office, currencyCode, CashAccountsForShares.INCOME_FROM_FEES,
shareProductId, shareAccountId, transactionId, transactionDate, chargeAmount, feePayments);
- this.helper.createDebitJournalEntryForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE.getValue(), shareProductId, paymentTypeId, shareAccountId,
+ this.helper.createDebitJournalEntryForShares(office, currencyCode, CashAccountsForShares.SHARES_SUSPENSE.getValue(), shareProductId, paymentTypeId, shareAccountId,
transactionId, transactionDate, amount.subtract(chargeAmount));
- this.helper.createCreditJournalEntryForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue(), shareProductId, paymentTypeId, shareAccountId,
+ this.helper.createCreditJournalEntryForShares(office, currencyCode, CashAccountsForShares.SHARES_REFERENCE.getValue(), shareProductId, paymentTypeId, shareAccountId,
transactionId, transactionDate, amount);
}else{
- this.helper.createJournalEntriesForShares(office, currencyCode, CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE.getValue(),
- CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue(), shareProductId, paymentTypeId, shareAccountId, transactionId,
+ this.helper.createJournalEntriesForShares(office, currencyCode, CashAccountsForShares.SHARES_SUSPENSE.getValue(),
+ CashAccountsForShares.SHARES_REFERENCE.getValue(), shareProductId, paymentTypeId, shareAccountId, transactionId,
transactionDate, amount);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
index 6fac86436..09be8e53c 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
@@ -51,7 +51,7 @@ import org.apache.fineract.accounting.journalentry.domain.JournalEntryRepository
import org.apache.fineract.accounting.journalentry.domain.JournalEntryType;
import org.apache.fineract.accounting.journalentry.exception.JournalEntriesNotFoundException;
import org.apache.fineract.accounting.journalentry.exception.JournalEntryInvalidException;
-import org.apache.fineract.accounting.journalentry.exception.JournalEntryInvalidException.GL_JOURNAL_ENTRY_INVALID_REASON;
+import org.apache.fineract.accounting.journalentry.exception.JournalEntryInvalidException.GlJournalEntryInvalidReason;
import org.apache.fineract.accounting.journalentry.exception.JournalEntryRuntimeException;
import org.apache.fineract.accounting.journalentry.serialization.JournalEntryCommandFromApiJsonDeserializer;
import org.apache.fineract.accounting.producttoaccountmapping.domain.PortfolioProductType;
@@ -169,7 +169,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
if (accountingRule.getAccountToCredit() == null) {
if (journalEntryCommand.getCredits() == null) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.NO_DEBITS_OR_CREDITS, null, null, null); }
+ GlJournalEntryInvalidReason.NO_DEBITS_OR_CREDITS, null, null, null); }
if (journalEntryCommand.getDebits() != null) {
checkDebitOrCreditAccountsAreValid(accountingRule, journalEntryCommand.getCredits(),
journalEntryCommand.getDebits());
@@ -188,7 +188,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
if (accountingRule.getAccountToDebit() == null) {
if (journalEntryCommand.getDebits() == null) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.NO_DEBITS_OR_CREDITS, null, null, null); }
+ GlJournalEntryInvalidReason.NO_DEBITS_OR_CREDITS, null, null, null); }
if (journalEntryCommand.getCredits() != null) {
checkDebitOrCreditAccountsAreValid(accountingRule, journalEntryCommand.getCredits(),
journalEntryCommand.getDebits());
@@ -228,10 +228,10 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
* should have only one entry and it must be same as existing account
*/
if (creditOrDebits.length != 1) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.INVALID_DEBIT_OR_CREDIT_ACCOUNTS, null, null, null); }
+ GlJournalEntryInvalidReason.INVALID_DEBIT_OR_CREDIT_ACCOUNTS, null, null, null); }
for (final SingleDebitOrCreditEntryCommand creditOrDebit : creditOrDebits) {
if (!glaccount.getId().equals(creditOrDebit.getGlAccountId())) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.INVALID_DEBIT_OR_CREDIT_ACCOUNTS, null, null, null); }
+ GlJournalEntryInvalidReason.INVALID_DEBIT_OR_CREDIT_ACCOUNTS, null, null, null); }
}
}
@@ -283,16 +283,16 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
BigDecimal debitsSum = BigDecimal.ZERO;
for (final SingleDebitOrCreditEntryCommand creditEntryCommand : credits) {
if (creditEntryCommand.getAmount() == null || creditEntryCommand.getGlAccountId() == null) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.DEBIT_CREDIT_ACCOUNT_OR_AMOUNT_EMPTY, null, null, null); }
+ GlJournalEntryInvalidReason.DEBIT_CREDIT_ACCOUNT_OR_AMOUNT_EMPTY, null, null, null); }
creditsSum = creditsSum.add(creditEntryCommand.getAmount());
}
for (final SingleDebitOrCreditEntryCommand debitEntryCommand : debits) {
if (debitEntryCommand.getAmount() == null || debitEntryCommand.getGlAccountId() == null) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.DEBIT_CREDIT_ACCOUNT_OR_AMOUNT_EMPTY, null, null, null); }
+ GlJournalEntryInvalidReason.DEBIT_CREDIT_ACCOUNT_OR_AMOUNT_EMPTY, null, null, null); }
debitsSum = debitsSum.add(debitEntryCommand.getAmount());
}
if (creditsSum.compareTo(debitsSum) != 0) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.DEBIT_CREDIT_SUM_MISMATCH, null, null, null); }
+ GlJournalEntryInvalidReason.DEBIT_CREDIT_SUM_MISMATCH, null, null, null); }
}
private void validateGLAccountForTransaction(final GLAccount creditOrDebitAccountHead) {
@@ -301,10 +301,10 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
* disabled
**/
if (creditOrDebitAccountHead.isDisabled()) {
- throw new JournalEntryInvalidException(GL_JOURNAL_ENTRY_INVALID_REASON.GL_ACCOUNT_DISABLED, null,
+ throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.GL_ACCOUNT_DISABLED, null,
creditOrDebitAccountHead.getName(), creditOrDebitAccountHead.getGlCode());
} else if (!creditOrDebitAccountHead.isManualEntriesAllowed()) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.GL_ACCOUNT_MANUAL_ENTRIES_NOT_PERMITTED, null, creditOrDebitAccountHead.getName(),
+ GlJournalEntryInvalidReason.GL_ACCOUNT_MANUAL_ENTRIES_NOT_PERMITTED, null, creditOrDebitAccountHead.getName(),
creditOrDebitAccountHead.getGlCode()); }
}
@@ -338,7 +338,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
|| latestGLClosureByBranch.getClosingDate().equals(journalEntriesTransactionDate)) {
final String accountName = null;
final String accountGLCode = null;
- throw new JournalEntryInvalidException(GL_JOURNAL_ENTRY_INVALID_REASON.ACCOUNTING_CLOSED,
+ throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED,
latestGLClosureByBranch.getClosingDate(), accountName, accountGLCode);
}
}
@@ -578,13 +578,13 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
final Date transactionDate = entryLocalDate.toDateTimeAtStartOfDay().toDate();
// shouldn't be in the future
final Date todaysDate = new Date();
- if (transactionDate.after(todaysDate)) { throw new JournalEntryInvalidException(GL_JOURNAL_ENTRY_INVALID_REASON.FUTURE_DATE,
+ if (transactionDate.after(todaysDate)) { throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.FUTURE_DATE,
transactionDate, null, null); }
// shouldn't be before an accounting closure
final GLClosure latestGLClosure = this.glClosureRepository.getLatestGLClosureByBranch(command.getOfficeId());
if (latestGLClosure != null) {
if (latestGLClosure.getClosingDate().after(transactionDate) || latestGLClosure.getClosingDate().equals(transactionDate)) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate(), null, null); }
+ GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, latestGLClosure.getClosingDate(), null, null); }
}
/*** check if credits and debits are valid **/
@@ -593,7 +593,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
// atleast one debit or credit must be present
if (credits == null || credits.length <= 0 || debits == null || debits.length <= 0) { throw new JournalEntryInvalidException(
- GL_JOURNAL_ENTRY_INVALID_REASON.NO_DEBITS_OR_CREDITS, null, null, null); }
+ GlJournalEntryInvalidReason.NO_DEBITS_OR_CREDITS, null, null, null); }
checkDebitAndCreditAmounts(credits, debits);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/serialization/ProductToGLAccountMappingFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/serialization/ProductToGLAccountMappingFromApiJsonDeserializer.java
index d8795ef54..62b3298e6 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/serialization/ProductToGLAccountMappingFromApiJsonDeserializer.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/serialization/ProductToGLAccountMappingFromApiJsonDeserializer.java
@@ -27,9 +27,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.apache.commons.lang3.StringUtils;
-import org.apache.fineract.accounting.common.AccountingConstants.LOAN_PRODUCT_ACCOUNTING_PARAMS;
-import org.apache.fineract.accounting.common.AccountingConstants.SAVINGS_PRODUCT_ACCOUNTING_PARAMS;
-import org.apache.fineract.accounting.common.AccountingConstants.SHARES_PRODUCT_ACCOUNTING_PARAMS;
+import org.apache.fineract.accounting.common.AccountingConstants.LoanProductAccountingParams;
+import org.apache.fineract.accounting.common.AccountingConstants.SavingProductAccountingParams;
+import org.apache.fineract.accounting.common.AccountingConstants.SharesProductAccountingParams;
import org.apache.fineract.accounting.common.AccountingRuleType;
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
import org.apache.fineract.accounting.producttoaccountmapping.service.ProductToGLAccountMappingWritePlatformService;
@@ -92,49 +92,49 @@ public final class ProductToGLAccountMappingFromApiJsonDeserializer {
if (isCashBasedAccounting(accountingRuleType) || isAccrualBasedAccounting(accountingRuleType)) {
- final Long fundAccountId = this.fromApiJsonHelper.extractLongNamed(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(),
+ final Long fundAccountId = this.fromApiJsonHelper.extractLongNamed(LoanProductAccountingParams.FUND_SOURCE.getValue(),
element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue()).value(fundAccountId).notNull()
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.FUND_SOURCE.getValue()).value(fundAccountId).notNull()
.integerGreaterThanZero();
final Long loanPortfolioAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue()).value(loanPortfolioAccountId)
+ LoanProductAccountingParams.LOAN_PORTFOLIO.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.LOAN_PORTFOLIO.getValue()).value(loanPortfolioAccountId)
.notNull().integerGreaterThanZero();
final Long incomeFromInterestId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue()).value(incomeFromInterestId)
+ LoanProductAccountingParams.INTEREST_ON_LOANS.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.INTEREST_ON_LOANS.getValue()).value(incomeFromInterestId)
.notNull().integerGreaterThanZero();
final Long incomeFromFeeId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue()).value(incomeFromFeeId)
+ LoanProductAccountingParams.INCOME_FROM_FEES.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.INCOME_FROM_FEES.getValue()).value(incomeFromFeeId)
.notNull().integerGreaterThanZero();
final Long incomeFromPenaltyId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue()).value(incomeFromPenaltyId)
+ LoanProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.INCOME_FROM_PENALTIES.getValue()).value(incomeFromPenaltyId)
.notNull().integerGreaterThanZero();
final Long incomeFromRecoveryAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_RECOVERY.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_RECOVERY.getValue())
+ LoanProductAccountingParams.INCOME_FROM_RECOVERY.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.INCOME_FROM_RECOVERY.getValue())
.value(incomeFromRecoveryAccountId).notNull().integerGreaterThanZero();
final Long writeOffAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue()).value(writeOffAccountId)
+ LoanProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.LOSSES_WRITTEN_OFF.getValue()).value(writeOffAccountId)
.notNull().integerGreaterThanZero();
final Long overpaymentAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.OVERPAYMENT.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.OVERPAYMENT.getValue()).value(overpaymentAccountId)
+ LoanProductAccountingParams.OVERPAYMENT.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.OVERPAYMENT.getValue()).value(overpaymentAccountId)
.notNull().integerGreaterThanZero();
final Long transfersInSuspenseAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue())
+ LoanProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.TRANSFERS_SUSPENSE.getValue())
.value(transfersInSuspenseAccountId).notNull().integerGreaterThanZero();
}
@@ -142,18 +142,18 @@ public final class ProductToGLAccountMappingFromApiJsonDeserializer {
if (isAccrualBasedAccounting(accountingRuleType)) {
final Long receivableInterestAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_RECEIVABLE.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_RECEIVABLE.getValue())
+ LoanProductAccountingParams.INTEREST_RECEIVABLE.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.INTEREST_RECEIVABLE.getValue())
.value(receivableInterestAccountId).notNull().integerGreaterThanZero();
final Long receivableFeeAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.FEES_RECEIVABLE.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.FEES_RECEIVABLE.getValue()).value(receivableFeeAccountId)
+ LoanProductAccountingParams.FEES_RECEIVABLE.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.FEES_RECEIVABLE.getValue()).value(receivableFeeAccountId)
.notNull().integerGreaterThanZero();
final Long receivablePenaltyAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue(), element);
- baseDataValidator.reset().parameter(LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue())
+ LoanProductAccountingParams.PENALTIES_RECEIVABLE.getValue(), element);
+ baseDataValidator.reset().parameter(LoanProductAccountingParams.PENALTIES_RECEIVABLE.getValue())
.value(receivablePenaltyAccountId).notNull().integerGreaterThanZero();
}
@@ -177,57 +177,57 @@ public final class ProductToGLAccountMappingFromApiJsonDeserializer {
if (isCashBasedAccounting(accountingRuleType)) {
final Long savingsControlAccountId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_CONTROL.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_CONTROL.getValue())
+ SavingProductAccountingParams.SAVINGS_CONTROL.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.SAVINGS_CONTROL.getValue())
.value(savingsControlAccountId).notNull().integerGreaterThanZero();
final Long savingsReferenceAccountId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue())
+ SavingProductAccountingParams.SAVINGS_REFERENCE.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.SAVINGS_REFERENCE.getValue())
.value(savingsReferenceAccountId).notNull().integerGreaterThanZero();
final Long transfersInSuspenseAccountId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue())
+ SavingProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.TRANSFERS_SUSPENSE.getValue())
.value(transfersInSuspenseAccountId).notNull().integerGreaterThanZero();
final Long interestOnSavingsAccountId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_SAVINGS.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_SAVINGS.getValue())
+ SavingProductAccountingParams.INTEREST_ON_SAVINGS.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.INTEREST_ON_SAVINGS.getValue())
.value(interestOnSavingsAccountId).notNull().integerGreaterThanZero();
final Long incomeFromFeeId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue()).value(incomeFromFeeId)
+ SavingProductAccountingParams.INCOME_FROM_FEES.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.INCOME_FROM_FEES.getValue()).value(incomeFromFeeId)
.notNull().integerGreaterThanZero();
final Long incomeFromPenaltyId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue())
+ SavingProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.INCOME_FROM_PENALTIES.getValue())
.value(incomeFromPenaltyId).notNull().integerGreaterThanZero();
final Boolean isDormancyTrackingActive = this.fromApiJsonHelper.extractBooleanNamed(isDormancyTrackingActiveParamName, element);
if(null != isDormancyTrackingActive && isDormancyTrackingActive){
final Long escheatLiabilityId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.ESCHEAT_LIABILITY.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.ESCHEAT_LIABILITY.getValue())
+ SavingProductAccountingParams.ESCHEAT_LIABILITY.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.ESCHEAT_LIABILITY.getValue())
.value(escheatLiabilityId).notNull().integerGreaterThanZero();
}
if (!accountType.equals(DepositAccountType.RECURRING_DEPOSIT) && !accountType.equals(DepositAccountType.FIXED_DEPOSIT)) {
final Long overdraftAccount = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.OVERDRAFT_PORTFOLIO_CONTROL.getValue())
+ SavingProductAccountingParams.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.OVERDRAFT_PORTFOLIO_CONTROL.getValue())
.value(overdraftAccount).notNull().integerGreaterThanZero();
final Long incomeFromInterest = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_INTEREST.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_INTEREST.getValue())
+ SavingProductAccountingParams.INCOME_FROM_INTEREST.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.INCOME_FROM_INTEREST.getValue())
.value(incomeFromInterest).notNull().integerGreaterThanZero();
final Long writtenOff = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(), element);
- baseDataValidator.reset().parameter(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue()).value(writtenOff)
+ SavingProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(), element);
+ baseDataValidator.reset().parameter(SavingProductAccountingParams.LOSSES_WRITTEN_OFF.getValue()).value(writtenOff)
.notNull().integerGreaterThanZero();
}
@@ -253,23 +253,23 @@ public final class ProductToGLAccountMappingFromApiJsonDeserializer {
if (isCashBasedAccounting(accountingRuleType)) {
final Long shareReferenceId = this.fromApiJsonHelper.extractLongNamed(
- SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_REFERENCE.getValue(), element);
- baseDataValidator.reset().parameter(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_REFERENCE.getValue())
+ SharesProductAccountingParams.SHARES_REFERENCE.getValue(), element);
+ baseDataValidator.reset().parameter(SharesProductAccountingParams.SHARES_REFERENCE.getValue())
.value(shareReferenceId).notNull().integerGreaterThanZero();
final Long shareSuspenseId = this.fromApiJsonHelper.extractLongNamed(
- SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_SUSPENSE.getValue(), element);
- baseDataValidator.reset().parameter(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_SUSPENSE.getValue())
+ SharesProductAccountingParams.SHARES_SUSPENSE.getValue(), element);
+ baseDataValidator.reset().parameter(SharesProductAccountingParams.SHARES_SUSPENSE.getValue())
.value(shareSuspenseId).notNull().integerGreaterThanZero();
final Long incomeFromFeeAccountId = this.fromApiJsonHelper.extractLongNamed(
- SHARES_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), element);
- baseDataValidator.reset().parameter(SHARES_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue())
+ SharesProductAccountingParams.INCOME_FROM_FEES.getValue(), element);
+ baseDataValidator.reset().parameter(SharesProductAccountingParams.INCOME_FROM_FEES.getValue())
.value(incomeFromFeeAccountId).notNull().integerGreaterThanZero();
final Long shareEquityId = this.fromApiJsonHelper.extractLongNamed(
- SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_EQUITY.getValue(), element);
- baseDataValidator.reset().parameter(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_EQUITY.getValue())
+ SharesProductAccountingParams.SHARES_EQUITY.getValue(), element);
+ baseDataValidator.reset().parameter(SharesProductAccountingParams.SHARES_EQUITY.getValue())
.value(shareEquityId).notNull().integerGreaterThanZero();
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/LoanProductToGLAccountMappingHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/LoanProductToGLAccountMappingHelper.java
index 29673f235..04fbb6516 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/LoanProductToGLAccountMappingHelper.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/LoanProductToGLAccountMappingHelper.java
@@ -21,9 +21,9 @@ package org.apache.fineract.accounting.producttoaccountmapping.service;
import com.google.gson.JsonElement;
import java.util.HashMap;
import java.util.Map;
-import org.apache.fineract.accounting.common.AccountingConstants.ACCRUAL_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.LOAN_PRODUCT_ACCOUNTING_PARAMS;
+import org.apache.fineract.accounting.common.AccountingConstants.AccrualAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.LoanProductAccountingParams;
import org.apache.fineract.accounting.common.AccountingRuleType;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepository;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepositoryWrapper;
@@ -126,32 +126,32 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
final AccountingRuleType accountingRuleType) {
final Map changes = new HashMap<>();
- final Long fundAccountId = this.fromApiJsonHelper.extractLongNamed(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), element);
+ final Long fundAccountId = this.fromApiJsonHelper.extractLongNamed(LoanProductAccountingParams.FUND_SOURCE.getValue(), element);
final Long loanPortfolioAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), element);
+ LoanProductAccountingParams.LOAN_PORTFOLIO.getValue(), element);
final Long incomeFromInterestId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), element);
- final Long incomeFromFeeId = this.fromApiJsonHelper.extractLongNamed(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(),
+ LoanProductAccountingParams.INTEREST_ON_LOANS.getValue(), element);
+ final Long incomeFromFeeId = this.fromApiJsonHelper.extractLongNamed(LoanProductAccountingParams.INCOME_FROM_FEES.getValue(),
element);
final Long incomeFromPenaltyId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), element);
+ LoanProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), element);
final Long incomeFromRecoveryAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_RECOVERY.getValue(), element);
+ LoanProductAccountingParams.INCOME_FROM_RECOVERY.getValue(), element);
final Long writeOffAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(), element);
- final Long overPaymentAccountId = this.fromApiJsonHelper.extractLongNamed(LOAN_PRODUCT_ACCOUNTING_PARAMS.OVERPAYMENT.getValue(),
+ LoanProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(), element);
+ final Long overPaymentAccountId = this.fromApiJsonHelper.extractLongNamed(LoanProductAccountingParams.OVERPAYMENT.getValue(),
element);
final Long transfersInSuspenseAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), element);
+ LoanProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), element);
final Long receivableInterestAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_RECEIVABLE.getValue(), element);
+ LoanProductAccountingParams.INTEREST_RECEIVABLE.getValue(), element);
final Long receivableFeeAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.FEES_RECEIVABLE.getValue(), element);
+ LoanProductAccountingParams.FEES_RECEIVABLE.getValue(), element);
final Long receivablePenaltyAccountId = this.fromApiJsonHelper.extractLongNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue(), element);
+ LoanProductAccountingParams.PENALTIES_RECEIVABLE.getValue(), element);
switch (accountingRuleType) {
case NONE:
@@ -182,9 +182,9 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
final Long incomeFromRecoveryAccountId, final Long receivableInterestAccountId, final Long receivableFeeAccountId,
final Long receivablePenaltyAccountId) {
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_RECEIVABLE.getValue(), receivableInterestAccountId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.FEES_RECEIVABLE.getValue(), receivableFeeAccountId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue(), receivablePenaltyAccountId);
+ changes.put(LoanProductAccountingParams.INTEREST_RECEIVABLE.getValue(), receivableInterestAccountId);
+ changes.put(LoanProductAccountingParams.FEES_RECEIVABLE.getValue(), receivableFeeAccountId);
+ changes.put(LoanProductAccountingParams.PENALTIES_RECEIVABLE.getValue(), receivablePenaltyAccountId);
populateChangesForCashBasedAccounting(changes, fundAccountId, loanPortfolioAccountId, incomeFromInterestId, incomeFromFeeId,
incomeFromPenaltyId, writeOffAccountId, overPaymentAccountId, transfersInSuspenseAccountId, incomeFromRecoveryAccountId);
@@ -195,15 +195,15 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
final Long loanPortfolioAccountId, final Long incomeFromInterestId, final Long incomeFromFeeId, final Long incomeFromPenaltyId,
final Long writeOffAccountId, final Long overPaymentAccountId, final Long transfersInSuspenseAccountId,
final Long incomeFromRecoveryAccountId) {
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), fundAccountId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), loanPortfolioAccountId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), incomeFromInterestId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), incomeFromFeeId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), incomeFromPenaltyId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(), writeOffAccountId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.OVERPAYMENT.getValue(), overPaymentAccountId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), transfersInSuspenseAccountId);
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_RECOVERY.getValue(), incomeFromRecoveryAccountId);
+ changes.put(LoanProductAccountingParams.FUND_SOURCE.getValue(), fundAccountId);
+ changes.put(LoanProductAccountingParams.LOAN_PORTFOLIO.getValue(), loanPortfolioAccountId);
+ changes.put(LoanProductAccountingParams.INTEREST_ON_LOANS.getValue(), incomeFromInterestId);
+ changes.put(LoanProductAccountingParams.INCOME_FROM_FEES.getValue(), incomeFromFeeId);
+ changes.put(LoanProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), incomeFromPenaltyId);
+ changes.put(LoanProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(), writeOffAccountId);
+ changes.put(LoanProductAccountingParams.OVERPAYMENT.getValue(), overPaymentAccountId);
+ changes.put(LoanProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), transfersInSuspenseAccountId);
+ changes.put(LoanProductAccountingParams.INCOME_FROM_RECOVERY.getValue(), incomeFromRecoveryAccountId);
}
@@ -223,76 +223,76 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
break;
case CASH_BASED:
// asset
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.toString(), changes);
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.toString(), changes);
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE.getValue(), CASH_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE.toString(), changes);
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.FUND_SOURCE.getValue(), loanProductId,
+ CashAccountsForLoan.FUND_SOURCE.getValue(), CashAccountsForLoan.FUND_SOURCE.toString(), changes);
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.LOAN_PORTFOLIO.getValue(), loanProductId,
+ CashAccountsForLoan.LOAN_PORTFOLIO.getValue(), CashAccountsForLoan.LOAN_PORTFOLIO.toString(), changes);
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), loanProductId,
+ CashAccountsForLoan.TRANSFERS_SUSPENSE.getValue(), CashAccountsForLoan.TRANSFERS_SUSPENSE.toString(), changes);
// income
- mergeLoanToIncomeAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS.getValue(), CASH_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS.toString(), changes);
- mergeLoanToIncomeAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue(), CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.toString(), changes);
- mergeLoanToIncomeAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(),
- loanProductId, CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue(),
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.toString(), changes);
- mergeLoanToIncomeAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_RECOVERY.getValue(),
- loanProductId, CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY.getValue(),
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY.toString(), changes);
+ mergeLoanToIncomeAccountMappingChanges(element, LoanProductAccountingParams.INTEREST_ON_LOANS.getValue(), loanProductId,
+ CashAccountsForLoan.INTEREST_ON_LOANS.getValue(), CashAccountsForLoan.INTEREST_ON_LOANS.toString(), changes);
+ mergeLoanToIncomeAccountMappingChanges(element, LoanProductAccountingParams.INCOME_FROM_FEES.getValue(), loanProductId,
+ CashAccountsForLoan.INCOME_FROM_FEES.getValue(), CashAccountsForLoan.INCOME_FROM_FEES.toString(), changes);
+ mergeLoanToIncomeAccountMappingChanges(element, LoanProductAccountingParams.INCOME_FROM_PENALTIES.getValue(),
+ loanProductId, CashAccountsForLoan.INCOME_FROM_PENALTIES.getValue(),
+ CashAccountsForLoan.INCOME_FROM_PENALTIES.toString(), changes);
+ mergeLoanToIncomeAccountMappingChanges(element, LoanProductAccountingParams.INCOME_FROM_RECOVERY.getValue(),
+ loanProductId, CashAccountsForLoan.INCOME_FROM_RECOVERY.getValue(),
+ CashAccountsForLoan.INCOME_FROM_RECOVERY.toString(), changes);
// expenses
- mergeLoanToExpenseAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(),
- loanProductId, CASH_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.getValue(),
- CASH_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.toString(), changes);
+ mergeLoanToExpenseAccountMappingChanges(element, LoanProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(),
+ loanProductId, CashAccountsForLoan.LOSSES_WRITTEN_OFF.getValue(),
+ CashAccountsForLoan.LOSSES_WRITTEN_OFF.toString(), changes);
// liabilities
- mergeLoanToLiabilityAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.OVERPAYMENT.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue(), CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.toString(), changes);
+ mergeLoanToLiabilityAccountMappingChanges(element, LoanProductAccountingParams.OVERPAYMENT.getValue(), loanProductId,
+ CashAccountsForLoan.OVERPAYMENT.getValue(), CashAccountsForLoan.OVERPAYMENT.toString(), changes);
break;
case ACCRUAL_UPFRONT:
// fall through to periodic accrual
case ACCRUAL_PERIODIC:
// assets (including receivables)
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.FUND_SOURCE.toString(), changes);
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.toString(), changes);
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE.toString(),
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.FUND_SOURCE.getValue(), loanProductId,
+ AccrualAccountsForLoan.FUND_SOURCE.getValue(), AccrualAccountsForLoan.FUND_SOURCE.toString(), changes);
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.LOAN_PORTFOLIO.getValue(), loanProductId,
+ AccrualAccountsForLoan.LOAN_PORTFOLIO.getValue(), AccrualAccountsForLoan.LOAN_PORTFOLIO.toString(), changes);
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), loanProductId,
+ AccrualAccountsForLoan.TRANSFERS_SUSPENSE.getValue(), AccrualAccountsForLoan.TRANSFERS_SUSPENSE.toString(),
changes);
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_RECEIVABLE.getValue(),
- loanProductId, ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_RECEIVABLE.getValue(),
- ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_RECEIVABLE.toString(), changes);
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.FEES_RECEIVABLE.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.FEES_RECEIVABLE.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.FEES_RECEIVABLE.toString(), changes);
- mergeLoanToAssetAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue(),
- loanProductId, ACCRUAL_ACCOUNTS_FOR_LOAN.PENALTIES_RECEIVABLE.getValue(),
- ACCRUAL_ACCOUNTS_FOR_LOAN.PENALTIES_RECEIVABLE.toString(), changes);
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.INTEREST_RECEIVABLE.getValue(),
+ loanProductId, AccrualAccountsForLoan.INTEREST_RECEIVABLE.getValue(),
+ AccrualAccountsForLoan.INTEREST_RECEIVABLE.toString(), changes);
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.FEES_RECEIVABLE.getValue(), loanProductId,
+ AccrualAccountsForLoan.FEES_RECEIVABLE.getValue(), AccrualAccountsForLoan.FEES_RECEIVABLE.toString(), changes);
+ mergeLoanToAssetAccountMappingChanges(element, LoanProductAccountingParams.PENALTIES_RECEIVABLE.getValue(),
+ loanProductId, AccrualAccountsForLoan.PENALTIES_RECEIVABLE.getValue(),
+ AccrualAccountsForLoan.PENALTIES_RECEIVABLE.toString(), changes);
// income
- mergeLoanToIncomeAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS.toString(),
+ mergeLoanToIncomeAccountMappingChanges(element, LoanProductAccountingParams.INTEREST_ON_LOANS.getValue(), loanProductId,
+ AccrualAccountsForLoan.INTEREST_ON_LOANS.getValue(), AccrualAccountsForLoan.INTEREST_ON_LOANS.toString(),
changes);
- mergeLoanToIncomeAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue(), ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.toString(),
+ mergeLoanToIncomeAccountMappingChanges(element, LoanProductAccountingParams.INCOME_FROM_FEES.getValue(), loanProductId,
+ AccrualAccountsForLoan.INCOME_FROM_FEES.getValue(), AccrualAccountsForLoan.INCOME_FROM_FEES.toString(),
changes);
- mergeLoanToIncomeAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(),
- loanProductId, ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue(),
- ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.toString(), changes);
- mergeLoanToIncomeAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_RECOVERY.getValue(),
- loanProductId, ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY.getValue(),
- ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY.toString(), changes);
+ mergeLoanToIncomeAccountMappingChanges(element, LoanProductAccountingParams.INCOME_FROM_PENALTIES.getValue(),
+ loanProductId, AccrualAccountsForLoan.INCOME_FROM_PENALTIES.getValue(),
+ AccrualAccountsForLoan.INCOME_FROM_PENALTIES.toString(), changes);
+ mergeLoanToIncomeAccountMappingChanges(element, LoanProductAccountingParams.INCOME_FROM_RECOVERY.getValue(),
+ loanProductId, AccrualAccountsForLoan.INCOME_FROM_RECOVERY.getValue(),
+ AccrualAccountsForLoan.INCOME_FROM_RECOVERY.toString(), changes);
// expenses
- mergeLoanToExpenseAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(),
- loanProductId, ACCRUAL_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.getValue(),
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.toString(), changes);
+ mergeLoanToExpenseAccountMappingChanges(element, LoanProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(),
+ loanProductId, AccrualAccountsForLoan.LOSSES_WRITTEN_OFF.getValue(),
+ AccrualAccountsForLoan.LOSSES_WRITTEN_OFF.toString(), changes);
// liabilities
- mergeLoanToLiabilityAccountMappingChanges(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.OVERPAYMENT.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue(), CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.toString(), changes);
+ mergeLoanToLiabilityAccountMappingChanges(element, LoanProductAccountingParams.OVERPAYMENT.getValue(), loanProductId,
+ CashAccountsForLoan.OVERPAYMENT.getValue(), CashAccountsForLoan.OVERPAYMENT.toString(), changes);
break;
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java
index 7ed58b08d..4e22bce23 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingHelper.java
@@ -27,8 +27,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.LOAN_PRODUCT_ACCOUNTING_PARAMS;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.LoanProductAccountingParams;
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepository;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepositoryWrapper;
@@ -136,16 +136,16 @@ public class ProductToGLAccountMappingHelper {
public void savePaymentChannelToFundSourceMappings(final JsonCommand command, final JsonElement element, final Long productId,
final Map changes, final PortfolioProductType portfolioProductType) {
final JsonArray paymentChannelMappingArray = this.fromApiJsonHelper.extractJsonArrayNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(), element);
+ LoanProductAccountingParams.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(), element);
if (paymentChannelMappingArray != null) {
if (changes != null) {
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(),
- command.jsonFragment(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue()));
+ changes.put(LoanProductAccountingParams.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(),
+ command.jsonFragment(LoanProductAccountingParams.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue()));
}
for (int i = 0; i < paymentChannelMappingArray.size(); i++) {
final JsonObject jsonObject = paymentChannelMappingArray.get(i).getAsJsonObject();
- final Long paymentTypeId = jsonObject.get(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_TYPE.getValue()).getAsLong();
- final Long paymentSpecificFundAccountId = jsonObject.get(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue()).getAsLong();
+ final Long paymentTypeId = jsonObject.get(LoanProductAccountingParams.PAYMENT_TYPE.getValue()).getAsLong();
+ final Long paymentSpecificFundAccountId = jsonObject.get(LoanProductAccountingParams.FUND_SOURCE.getValue()).getAsLong();
savePaymentChannelToFundSourceMapping(productId, paymentTypeId, paymentSpecificFundAccountId, portfolioProductType);
}
}
@@ -164,21 +164,21 @@ public class ProductToGLAccountMappingHelper {
final Map changes, final PortfolioProductType portfolioProductType, final boolean isPenalty) {
String arrayName;
if (isPenalty) {
- arrayName = LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTY_INCOME_ACCOUNT_MAPPING.getValue();
+ arrayName = LoanProductAccountingParams.PENALTY_INCOME_ACCOUNT_MAPPING.getValue();
} else {
- arrayName = LOAN_PRODUCT_ACCOUNTING_PARAMS.FEE_INCOME_ACCOUNT_MAPPING.getValue();
+ arrayName = LoanProductAccountingParams.FEE_INCOME_ACCOUNT_MAPPING.getValue();
}
final JsonArray chargeToIncomeAccountMappingArray = this.fromApiJsonHelper.extractJsonArrayNamed(arrayName, element);
if (chargeToIncomeAccountMappingArray != null) {
if (changes != null) {
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.FEE_INCOME_ACCOUNT_MAPPING.getValue(),
- command.jsonFragment(LOAN_PRODUCT_ACCOUNTING_PARAMS.FEE_INCOME_ACCOUNT_MAPPING.getValue()));
+ changes.put(LoanProductAccountingParams.FEE_INCOME_ACCOUNT_MAPPING.getValue(),
+ command.jsonFragment(LoanProductAccountingParams.FEE_INCOME_ACCOUNT_MAPPING.getValue()));
}
for (int i = 0; i < chargeToIncomeAccountMappingArray.size(); i++) {
final JsonObject jsonObject = chargeToIncomeAccountMappingArray.get(i).getAsJsonObject();
- final Long chargeId = jsonObject.get(LOAN_PRODUCT_ACCOUNTING_PARAMS.CHARGE_ID.getValue()).getAsLong();
- final Long incomeAccountId = jsonObject.get(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_ACCOUNT_ID.getValue()).getAsLong();
+ final Long chargeId = jsonObject.get(LoanProductAccountingParams.CHARGE_ID.getValue()).getAsLong();
+ final Long incomeAccountId = jsonObject.get(LoanProductAccountingParams.INCOME_ACCOUNT_ID.getValue()).getAsLong();
saveChargeToFundSourceMapping(productId, chargeId, incomeAccountId, portfolioProductType, isPenalty);
}
}
@@ -199,11 +199,11 @@ public class ProductToGLAccountMappingHelper {
if (isPenalty) {
existingChargeToIncomeAccountMappings = this.accountMappingRepository.findAllPenaltyToIncomeAccountMappings(productId,
portfolioProductType.getValue());
- arrayFragmentName = LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTY_INCOME_ACCOUNT_MAPPING.getValue();
+ arrayFragmentName = LoanProductAccountingParams.PENALTY_INCOME_ACCOUNT_MAPPING.getValue();
} else {
existingChargeToIncomeAccountMappings = this.accountMappingRepository.findAllFeeToIncomeAccountMappings(productId,
portfolioProductType.getValue());
- arrayFragmentName = LOAN_PRODUCT_ACCOUNTING_PARAMS.FEE_INCOME_ACCOUNT_MAPPING.getValue();
+ arrayFragmentName = LoanProductAccountingParams.FEE_INCOME_ACCOUNT_MAPPING.getValue();
}
final JsonArray chargeToIncomeAccountMappingArray = this.fromApiJsonHelper.extractJsonArrayNamed(arrayFragmentName, element);
@@ -225,8 +225,8 @@ public class ProductToGLAccountMappingHelper {
for (int i = 0; i < chargeToIncomeAccountMappingArray.size(); i++) {
final JsonObject jsonObject = chargeToIncomeAccountMappingArray.get(i).getAsJsonObject();
- final Long chargeId = jsonObject.get(LOAN_PRODUCT_ACCOUNTING_PARAMS.CHARGE_ID.getValue()).getAsLong();
- final Long incomeAccountId = jsonObject.get(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_ACCOUNT_ID.getValue()).getAsLong();
+ final Long chargeId = jsonObject.get(LoanProductAccountingParams.CHARGE_ID.getValue()).getAsLong();
+ final Long incomeAccountId = jsonObject.get(LoanProductAccountingParams.INCOME_ACCOUNT_ID.getValue()).getAsLong();
inputChargeToIncomeAccountMap.put(chargeId, incomeAccountId);
}
@@ -252,11 +252,11 @@ public class ProductToGLAccountMappingHelper {
if (!newGLAccountId.equals(chargeToIncomeAccountMapping.getGlAccount().getId())) {
final GLAccount glAccount;
if (isPenalty) {
- glAccount = getAccountByIdAndType(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_ACCOUNT_ID.getValue(),
+ glAccount = getAccountByIdAndType(LoanProductAccountingParams.INCOME_ACCOUNT_ID.getValue(),
GLAccountType.INCOME, newGLAccountId);
} else {
List allowedAccountTypes = getAllowedAccountTypesForFeeMapping();
- glAccount = getAccountByIdAndType(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_ACCOUNT_ID.getValue(),
+ glAccount = getAccountByIdAndType(LoanProductAccountingParams.INCOME_ACCOUNT_ID.getValue(),
allowedAccountTypes, newGLAccountId);
}
chargeToIncomeAccountMapping.setGlAccount(glAccount);
@@ -292,7 +292,7 @@ public class ProductToGLAccountMappingHelper {
final List existingPaymentChannelToFundSourceMappings = this.accountMappingRepository
.findAllPaymentTypeToFundSourceMappings(productId, portfolioProductType.getValue());
final JsonArray paymentChannelMappingArray = this.fromApiJsonHelper.extractJsonArrayNamed(
- LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(), element);
+ LoanProductAccountingParams.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(), element);
/**
* Variable stores a map representation of Payment channels (key) and
* their fund sources (value) extracted from the passed in Jsoncommand
@@ -305,14 +305,14 @@ public class ProductToGLAccountMappingHelper {
final Set existingPaymentTypes = new HashSet<>();
if (paymentChannelMappingArray != null) {
if (changes != null) {
- changes.put(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(),
- command.jsonFragment(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue()));
+ changes.put(LoanProductAccountingParams.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(),
+ command.jsonFragment(LoanProductAccountingParams.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue()));
}
for (int i = 0; i < paymentChannelMappingArray.size(); i++) {
final JsonObject jsonObject = paymentChannelMappingArray.get(i).getAsJsonObject();
- final Long paymentTypeId = jsonObject.get(LOAN_PRODUCT_ACCOUNTING_PARAMS.PAYMENT_TYPE.getValue()).getAsLong();
- final Long paymentSpecificFundAccountId = jsonObject.get(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue()).getAsLong();
+ final Long paymentTypeId = jsonObject.get(LoanProductAccountingParams.PAYMENT_TYPE.getValue()).getAsLong();
+ final Long paymentSpecificFundAccountId = jsonObject.get(LoanProductAccountingParams.FUND_SOURCE.getValue()).getAsLong();
inputPaymentChannelFundSourceMap.put(paymentTypeId, paymentSpecificFundAccountId);
}
@@ -336,7 +336,7 @@ public class ProductToGLAccountMappingHelper {
if (inputPaymentChannelFundSourceMap.containsKey(currentPaymentChannelId)) {
final Long newGLAccountId = inputPaymentChannelFundSourceMap.get(currentPaymentChannelId);
if (!newGLAccountId.equals(existingPaymentChannelToFundSourceMapping.getGlAccount().getId())) {
- final GLAccount glAccount = getAccountByIdAndType(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(),
+ final GLAccount glAccount = getAccountByIdAndType(LoanProductAccountingParams.FUND_SOURCE.getValue(),
GLAccountType.ASSET, newGLAccountId);
existingPaymentChannelToFundSourceMapping.setGlAccount(glAccount);
this.accountMappingRepository.save(existingPaymentChannelToFundSourceMapping);
@@ -366,10 +366,10 @@ public class ProductToGLAccountMappingHelper {
private void savePaymentChannelToFundSourceMapping(final Long productId, final Long paymentTypeId,
final Long paymentTypeSpecificFundAccountId, final PortfolioProductType portfolioProductType) {
final PaymentType paymentType = this.paymentTypeRepositoryWrapper.findOneWithNotFoundDetection(paymentTypeId);
- final GLAccount glAccount = getAccountByIdAndType(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), GLAccountType.ASSET,
+ final GLAccount glAccount = getAccountByIdAndType(LoanProductAccountingParams.FUND_SOURCE.getValue(), GLAccountType.ASSET,
paymentTypeSpecificFundAccountId);
final ProductToGLAccountMapping accountMapping = new ProductToGLAccountMapping(glAccount, productId,
- portfolioProductType.getValue(), CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue(), paymentType);
+ portfolioProductType.getValue(), CashAccountsForLoan.FUND_SOURCE.getValue(), paymentType);
this.accountMappingRepository.save(accountMapping);
}
@@ -389,16 +389,16 @@ public class ProductToGLAccountMappingHelper {
* Both CASH and Accrual placeholders have the same value for income
* from Interest and penalties
**/
- CASH_ACCOUNTS_FOR_LOAN placeHolderAccountType;
+ CashAccountsForLoan placeHolderAccountType;
if (isPenalty) {
- glAccount = getAccountByIdAndType(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_ACCOUNT_ID.getValue(), GLAccountType.INCOME,
+ glAccount = getAccountByIdAndType(LoanProductAccountingParams.INCOME_ACCOUNT_ID.getValue(), GLAccountType.INCOME,
incomeAccountId);
- placeHolderAccountType = CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES;
+ placeHolderAccountType = CashAccountsForLoan.INCOME_FROM_PENALTIES;
} else {
List allowedAccountTypes = getAllowedAccountTypesForFeeMapping();
- glAccount = getAccountByIdAndType(LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_ACCOUNT_ID.getValue(), allowedAccountTypes,
+ glAccount = getAccountByIdAndType(LoanProductAccountingParams.INCOME_ACCOUNT_ID.getValue(), allowedAccountTypes,
incomeAccountId);
- placeHolderAccountType = CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES;
+ placeHolderAccountType = CashAccountsForLoan.INCOME_FROM_FEES;
}
final ProductToGLAccountMapping accountMapping = new ProductToGLAccountMapping(glAccount, productId,
portfolioProductType.getValue(), placeHolderAccountType.getValue(), charge);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingReadPlatformServiceImpl.java
index 4ed1ae3c1..8e7951757 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingReadPlatformServiceImpl.java
@@ -24,13 +24,13 @@ import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.apache.fineract.accounting.common.AccountingConstants.ACCRUAL_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SAVINGS;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SHARES;
-import org.apache.fineract.accounting.common.AccountingConstants.LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS;
-import org.apache.fineract.accounting.common.AccountingConstants.SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS;
-import org.apache.fineract.accounting.common.AccountingConstants.SHARES_PRODUCT_ACCOUNTING_PARAMS;
+import org.apache.fineract.accounting.common.AccountingConstants.AccrualAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForSavings;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForShares;
+import org.apache.fineract.accounting.common.AccountingConstants.LoanProductAccountingDataParams;
+import org.apache.fineract.accounting.common.AccountingConstants.SavingProductAccountingDataParams;
+import org.apache.fineract.accounting.common.AccountingConstants.SharesProductAccountingParams;
import org.apache.fineract.accounting.common.AccountingRuleType;
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
import org.apache.fineract.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
@@ -116,31 +116,31 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
for (final Map productToGLAccountMap : listOfProductToGLAccountMaps) {
final Integer financialAccountType = (Integer) productToGLAccountMap.get("financialAccountType");
- final CASH_ACCOUNTS_FOR_LOAN glAccountForLoan = CASH_ACCOUNTS_FOR_LOAN.fromInt(financialAccountType);
+ final CashAccountsForLoan glAccountForLoan = CashAccountsForLoan.fromInt(financialAccountType);
final Long glAccountId = (Long) productToGLAccountMap.get("glAccountId");
final String glAccountName = (String) productToGLAccountMap.get("glAccountName");
final String glCode = (String) productToGLAccountMap.get("glCode");
final GLAccountData gLAccountData = new GLAccountData(glAccountId, glAccountName, glCode);
- if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.FUND_SOURCE.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_FEES.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_PENALTIES.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INTEREST_ON_LOANS.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.LOAN_PORTFOLIO.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.TRANSFERS_SUSPENSE.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.LOSSES_WRITTEN_OFF.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.OVERPAYMENT.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_RECOVERY.getValue(), gLAccountData);
+ if (glAccountForLoan.equals(CashAccountsForLoan.FUND_SOURCE)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.FUND_SOURCE.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(CashAccountsForLoan.INCOME_FROM_FEES)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INCOME_FROM_FEES.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(CashAccountsForLoan.INCOME_FROM_PENALTIES)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INCOME_FROM_PENALTIES.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(CashAccountsForLoan.INTEREST_ON_LOANS)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INTEREST_ON_LOANS.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(CashAccountsForLoan.LOAN_PORTFOLIO)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.LOAN_PORTFOLIO.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(CashAccountsForLoan.TRANSFERS_SUSPENSE)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.TRANSFERS_SUSPENSE.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(CashAccountsForLoan.LOSSES_WRITTEN_OFF)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.LOSSES_WRITTEN_OFF.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(CashAccountsForLoan.OVERPAYMENT)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.OVERPAYMENT.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(CashAccountsForLoan.INCOME_FROM_RECOVERY)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INCOME_FROM_RECOVERY.getValue(), gLAccountData);
}
}
} else if (AccountingRuleType.ACCRUAL_UPFRONT.getValue().equals(accountingType)
@@ -148,37 +148,37 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
for (final Map productToGLAccountMap : listOfProductToGLAccountMaps) {
final Integer financialAccountType = (Integer) productToGLAccountMap.get("financialAccountType");
- final ACCRUAL_ACCOUNTS_FOR_LOAN glAccountForLoan = ACCRUAL_ACCOUNTS_FOR_LOAN.fromInt(financialAccountType);
+ final AccrualAccountsForLoan glAccountForLoan = AccrualAccountsForLoan.fromInt(financialAccountType);
final Long glAccountId = (Long) productToGLAccountMap.get("glAccountId");
final String glAccountName = (String) productToGLAccountMap.get("glAccountName");
final String glCode = (String) productToGLAccountMap.get("glCode");
final GLAccountData gLAccountData = new GLAccountData(glAccountId, glAccountName, glCode);
- if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.FUND_SOURCE)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.FUND_SOURCE.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_FEES.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_PENALTIES.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INTEREST_ON_LOANS.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.LOAN_PORTFOLIO.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.OVERPAYMENT)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.OVERPAYMENT.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.TRANSFERS_SUSPENSE.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.LOSSES_WRITTEN_OFF.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_RECEIVABLE)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INTEREST_RECEIVABLE.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.FEES_RECEIVABLE)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.FEES_RECEIVABLE.getValue(), gLAccountData);
- } else if (glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.PENALTIES_RECEIVABLE)) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.PENALTIES_RECEIVABLE.getValue(), gLAccountData);
- } else if ((glAccountForLoan.equals(ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY))) {
- accountMappingDetails.put(LOAN_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_RECOVERY.getValue(), gLAccountData);
+ if (glAccountForLoan.equals(AccrualAccountsForLoan.FUND_SOURCE)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.FUND_SOURCE.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.INCOME_FROM_FEES)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INCOME_FROM_FEES.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.INCOME_FROM_PENALTIES)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INCOME_FROM_PENALTIES.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.INTEREST_ON_LOANS)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INTEREST_ON_LOANS.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.LOAN_PORTFOLIO)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.LOAN_PORTFOLIO.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.OVERPAYMENT)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.OVERPAYMENT.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.TRANSFERS_SUSPENSE)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.TRANSFERS_SUSPENSE.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.LOSSES_WRITTEN_OFF)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.LOSSES_WRITTEN_OFF.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.INTEREST_RECEIVABLE)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INTEREST_RECEIVABLE.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.FEES_RECEIVABLE)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.FEES_RECEIVABLE.getValue(), gLAccountData);
+ } else if (glAccountForLoan.equals(AccrualAccountsForLoan.PENALTIES_RECEIVABLE)) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.PENALTIES_RECEIVABLE.getValue(), gLAccountData);
+ } else if ((glAccountForLoan.equals(AccrualAccountsForLoan.INCOME_FROM_RECOVERY))) {
+ accountMappingDetails.put(LoanProductAccountingDataParams.INCOME_FROM_RECOVERY.getValue(), gLAccountData);
}
}
@@ -202,33 +202,33 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
for (final Map productToGLAccountMap : listOfProductToGLAccountMaps) {
final Integer financialAccountType = (Integer) productToGLAccountMap.get("financialAccountType");
- final CASH_ACCOUNTS_FOR_SAVINGS glAccountForSavings = CASH_ACCOUNTS_FOR_SAVINGS.fromInt(financialAccountType);
+ final CashAccountsForSavings glAccountForSavings = CashAccountsForSavings.fromInt(financialAccountType);
final Long glAccountId = (Long) productToGLAccountMap.get("glAccountId");
final String glAccountName = (String) productToGLAccountMap.get("glAccountName");
final String glCode = (String) productToGLAccountMap.get("glCode");
final GLAccountData gLAccountData = new GLAccountData(glAccountId, glAccountName, glCode);
- if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.SAVINGS_REFERENCE.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.SAVINGS_CONTROL.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_FEES.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_PENALTIES)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_PENALTIES.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.TRANSFERS_SUSPENSE)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.TRANSFERS_SUSPENSE.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.INTEREST_ON_SAVINGS.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.LOSSES_WRITTEN_OFF)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.LOSSES_WRITTEN_OFF.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_INTEREST)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.INCOME_FROM_INTEREST.getValue(), gLAccountData);
- } else if (glAccountForSavings.equals(CASH_ACCOUNTS_FOR_SAVINGS.ESCHEAT_LIABILITY)) {
- accountMappingDetails.put(SAVINGS_PRODUCT_ACCOUNTING_DATA_PARAMS.ESCHEAT_LIABILITY.getValue(), gLAccountData);
+ if (glAccountForSavings.equals(CashAccountsForSavings.SAVINGS_REFERENCE)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.SAVINGS_REFERENCE.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.SAVINGS_CONTROL)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.SAVINGS_CONTROL.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.INCOME_FROM_FEES)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.INCOME_FROM_FEES.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.INCOME_FROM_PENALTIES)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.INCOME_FROM_PENALTIES.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.TRANSFERS_SUSPENSE)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.TRANSFERS_SUSPENSE.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.INTEREST_ON_SAVINGS)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.INTEREST_ON_SAVINGS.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.LOSSES_WRITTEN_OFF)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.LOSSES_WRITTEN_OFF.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.INCOME_FROM_INTEREST)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.INCOME_FROM_INTEREST.getValue(), gLAccountData);
+ } else if (glAccountForSavings.equals(CashAccountsForSavings.ESCHEAT_LIABILITY)) {
+ accountMappingDetails.put(SavingProductAccountingDataParams.ESCHEAT_LIABILITY.getValue(), gLAccountData);
}
}
}
@@ -343,21 +343,21 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
if (AccountingRuleType.CASH_BASED.getValue().equals(accountingType)) {
for (final Map productToGLAccountMap : listOfProductToGLAccountMaps) {
final Integer financialAccountType = (Integer) productToGLAccountMap.get("financialAccountType");
- final CASH_ACCOUNTS_FOR_SHARES glAccountForShares = CASH_ACCOUNTS_FOR_SHARES.fromInt(financialAccountType);
+ final CashAccountsForShares glAccountForShares = CashAccountsForShares.fromInt(financialAccountType);
final Long glAccountId = (Long) productToGLAccountMap.get("glAccountId");
final String glAccountName = (String) productToGLAccountMap.get("glAccountName");
final String glCode = (String) productToGLAccountMap.get("glCode");
final GLAccountData gLAccountData = new GLAccountData(glAccountId, glAccountName, glCode);
- if (glAccountForShares.equals(CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE)) {
- accountMappingDetails.put(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_REFERENCE.getValue(), gLAccountData);
- } else if (glAccountForShares.equals(CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE)) {
- accountMappingDetails.put(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_SUSPENSE.getValue(), gLAccountData);
- } else if (glAccountForShares.equals(CASH_ACCOUNTS_FOR_SHARES.INCOME_FROM_FEES)) {
- accountMappingDetails.put(SHARES_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), gLAccountData);
- } else if (glAccountForShares.equals(CASH_ACCOUNTS_FOR_SHARES.SHARES_EQUITY)) {
- accountMappingDetails.put(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_EQUITY.getValue(), gLAccountData);
+ if (glAccountForShares.equals(CashAccountsForShares.SHARES_REFERENCE)) {
+ accountMappingDetails.put(SharesProductAccountingParams.SHARES_REFERENCE.getValue(), gLAccountData);
+ } else if (glAccountForShares.equals(CashAccountsForShares.SHARES_SUSPENSE)) {
+ accountMappingDetails.put(SharesProductAccountingParams.SHARES_SUSPENSE.getValue(), gLAccountData);
+ } else if (glAccountForShares.equals(CashAccountsForShares.INCOME_FROM_FEES)) {
+ accountMappingDetails.put(SharesProductAccountingParams.INCOME_FROM_FEES.getValue(), gLAccountData);
+ } else if (glAccountForShares.equals(CashAccountsForShares.SHARES_EQUITY)) {
+ accountMappingDetails.put(SharesProductAccountingParams.SHARES_EQUITY.getValue(), gLAccountData);
}
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingWritePlatformServiceImpl.java
index 4fdf3091a..044f20c71 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingWritePlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingWritePlatformServiceImpl.java
@@ -25,13 +25,13 @@ import com.google.gson.JsonElement;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
-import org.apache.fineract.accounting.common.AccountingConstants.ACCRUAL_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_LOAN;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SAVINGS;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SHARES;
-import org.apache.fineract.accounting.common.AccountingConstants.LOAN_PRODUCT_ACCOUNTING_PARAMS;
-import org.apache.fineract.accounting.common.AccountingConstants.SAVINGS_PRODUCT_ACCOUNTING_PARAMS;
-import org.apache.fineract.accounting.common.AccountingConstants.SHARES_PRODUCT_ACCOUNTING_PARAMS;
+import org.apache.fineract.accounting.common.AccountingConstants.AccrualAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForLoan;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForSavings;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForShares;
+import org.apache.fineract.accounting.common.AccountingConstants.LoanProductAccountingParams;
+import org.apache.fineract.accounting.common.AccountingConstants.SavingProductAccountingParams;
+import org.apache.fineract.accounting.common.AccountingConstants.SharesProductAccountingParams;
import org.apache.fineract.accounting.common.AccountingRuleType;
import org.apache.fineract.accounting.producttoaccountmapping.serialization.ProductToGLAccountMappingFromApiJsonDeserializer;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
@@ -76,38 +76,38 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
case CASH_BASED:
// asset
this.loanProductToGLAccountMappingHelper
- .saveLoanToAssetAccountMapping(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue());
+ .saveLoanToAssetAccountMapping(element, LoanProductAccountingParams.FUND_SOURCE.getValue(), loanProductId,
+ CashAccountsForLoan.FUND_SOURCE.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToAssetAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue());
+ LoanProductAccountingParams.LOAN_PORTFOLIO.getValue(), loanProductId,
+ CashAccountsForLoan.LOAN_PORTFOLIO.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToAssetAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE.getValue());
+ LoanProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), loanProductId,
+ CashAccountsForLoan.TRANSFERS_SUSPENSE.getValue());
// income
this.loanProductToGLAccountMappingHelper.saveLoanToIncomeAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS.getValue());
+ LoanProductAccountingParams.INTEREST_ON_LOANS.getValue(), loanProductId,
+ CashAccountsForLoan.INTEREST_ON_LOANS.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToIncomeAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue());
+ LoanProductAccountingParams.INCOME_FROM_FEES.getValue(), loanProductId,
+ CashAccountsForLoan.INCOME_FROM_FEES.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToIncomeAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue());
+ LoanProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), loanProductId,
+ CashAccountsForLoan.INCOME_FROM_PENALTIES.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToIncomeAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_RECOVERY.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY.getValue());
+ LoanProductAccountingParams.INCOME_FROM_RECOVERY.getValue(), loanProductId,
+ CashAccountsForLoan.INCOME_FROM_RECOVERY.getValue());
// expenses
this.loanProductToGLAccountMappingHelper.saveLoanToExpenseAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.getValue());
+ LoanProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(), loanProductId,
+ CashAccountsForLoan.LOSSES_WRITTEN_OFF.getValue());
// liabilities
this.loanProductToGLAccountMappingHelper
- .saveLoanToLiabilityAccountMapping(element, LOAN_PRODUCT_ACCOUNTING_PARAMS.OVERPAYMENT.getValue(), loanProductId,
- CASH_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue());
+ .saveLoanToLiabilityAccountMapping(element, LoanProductAccountingParams.OVERPAYMENT.getValue(), loanProductId,
+ CashAccountsForLoan.OVERPAYMENT.getValue());
// advanced accounting mappings
this.loanProductToGLAccountMappingHelper.savePaymentChannelToFundSourceMappings(command, element, loanProductId, null);
@@ -118,47 +118,47 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
case ACCRUAL_PERIODIC:
// assets (including receivables)
this.loanProductToGLAccountMappingHelper.saveLoanToAssetAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.FUND_SOURCE.getValue());
+ LoanProductAccountingParams.FUND_SOURCE.getValue(), loanProductId,
+ AccrualAccountsForLoan.FUND_SOURCE.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToAssetAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.LOAN_PORTFOLIO.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOAN_PORTFOLIO.getValue());
+ LoanProductAccountingParams.LOAN_PORTFOLIO.getValue(), loanProductId,
+ AccrualAccountsForLoan.LOAN_PORTFOLIO.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToAssetAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.TRANSFERS_SUSPENSE.getValue());
+ LoanProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), loanProductId,
+ AccrualAccountsForLoan.TRANSFERS_SUSPENSE.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToAssetAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_RECEIVABLE.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_RECEIVABLE.getValue());
+ LoanProductAccountingParams.INTEREST_RECEIVABLE.getValue(), loanProductId,
+ AccrualAccountsForLoan.INTEREST_RECEIVABLE.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToAssetAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.FEES_RECEIVABLE.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.FEES_RECEIVABLE.getValue());
+ LoanProductAccountingParams.FEES_RECEIVABLE.getValue(), loanProductId,
+ AccrualAccountsForLoan.FEES_RECEIVABLE.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToAssetAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.PENALTIES_RECEIVABLE.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.PENALTIES_RECEIVABLE.getValue());
+ LoanProductAccountingParams.PENALTIES_RECEIVABLE.getValue(), loanProductId,
+ AccrualAccountsForLoan.PENALTIES_RECEIVABLE.getValue());
// income
this.loanProductToGLAccountMappingHelper.saveLoanToIncomeAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_LOANS.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INTEREST_ON_LOANS.getValue());
+ LoanProductAccountingParams.INTEREST_ON_LOANS.getValue(), loanProductId,
+ AccrualAccountsForLoan.INTEREST_ON_LOANS.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToIncomeAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_FEES.getValue());
+ LoanProductAccountingParams.INCOME_FROM_FEES.getValue(), loanProductId,
+ AccrualAccountsForLoan.INCOME_FROM_FEES.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToIncomeAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_PENALTIES.getValue());
+ LoanProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), loanProductId,
+ AccrualAccountsForLoan.INCOME_FROM_PENALTIES.getValue());
this.loanProductToGLAccountMappingHelper.saveLoanToIncomeAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_RECOVERY.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.INCOME_FROM_RECOVERY.getValue());
+ LoanProductAccountingParams.INCOME_FROM_RECOVERY.getValue(), loanProductId,
+ AccrualAccountsForLoan.INCOME_FROM_RECOVERY.getValue());
// expenses
this.loanProductToGLAccountMappingHelper.saveLoanToExpenseAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.LOSSES_WRITTEN_OFF.getValue());
+ LoanProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(), loanProductId,
+ AccrualAccountsForLoan.LOSSES_WRITTEN_OFF.getValue());
// liabilities
this.loanProductToGLAccountMappingHelper.saveLoanToLiabilityAccountMapping(element,
- LOAN_PRODUCT_ACCOUNTING_PARAMS.OVERPAYMENT.getValue(), loanProductId,
- ACCRUAL_ACCOUNTS_FOR_LOAN.OVERPAYMENT.getValue());
+ LoanProductAccountingParams.OVERPAYMENT.getValue(), loanProductId,
+ AccrualAccountsForLoan.OVERPAYMENT.getValue());
// advanced accounting mappings
this.loanProductToGLAccountMappingHelper.savePaymentChannelToFundSourceMappings(command, element, loanProductId, null);
@@ -181,54 +181,54 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
case CASH_BASED:
// asset
this.savingsProductToGLAccountMappingHelper.saveSavingsToAssetAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue());
+ SavingProductAccountingParams.SAVINGS_REFERENCE.getValue(), savingProductId,
+ CashAccountsForSavings.SAVINGS_REFERENCE.getValue());
if (!accountType.equals(DepositAccountType.RECURRING_DEPOSIT) && !accountType.equals(DepositAccountType.FIXED_DEPOSIT)) {
this.savingsProductToGLAccountMappingHelper.saveSavingsToAssetAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.getValue());
+ SavingProductAccountingParams.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), savingProductId,
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.getValue());
}
// income
this.savingsProductToGLAccountMappingHelper.saveSavingsToIncomeAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES.getValue());
+ SavingProductAccountingParams.INCOME_FROM_FEES.getValue(), savingProductId,
+ CashAccountsForSavings.INCOME_FROM_FEES.getValue());
this.savingsProductToGLAccountMappingHelper.saveSavingsToIncomeAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_PENALTIES.getValue());
+ SavingProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), savingProductId,
+ CashAccountsForSavings.INCOME_FROM_PENALTIES.getValue());
if (!accountType.equals(DepositAccountType.RECURRING_DEPOSIT) && !accountType.equals(DepositAccountType.FIXED_DEPOSIT)) {
this.savingsProductToGLAccountMappingHelper.saveSavingsToIncomeAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_INTEREST.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_INTEREST.getValue());
+ SavingProductAccountingParams.INCOME_FROM_INTEREST.getValue(), savingProductId,
+ CashAccountsForSavings.INCOME_FROM_INTEREST.getValue());
}
// expenses
this.savingsProductToGLAccountMappingHelper.saveSavingsToExpenseAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_SAVINGS.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS.getValue());
+ SavingProductAccountingParams.INTEREST_ON_SAVINGS.getValue(), savingProductId,
+ CashAccountsForSavings.INTEREST_ON_SAVINGS.getValue());
if (!accountType.equals(DepositAccountType.RECURRING_DEPOSIT) && !accountType.equals(DepositAccountType.FIXED_DEPOSIT)) {
this.savingsProductToGLAccountMappingHelper.saveSavingsToExpenseAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.LOSSES_WRITTEN_OFF.getValue());
+ SavingProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(), savingProductId,
+ CashAccountsForSavings.LOSSES_WRITTEN_OFF.getValue());
}
// liability
this.savingsProductToGLAccountMappingHelper.saveSavingsToLiabilityAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_CONTROL.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue());
+ SavingProductAccountingParams.SAVINGS_CONTROL.getValue(), savingProductId,
+ CashAccountsForSavings.SAVINGS_CONTROL.getValue());
this.savingsProductToGLAccountMappingHelper.saveSavingsToLiabilityAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.TRANSFERS_SUSPENSE.getValue());
+ SavingProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), savingProductId,
+ CashAccountsForSavings.TRANSFERS_SUSPENSE.getValue());
final Boolean isDormancyTrackingActive = this.fromApiJsonHelper.extractBooleanNamed(isDormancyTrackingActiveParamName, element);
if(null != isDormancyTrackingActive && isDormancyTrackingActive){
this.savingsProductToGLAccountMappingHelper.saveSavingsToLiabilityAccountMapping(element,
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.ESCHEAT_LIABILITY.getValue(), savingProductId,
- CASH_ACCOUNTS_FOR_SAVINGS.ESCHEAT_LIABILITY.getValue());
+ SavingProductAccountingParams.ESCHEAT_LIABILITY.getValue(), savingProductId,
+ CashAccountsForSavings.ESCHEAT_LIABILITY.getValue());
}
// advanced accounting mappings
@@ -257,23 +257,23 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
case CASH_BASED:
// asset
this.shareProductToGLAccountMappingHelper.saveSharesToAssetAccountMapping(element,
- SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_REFERENCE.getValue(), shareProductId,
- CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue());
+ SharesProductAccountingParams.SHARES_REFERENCE.getValue(), shareProductId,
+ CashAccountsForShares.SHARES_REFERENCE.getValue());
// income
this.shareProductToGLAccountMappingHelper.saveSharesToIncomeAccountMapping(element,
- SHARES_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), shareProductId,
- CASH_ACCOUNTS_FOR_SHARES.INCOME_FROM_FEES.getValue());
+ SharesProductAccountingParams.INCOME_FROM_FEES.getValue(), shareProductId,
+ CashAccountsForShares.INCOME_FROM_FEES.getValue());
// expenses
this.shareProductToGLAccountMappingHelper.saveSharesToEquityAccountMapping(element,
- SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_EQUITY.getValue(), shareProductId,
- CASH_ACCOUNTS_FOR_SHARES.SHARES_EQUITY.getValue());
+ SharesProductAccountingParams.SHARES_EQUITY.getValue(), shareProductId,
+ CashAccountsForShares.SHARES_EQUITY.getValue());
// liability
this.shareProductToGLAccountMappingHelper.saveSharesToLiabilityAccountMapping(element,
- SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_SUSPENSE.getValue(), shareProductId,
- CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE.getValue());
+ SharesProductAccountingParams.SHARES_SUSPENSE.getValue(), shareProductId,
+ CashAccountsForShares.SHARES_SUSPENSE.getValue());
// advanced accounting mappings
this.savingsProductToGLAccountMappingHelper.savePaymentChannelToFundSourceMappings(command, element, shareProductId, null);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java
index e3fb81a67..c8c0b7f94 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/SavingsProductToGLAccountMappingHelper.java
@@ -21,8 +21,8 @@ package org.apache.fineract.accounting.producttoaccountmapping.service;
import com.google.gson.JsonElement;
import java.util.HashMap;
import java.util.Map;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SAVINGS;
-import org.apache.fineract.accounting.common.AccountingConstants.SAVINGS_PRODUCT_ACCOUNTING_PARAMS;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForSavings;
+import org.apache.fineract.accounting.common.AccountingConstants.SavingProductAccountingParams;
import org.apache.fineract.accounting.common.AccountingRuleType;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepository;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepositoryWrapper;
@@ -133,36 +133,36 @@ public class SavingsProductToGLAccountMappingHelper extends ProductToGLAccountMa
final Map changes = new HashMap<>();
final Long savingsReferenceId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue(), element);
+ SavingProductAccountingParams.SAVINGS_REFERENCE.getValue(), element);
final Long incomeFromFeesId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), element);
+ SavingProductAccountingParams.INCOME_FROM_FEES.getValue(), element);
final Long incomeFromPenaltiesId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), element);
+ SavingProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), element);
final Long interestOnSavingsId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_SAVINGS.getValue(), element);
- final Long savingsControlId = this.fromApiJsonHelper.extractLongNamed(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_CONTROL.getValue(),
+ SavingProductAccountingParams.INTEREST_ON_SAVINGS.getValue(), element);
+ final Long savingsControlId = this.fromApiJsonHelper.extractLongNamed(SavingProductAccountingParams.SAVINGS_CONTROL.getValue(),
element);
final Long transfersInSuspenseAccountId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), element);
+ SavingProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), element);
final Long overdraftControlId = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), element);
+ SavingProductAccountingParams.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), element);
final Long incomeFromInterest = this.fromApiJsonHelper.extractLongNamed(
- SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_INTEREST.getValue(), element);
- final Long writeOffId = this.fromApiJsonHelper.extractLongNamed(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(),
+ SavingProductAccountingParams.INCOME_FROM_INTEREST.getValue(), element);
+ final Long writeOffId = this.fromApiJsonHelper.extractLongNamed(SavingProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(),
element);
switch (accountingRuleType) {
case NONE:
break;
case CASH_BASED:
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_CONTROL.getValue(), savingsControlId);
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue(), savingsReferenceId);
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_SAVINGS.getValue(), interestOnSavingsId);
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), incomeFromFeesId);
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(), incomeFromPenaltiesId);
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(), transfersInSuspenseAccountId);
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), overdraftControlId);
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_INTEREST.getValue(), incomeFromInterest);
- changes.put(SAVINGS_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(), writeOffId);
+ changes.put(SavingProductAccountingParams.SAVINGS_CONTROL.getValue(), savingsControlId);
+ changes.put(SavingProductAccountingParams.SAVINGS_REFERENCE.getValue(), savingsReferenceId);
+ changes.put(SavingProductAccountingParams.INTEREST_ON_SAVINGS.getValue(), interestOnSavingsId);
+ changes.put(SavingProductAccountingParams.INCOME_FROM_FEES.getValue(), incomeFromFeesId);
+ changes.put(SavingProductAccountingParams.INCOME_FROM_PENALTIES.getValue(), incomeFromPenaltiesId);
+ changes.put(SavingProductAccountingParams.TRANSFERS_SUSPENSE.getValue(), transfersInSuspenseAccountId);
+ changes.put(SavingProductAccountingParams.OVERDRAFT_PORTFOLIO_CONTROL.getValue(), overdraftControlId);
+ changes.put(SavingProductAccountingParams.INCOME_FROM_INTEREST.getValue(), incomeFromInterest);
+ changes.put(SavingProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(), writeOffId);
break;
case ACCRUAL_PERIODIC:
break;
@@ -190,44 +190,44 @@ public class SavingsProductToGLAccountMappingHelper extends ProductToGLAccountMa
break;
case CASH_BASED:
// asset
- mergeSavingsToAssetAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_REFERENCE.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_REFERENCE.toString(), changes);
+ mergeSavingsToAssetAccountMappingChanges(element, SavingProductAccountingParams.SAVINGS_REFERENCE.getValue(),
+ savingsProductId, CashAccountsForSavings.SAVINGS_REFERENCE.getValue(),
+ CashAccountsForSavings.SAVINGS_REFERENCE.toString(), changes);
- mergeSavingsToAssetAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.OVERDRAFT_PORTFOLIO_CONTROL.toString(), changes);
+ mergeSavingsToAssetAccountMappingChanges(element, SavingProductAccountingParams.OVERDRAFT_PORTFOLIO_CONTROL.getValue(),
+ savingsProductId, CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.getValue(),
+ CashAccountsForSavings.OVERDRAFT_PORTFOLIO_CONTROL.toString(), changes);
// income
- mergeSavingsToIncomeAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_FEES.toString(), changes);
+ mergeSavingsToIncomeAccountMappingChanges(element, SavingProductAccountingParams.INCOME_FROM_FEES.getValue(),
+ savingsProductId, CashAccountsForSavings.INCOME_FROM_FEES.getValue(),
+ CashAccountsForSavings.INCOME_FROM_FEES.toString(), changes);
- mergeSavingsToIncomeAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_PENALTIES.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_PENALTIES.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_PENALTIES.toString(), changes);
+ mergeSavingsToIncomeAccountMappingChanges(element, SavingProductAccountingParams.INCOME_FROM_PENALTIES.getValue(),
+ savingsProductId, CashAccountsForSavings.INCOME_FROM_PENALTIES.getValue(),
+ CashAccountsForSavings.INCOME_FROM_PENALTIES.toString(), changes);
- mergeSavingsToIncomeAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_INTEREST.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_INTEREST.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.INCOME_FROM_INTEREST.toString(), changes);
+ mergeSavingsToIncomeAccountMappingChanges(element, SavingProductAccountingParams.INCOME_FROM_INTEREST.getValue(),
+ savingsProductId, CashAccountsForSavings.INCOME_FROM_INTEREST.getValue(),
+ CashAccountsForSavings.INCOME_FROM_INTEREST.toString(), changes);
// expenses
- mergeSavingsToExpenseAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.INTEREST_ON_SAVINGS.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.INTEREST_ON_SAVINGS.toString(), changes);
- mergeSavingsToExpenseAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.LOSSES_WRITTEN_OFF.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.LOSSES_WRITTEN_OFF.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.LOSSES_WRITTEN_OFF.toString(), changes);
+ mergeSavingsToExpenseAccountMappingChanges(element, SavingProductAccountingParams.INTEREST_ON_SAVINGS.getValue(),
+ savingsProductId, CashAccountsForSavings.INTEREST_ON_SAVINGS.getValue(),
+ CashAccountsForSavings.INTEREST_ON_SAVINGS.toString(), changes);
+ mergeSavingsToExpenseAccountMappingChanges(element, SavingProductAccountingParams.LOSSES_WRITTEN_OFF.getValue(),
+ savingsProductId, CashAccountsForSavings.LOSSES_WRITTEN_OFF.getValue(),
+ CashAccountsForSavings.LOSSES_WRITTEN_OFF.toString(), changes);
// liability
- mergeSavingsToLiabilityAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.SAVINGS_CONTROL.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.SAVINGS_CONTROL.toString(), changes);
- mergeSavingsToLiabilityAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.TRANSFERS_SUSPENSE.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.TRANSFERS_SUSPENSE.getValue(),
- CASH_ACCOUNTS_FOR_SAVINGS.TRANSFERS_SUSPENSE.toString(), changes);
- createOrmergeSavingsToLiabilityAccountMappingChanges(element, SAVINGS_PRODUCT_ACCOUNTING_PARAMS.ESCHEAT_LIABILITY.getValue(),
- savingsProductId, CASH_ACCOUNTS_FOR_SAVINGS.ESCHEAT_LIABILITY.getValue(),
+ mergeSavingsToLiabilityAccountMappingChanges(element, SavingProductAccountingParams.SAVINGS_CONTROL.getValue(),
+ savingsProductId, CashAccountsForSavings.SAVINGS_CONTROL.getValue(),
+ CashAccountsForSavings.SAVINGS_CONTROL.toString(), changes);
+ mergeSavingsToLiabilityAccountMappingChanges(element, SavingProductAccountingParams.TRANSFERS_SUSPENSE.getValue(),
+ savingsProductId, CashAccountsForSavings.TRANSFERS_SUSPENSE.getValue(),
+ CashAccountsForSavings.TRANSFERS_SUSPENSE.toString(), changes);
+ createOrmergeSavingsToLiabilityAccountMappingChanges(element, SavingProductAccountingParams.ESCHEAT_LIABILITY.getValue(),
+ savingsProductId, CashAccountsForSavings.ESCHEAT_LIABILITY.getValue(),
changes);
break;
case ACCRUAL_PERIODIC:
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java
index 7337f956a..93a414cfa 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ShareProductToGLAccountMappingHelper.java
@@ -21,8 +21,8 @@ package org.apache.fineract.accounting.producttoaccountmapping.service;
import com.google.gson.JsonElement;
import java.util.HashMap;
import java.util.Map;
-import org.apache.fineract.accounting.common.AccountingConstants.CASH_ACCOUNTS_FOR_SHARES;
-import org.apache.fineract.accounting.common.AccountingConstants.SHARES_PRODUCT_ACCOUNTING_PARAMS;
+import org.apache.fineract.accounting.common.AccountingConstants.CashAccountsForShares;
+import org.apache.fineract.accounting.common.AccountingConstants.SharesProductAccountingParams;
import org.apache.fineract.accounting.common.AccountingRuleType;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepository;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepositoryWrapper;
@@ -124,23 +124,23 @@ public class ShareProductToGLAccountMappingHelper extends ProductToGLAccountMapp
final AccountingRuleType accountingRuleType) {
final Map changes = new HashMap<>();
- final Long shareReferenceId = this.fromApiJsonHelper.extractLongNamed(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_REFERENCE.getValue(),
+ final Long shareReferenceId = this.fromApiJsonHelper.extractLongNamed(SharesProductAccountingParams.SHARES_REFERENCE.getValue(),
element);
final Long incomeFromFeeAccountId = this.fromApiJsonHelper.extractLongNamed(
- SHARES_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), element);
- final Long shareSuspenseId = this.fromApiJsonHelper.extractLongNamed(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_SUSPENSE.getValue(),
+ SharesProductAccountingParams.INCOME_FROM_FEES.getValue(), element);
+ final Long shareSuspenseId = this.fromApiJsonHelper.extractLongNamed(SharesProductAccountingParams.SHARES_SUSPENSE.getValue(),
element);
- final Long shareEquityId = this.fromApiJsonHelper.extractLongNamed(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_EQUITY.getValue(),
+ final Long shareEquityId = this.fromApiJsonHelper.extractLongNamed(SharesProductAccountingParams.SHARES_EQUITY.getValue(),
element);
switch (accountingRuleType) {
case NONE:
break;
case CASH_BASED:
- changes.put(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_REFERENCE.getValue(), shareReferenceId);
- changes.put(SHARES_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(), incomeFromFeeAccountId);
- changes.put(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_SUSPENSE.getValue(), shareSuspenseId);
- changes.put(SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_EQUITY.getValue(), shareEquityId);
+ changes.put(SharesProductAccountingParams.SHARES_REFERENCE.getValue(), shareReferenceId);
+ changes.put(SharesProductAccountingParams.INCOME_FROM_FEES.getValue(), incomeFromFeeAccountId);
+ changes.put(SharesProductAccountingParams.SHARES_SUSPENSE.getValue(), shareSuspenseId);
+ changes.put(SharesProductAccountingParams.SHARES_EQUITY.getValue(), shareEquityId);
break;
case ACCRUAL_PERIODIC:
break;
@@ -168,24 +168,24 @@ public class ShareProductToGLAccountMappingHelper extends ProductToGLAccountMapp
break;
case CASH_BASED:
// asset
- mergeSharesToAssetAccountMappingChanges(element, SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_REFERENCE.getValue(),
- sharesProductId, CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.getValue(),
- CASH_ACCOUNTS_FOR_SHARES.SHARES_REFERENCE.toString(), changes);
+ mergeSharesToAssetAccountMappingChanges(element, SharesProductAccountingParams.SHARES_REFERENCE.getValue(),
+ sharesProductId, CashAccountsForShares.SHARES_REFERENCE.getValue(),
+ CashAccountsForShares.SHARES_REFERENCE.toString(), changes);
// income
- mergeSharesToIncomeAccountMappingChanges(element, SHARES_PRODUCT_ACCOUNTING_PARAMS.INCOME_FROM_FEES.getValue(),
- sharesProductId, CASH_ACCOUNTS_FOR_SHARES.INCOME_FROM_FEES.getValue(),
- CASH_ACCOUNTS_FOR_SHARES.INCOME_FROM_FEES.toString(), changes);
+ mergeSharesToIncomeAccountMappingChanges(element, SharesProductAccountingParams.INCOME_FROM_FEES.getValue(),
+ sharesProductId, CashAccountsForShares.INCOME_FROM_FEES.getValue(),
+ CashAccountsForShares.INCOME_FROM_FEES.toString(), changes);
// liability
- mergeSharesToLiabilityAccountMappingChanges(element, SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_SUSPENSE.getValue(),
- sharesProductId, CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE.getValue(),
- CASH_ACCOUNTS_FOR_SHARES.SHARES_SUSPENSE.toString(), changes);
+ mergeSharesToLiabilityAccountMappingChanges(element, SharesProductAccountingParams.SHARES_SUSPENSE.getValue(),
+ sharesProductId, CashAccountsForShares.SHARES_SUSPENSE.getValue(),
+ CashAccountsForShares.SHARES_SUSPENSE.toString(), changes);
// equity
- mergeSharesToEquityAccountMappingChanges(element, SHARES_PRODUCT_ACCOUNTING_PARAMS.SHARES_EQUITY.getValue(),
- sharesProductId, CASH_ACCOUNTS_FOR_SHARES.SHARES_EQUITY.getValue(),
- CASH_ACCOUNTS_FOR_SHARES.SHARES_EQUITY.toString(), changes);
+ mergeSharesToEquityAccountMappingChanges(element, SharesProductAccountingParams.SHARES_EQUITY.getValue(),
+ sharesProductId, CashAccountsForShares.SHARES_EQUITY.getValue(),
+ CashAccountsForShares.SHARES_EQUITY.toString(), changes);
break;
case ACCRUAL_PERIODIC:
break;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleInvalidException.java b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleInvalidException.java
index 3c9d97b2d..eb2fee7df 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleInvalidException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/accounting/rule/exception/AccountingRuleInvalidException.java
@@ -27,7 +27,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class AccountingRuleInvalidException extends AbstractPlatformDomainRuleException {
/*** enum of reasons for invalid Accounting Closure **/
- public static enum GL_CLOSURE_INVALID_REASON {
+ public static enum GlClosureInvalidReason {
FUTURE_DATE, ACCOUNTING_CLOSED;
public String errorMessage() {
@@ -45,7 +45,7 @@ public class AccountingRuleInvalidException extends AbstractPlatformDomainRuleEx
}
}
- public AccountingRuleInvalidException(final GL_CLOSURE_INVALID_REASON reason, final Date date) {
+ public AccountingRuleInvalidException(final GlClosureInvalidReason reason, final Date date) {
super(reason.errorCode(), reason.errorMessage(), date);
}
}
\ No newline at end of file
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/service/BulkImportWorkbookServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/service/BulkImportWorkbookServiceImpl.java
index 28d55a8b1..f25d1debd 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/service/BulkImportWorkbookServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/service/BulkImportWorkbookServiceImpl.java
@@ -199,7 +199,7 @@ public class BulkImportWorkbookServiceImpl implements BulkImportWorkbookService
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
final Long documentId = this.documentWritePlatformService.createInternalDocument(
- DocumentWritePlatformServiceJpaRepositoryImpl.DOCUMENT_MANAGEMENT_ENTITY.IMPORT.name(),
+ DocumentWritePlatformServiceJpaRepositoryImpl.DocumentManagementEntity.IMPORT.name(),
this.securityContext.authenticatedUser().getId(), null, clonedInputStreamWorkbook,
URLConnection.guessContentTypeFromName(fileName), fileName, null, fileName);
final Document document = this.documentRepository.findById(documentId).orElse(null);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java
index 2ccf6e44a..d9d282d98 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDomainServiceImpl.java
@@ -41,8 +41,8 @@ import org.apache.fineract.organisation.office.domain.Office;
import org.apache.fineract.organisation.office.domain.OfficeRepository;
import org.apache.fineract.portfolio.client.domain.Client;
import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants;
-import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BUSINESS_ENTITY;
-import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BUSINESS_EVENTS;
+import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BusinessEntity;
+import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BusinessEvents;
import org.apache.fineract.portfolio.common.service.BusinessEventListner;
import org.apache.fineract.portfolio.common.service.BusinessEventNotifierService;
import org.apache.fineract.portfolio.group.domain.Group;
@@ -97,15 +97,15 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
@PostConstruct
public void addListners() {
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_APPROVED, new SendSmsOnLoanApproved());
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_REJECTED, new SendSmsOnLoanRejected());
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_MAKE_REPAYMENT, new SendSmsOnLoanRepayment());
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.CLIENTS_ACTIVATE, new ClientActivatedListener());
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.CLIENTS_REJECT, new ClientRejectedListener());
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_ACTIVATE, new SavingsAccountActivatedListener());
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_REJECT, new SavingsAccountRejectedListener());
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_DEPOSIT, new SavingsAccountTransactionListener(true));
- this.businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_WITHDRAWAL, new SavingsAccountTransactionListener(false));
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_APPROVED, new SendSmsOnLoanApproved());
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_REJECTED, new SendSmsOnLoanRejected());
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_MAKE_REPAYMENT, new SendSmsOnLoanRepayment());
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.CLIENTS_ACTIVATE, new ClientActivatedListener());
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.CLIENTS_REJECT, new ClientRejectedListener());
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_ACTIVATE, new SavingsAccountActivatedListener());
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_REJECT, new SavingsAccountRejectedListener());
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_DEPOSIT, new SavingsAccountTransactionListener(true));
+ this.businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_WITHDRAWAL, new SavingsAccountTransactionListener(false));
}
private void notifyRejectedLoanOwner(Loan loan) {
@@ -392,7 +392,7 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
private abstract class SmsBusinessEventAdapter implements BusinessEventListner {
@Override
- public void businessEventToBeExecuted(Map businessEventEntity) {
+ public void businessEventToBeExecuted(Map businessEventEntity) {
//Nothing to do
}
}
@@ -400,8 +400,8 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
private class SendSmsOnLoanApproved extends SmsBusinessEventAdapter{
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.LOAN);
+ public void businessEventWasExecuted(Map businessEventEntity) {
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.LOAN);
if (entity instanceof Loan) {
Loan loan = (Loan) entity;
notifyAcceptedLoanOwner(loan);
@@ -412,8 +412,8 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
private class SendSmsOnLoanRejected extends SmsBusinessEventAdapter{
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.LOAN);
+ public void businessEventWasExecuted(Map businessEventEntity) {
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.LOAN);
if (entity instanceof Loan) {
Loan loan = (Loan) entity;
notifyRejectedLoanOwner(loan);
@@ -424,8 +424,8 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
private class SendSmsOnLoanRepayment extends SmsBusinessEventAdapter{
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.LOAN_TRANSACTION);
+ public void businessEventWasExecuted(Map businessEventEntity) {
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.LOAN_TRANSACTION);
if (entity instanceof LoanTransaction) {
LoanTransaction loanTransaction = (LoanTransaction) entity;
sendSmsForLoanRepayment(loanTransaction);
@@ -436,8 +436,8 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
private class ClientActivatedListener extends SmsBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.CLIENT);
+ public void businessEventWasExecuted(Map businessEventEntity) {
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.CLIENT);
if(entity instanceof Client) {
notifyClientActivated((Client)entity);
}
@@ -447,8 +447,8 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
private class ClientRejectedListener extends SmsBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.CLIENT);
+ public void businessEventWasExecuted(Map businessEventEntity) {
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.CLIENT);
if(entity instanceof Client) {
notifyClientRejected((Client)entity);
}
@@ -459,8 +459,8 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
private class SavingsAccountActivatedListener extends SmsBusinessEventAdapter{
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.SAVING);
+ public void businessEventWasExecuted(Map businessEventEntity) {
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.SAVING);
if(entity instanceof SavingsAccount) {
notifySavingsAccountActivated((SavingsAccount)entity);
}
@@ -471,8 +471,8 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
private class SavingsAccountRejectedListener extends SmsBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.SAVING);
+ public void businessEventWasExecuted(Map businessEventEntity) {
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.SAVING);
if(entity instanceof SavingsAccount) {
notifySavingsAccountRejected((SavingsAccount)entity);
}
@@ -488,8 +488,8 @@ public class SmsCampaignDomainServiceImpl implements SmsCampaignDomainService {
}
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.SAVINGS_TRANSACTION);
+ public void businessEventWasExecuted(Map businessEventEntity) {
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.SAVINGS_TRANSACTION);
if(entity instanceof SavingsAccountTransaction) {
sendSmsForSavingsTransaction((SavingsAccountTransaction)entity, this.isDeposit);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/CodeConstants.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/CodeConstants.java
index e117294b5..66520a183 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/CodeConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/CodeConstants.java
@@ -27,19 +27,19 @@ public class CodeConstants {
* Enum of all parameters passed in while creating/updating a code and code
* value
***/
- public static enum CODEVALUE_JSON_INPUT_PARAMS {
+ public static enum CodevalueJSONinputParams {
CODEVALUE_ID("id"), NAME("name"), POSITION("position"), DESCRIPTION("description"), IS_ACTIVE("isActive"),
IS_MANDATORY("isMandatory");
private final String value;
- private CODEVALUE_JSON_INPUT_PARAMS(final String value) {
+ private CodevalueJSONinputParams(final String value) {
this.value = value;
}
private static final Set values = new HashSet<>();
static {
- for (final CODEVALUE_JSON_INPUT_PARAMS type : CODEVALUE_JSON_INPUT_PARAMS.values()) {
+ for (final CodevalueJSONinputParams type : CodevalueJSONinputParams.values()) {
values.add(type.value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResource.java
index cab066020..38d2112a1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/api/CodeValuesApiResource.java
@@ -45,7 +45,7 @@ import javax.ws.rs.core.UriInfo;
import org.apache.fineract.commands.domain.CommandWrapper;
import org.apache.fineract.commands.service.CommandWrapperBuilder;
import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService;
-import org.apache.fineract.infrastructure.codes.CodeConstants.CODEVALUE_JSON_INPUT_PARAMS;
+import org.apache.fineract.infrastructure.codes.CodeConstants.CodevalueJSONinputParams;
import org.apache.fineract.infrastructure.codes.data.CodeData;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
@@ -71,10 +71,10 @@ public class CodeValuesApiResource {
* The set of parameters that are supported in response for {@link CodeData}
*/
private final Set RESPONSE_DATA_PARAMETERS = new HashSet<>(
- Arrays.asList(CODEVALUE_JSON_INPUT_PARAMS.CODEVALUE_ID.getValue(),
- CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue(), CODEVALUE_JSON_INPUT_PARAMS.POSITION.getValue(),
- CODEVALUE_JSON_INPUT_PARAMS.IS_MANDATORY.getValue(),
- CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue()));
+ Arrays.asList(CodevalueJSONinputParams.CODEVALUE_ID.getValue(),
+ CodevalueJSONinputParams.NAME.getValue(), CodevalueJSONinputParams.POSITION.getValue(),
+ CodevalueJSONinputParams.IS_MANDATORY.getValue(),
+ CodevalueJSONinputParams.DESCRIPTION.getValue()));
private final String resourceNameForPermissions = "CODEVALUE";
private final PlatformSecurityContext context;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
index 718c96e0c..6f882b4cb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
@@ -27,7 +27,7 @@ import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
-import org.apache.fineract.infrastructure.codes.CodeConstants.CODEVALUE_JSON_INPUT_PARAMS;
+import org.apache.fineract.infrastructure.codes.CodeConstants.CodevalueJSONinputParams;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
@@ -84,10 +84,10 @@ public class CodeValue extends AbstractPersistableCustom {
public static CodeValue fromJson(final Code code, final JsonCommand command) {
- final String label = command.stringValueOfParameterNamed(CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue());
- Integer position = command.integerValueSansLocaleOfParameterNamed(CODEVALUE_JSON_INPUT_PARAMS.POSITION.getValue());
- String description = command.stringValueOfParameterNamed(CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue());
- Boolean isActiveObj = command.booleanObjectValueOfParameterNamed(CODEVALUE_JSON_INPUT_PARAMS.IS_ACTIVE.getValue());
+ final String label = command.stringValueOfParameterNamed(CodevalueJSONinputParams.NAME.getValue());
+ Integer position = command.integerValueSansLocaleOfParameterNamed(CodevalueJSONinputParams.POSITION.getValue());
+ String description = command.stringValueOfParameterNamed(CodevalueJSONinputParams.DESCRIPTION.getValue());
+ Boolean isActiveObj = command.booleanObjectValueOfParameterNamed(CodevalueJSONinputParams.IS_ACTIVE.getValue());
boolean isActive = true;
if (isActiveObj != null) {
isActive = isActiveObj;
@@ -97,7 +97,7 @@ public class CodeValue extends AbstractPersistableCustom {
}
Boolean mandatory = command.booleanPrimitiveValueOfParameterNamed(
- CODEVALUE_JSON_INPUT_PARAMS.IS_MANDATORY.getValue());
+ CodevalueJSONinputParams.IS_MANDATORY.getValue());
// if the "mandatory" Boolean object is null, then set it to false by default
if (mandatory == null) {
@@ -111,28 +111,28 @@ public class CodeValue extends AbstractPersistableCustom {
final Map actualChanges = new LinkedHashMap<>(2);
- final String labelParamName = CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue();
+ final String labelParamName = CodevalueJSONinputParams.NAME.getValue();
if (command.isChangeInStringParameterNamed(labelParamName, this.label)) {
final String newValue = command.stringValueOfParameterNamed(labelParamName);
actualChanges.put(labelParamName, newValue);
this.label = StringUtils.defaultIfEmpty(newValue, null);
}
- final String decriptionParamName = CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue();
+ final String decriptionParamName = CodevalueJSONinputParams.DESCRIPTION.getValue();
if (command.isChangeInStringParameterNamed(decriptionParamName, this.description)) {
final String newValue = command.stringValueOfParameterNamed(decriptionParamName);
actualChanges.put(decriptionParamName, newValue);
this.description = StringUtils.defaultIfEmpty(newValue, null);
}
- final String positionParamName = CODEVALUE_JSON_INPUT_PARAMS.POSITION.getValue();
+ final String positionParamName = CodevalueJSONinputParams.POSITION.getValue();
if (command.isChangeInIntegerSansLocaleParameterNamed(positionParamName, this.position)) {
final Integer newValue = command.integerValueSansLocaleOfParameterNamed(positionParamName);
actualChanges.put(positionParamName, newValue);
this.position = newValue.intValue();
}
- final String isActiveParamName = CODEVALUE_JSON_INPUT_PARAMS.IS_ACTIVE.getValue();
+ final String isActiveParamName = CodevalueJSONinputParams.IS_ACTIVE.getValue();
if (command.isChangeInBooleanParameterNamed(isActiveParamName, this.isActive)) {
final Boolean newValue = command.booleanPrimitiveValueOfParameterNamed(isActiveParamName);
actualChanges.put(isActiveParamName, newValue);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/serialization/CodeValueCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/serialization/CodeValueCommandFromApiJsonDeserializer.java
index f20a649db..43da690a5 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/serialization/CodeValueCommandFromApiJsonDeserializer.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/serialization/CodeValueCommandFromApiJsonDeserializer.java
@@ -26,7 +26,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
-import org.apache.fineract.infrastructure.codes.CodeConstants.CODEVALUE_JSON_INPUT_PARAMS;
+import org.apache.fineract.infrastructure.codes.CodeConstants.CodevalueJSONinputParams;
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
@@ -44,7 +44,7 @@ public final class CodeValueCommandFromApiJsonDeserializer {
/**
* The parameters supported for this command.
*/
- private final Set supportedParameters = CODEVALUE_JSON_INPUT_PARAMS.getAllValues();
+ private final Set supportedParameters = CodevalueJSONinputParams.getAllValues();
private final FromJsonHelper fromApiJsonHelper;
@Autowired
@@ -63,24 +63,24 @@ public final class CodeValueCommandFromApiJsonDeserializer {
final JsonElement element = this.fromApiJsonHelper.parse(json);
- final String name = this.fromApiJsonHelper.extractStringNamed(CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue(), element);
- baseDataValidator.reset().parameter(CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue()).value(name).notBlank().notExceedingLengthOf(100);
+ final String name = this.fromApiJsonHelper.extractStringNamed(CodevalueJSONinputParams.NAME.getValue(), element);
+ baseDataValidator.reset().parameter(CodevalueJSONinputParams.NAME.getValue()).value(name).notBlank().notExceedingLengthOf(100);
- if (this.fromApiJsonHelper.parameterExists(CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue(), element)) {
- final String description = this.fromApiJsonHelper.extractStringNamed(CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CodevalueJSONinputParams.DESCRIPTION.getValue(), element)) {
+ final String description = this.fromApiJsonHelper.extractStringNamed(CodevalueJSONinputParams.DESCRIPTION.getValue(),
element);
- baseDataValidator.reset().parameter(CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue()).value(description)
+ baseDataValidator.reset().parameter(CodevalueJSONinputParams.DESCRIPTION.getValue()).value(description)
.notExceedingLengthOf(500);
}
- if (this.fromApiJsonHelper.parameterExists(CODEVALUE_JSON_INPUT_PARAMS.POSITION.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CodevalueJSONinputParams.POSITION.getValue(), element)) {
// Validate input value is a valid Integer
- this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CODEVALUE_JSON_INPUT_PARAMS.POSITION.getValue(), element);
+ this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CodevalueJSONinputParams.POSITION.getValue(), element);
}
- if (this.fromApiJsonHelper.parameterExists(CODEVALUE_JSON_INPUT_PARAMS.IS_ACTIVE.getValue(), element)) {
- final Boolean isActive = this.fromApiJsonHelper.extractBooleanNamed(CODEVALUE_JSON_INPUT_PARAMS.IS_ACTIVE.getValue(), element);
- baseDataValidator.reset().parameter(CODEVALUE_JSON_INPUT_PARAMS.IS_ACTIVE.getValue()).value(isActive).validateForBooleanValue();
+ if (this.fromApiJsonHelper.parameterExists(CodevalueJSONinputParams.IS_ACTIVE.getValue(), element)) {
+ final Boolean isActive = this.fromApiJsonHelper.extractBooleanNamed(CodevalueJSONinputParams.IS_ACTIVE.getValue(), element);
+ baseDataValidator.reset().parameter(CodevalueJSONinputParams.IS_ACTIVE.getValue()).value(isActive).validateForBooleanValue();
}
throwExceptionIfValidationWarningsExist(dataValidationErrors);
@@ -97,26 +97,26 @@ public final class CodeValueCommandFromApiJsonDeserializer {
final JsonElement element = this.fromApiJsonHelper.parse(json);
- if (this.fromApiJsonHelper.parameterExists(CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue(), element)) {
- final String name = this.fromApiJsonHelper.extractStringNamed(CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue(), element);
- baseDataValidator.reset().parameter(CODEVALUE_JSON_INPUT_PARAMS.NAME.getValue()).value(name).notBlank()
+ if (this.fromApiJsonHelper.parameterExists(CodevalueJSONinputParams.NAME.getValue(), element)) {
+ final String name = this.fromApiJsonHelper.extractStringNamed(CodevalueJSONinputParams.NAME.getValue(), element);
+ baseDataValidator.reset().parameter(CodevalueJSONinputParams.NAME.getValue()).value(name).notBlank()
.notExceedingLengthOf(100);
}
- if (this.fromApiJsonHelper.parameterExists(CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue(), element)) {
- final String description = this.fromApiJsonHelper.extractStringNamed(CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CodevalueJSONinputParams.DESCRIPTION.getValue(), element)) {
+ final String description = this.fromApiJsonHelper.extractStringNamed(CodevalueJSONinputParams.DESCRIPTION.getValue(),
element);
- baseDataValidator.reset().parameter(CODEVALUE_JSON_INPUT_PARAMS.DESCRIPTION.getValue()).value(description)
+ baseDataValidator.reset().parameter(CodevalueJSONinputParams.DESCRIPTION.getValue()).value(description)
.notExceedingLengthOf(500);
}
- if (this.fromApiJsonHelper.parameterExists(CODEVALUE_JSON_INPUT_PARAMS.POSITION.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CodevalueJSONinputParams.POSITION.getValue(), element)) {
// Validate input value is a valid Integer
- this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CODEVALUE_JSON_INPUT_PARAMS.POSITION.getValue(), element);
+ this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CodevalueJSONinputParams.POSITION.getValue(), element);
}
- if (this.fromApiJsonHelper.parameterExists(CODEVALUE_JSON_INPUT_PARAMS.IS_ACTIVE.getValue(), element)) {
- final Boolean isActive = this.fromApiJsonHelper.extractBooleanNamed(CODEVALUE_JSON_INPUT_PARAMS.IS_ACTIVE.getValue(), element);
- baseDataValidator.reset().parameter(CODEVALUE_JSON_INPUT_PARAMS.IS_ACTIVE.getValue()).value(isActive).validateForBooleanValue();
+ if (this.fromApiJsonHelper.parameterExists(CodevalueJSONinputParams.IS_ACTIVE.getValue(), element)) {
+ final Boolean isActive = this.fromApiJsonHelper.extractBooleanNamed(CodevalueJSONinputParams.IS_ACTIVE.getValue(), element);
+ baseDataValidator.reset().parameter(CodevalueJSONinputParams.IS_ACTIVE.getValue()).value(isActive).validateForBooleanValue();
}
throwExceptionIfValidationWarningsExist(dataValidationErrors);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ExternalServicesProperties.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ExternalServicesProperties.java
index 3d5cb984d..25b7b5e67 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ExternalServicesProperties.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/domain/ExternalServicesProperties.java
@@ -26,8 +26,8 @@ import javax.persistence.Entity;
import javax.persistence.Table;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.infrastructure.configuration.data.ExternalServicesPropertiesData;
-import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.EXTERNALSERVICEPROPERTIES_JSON_INPUT_PARAMS;
-import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.SMTP_JSON_INPUT_PARAMS;
+import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.ExternalservicePropertiesJSONinputParams;
+import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.SMTPJSONinputParams;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
@Entity
@@ -51,18 +51,18 @@ public class ExternalServicesProperties {
}
public static ExternalServicesProperties fromJson(final ExternalService externalService, final JsonCommand command) {
- final String name = command.stringValueOfParameterNamed(EXTERNALSERVICEPROPERTIES_JSON_INPUT_PARAMS.NAME.getValue());
- final String value = command.stringValueOfParameterNamed(EXTERNALSERVICEPROPERTIES_JSON_INPUT_PARAMS.VALUE.getValue());
+ final String name = command.stringValueOfParameterNamed(ExternalservicePropertiesJSONinputParams.NAME.getValue());
+ final String value = command.stringValueOfParameterNamed(ExternalservicePropertiesJSONinputParams.VALUE.getValue());
return new ExternalServicesProperties(new ExternalServicePropertiesPK(externalService.getId(), name), value);
}
public Map update(final JsonCommand command, String paramName) {
final Map actualChanges = new LinkedHashMap<>(2);
- final String valueParamName = EXTERNALSERVICEPROPERTIES_JSON_INPUT_PARAMS.VALUE.getValue();
+ final String valueParamName = ExternalservicePropertiesJSONinputParams.VALUE.getValue();
if (command.isChangeInStringParameterNamed(paramName, this.value)) {
final String newValue = command.stringValueOfParameterNamed(paramName);
- if (paramName.equals(SMTP_JSON_INPUT_PARAMS.PASSWORD.getValue()) && newValue.equals("XXXX")) {
+ if (paramName.equals(SMTPJSONinputParams.PASSWORD.getValue()) && newValue.equals("XXXX")) {
// If Param Name is Password and ParamValue is XXXX that means
// the password has not been changed.
} else {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/serialization/ExternalServicesPropertiesCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/serialization/ExternalServicesPropertiesCommandFromApiJsonDeserializer.java
index d2bc2e027..0b38f2c89 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/serialization/ExternalServicesPropertiesCommandFromApiJsonDeserializer.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/serialization/ExternalServicesPropertiesCommandFromApiJsonDeserializer.java
@@ -24,10 +24,10 @@ import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.infrastructure.configuration.exception.ExternalServiceConfigurationNotFoundException;
-import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.NOTIFICATION_JSON_INPUT_PARAMS;
-import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.S3_JSON_INPUT_PARAMS;
-import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.SMS_JSON_INPUT_PARAMS;
-import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.SMTP_JSON_INPUT_PARAMS;
+import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.NotificationJSONinputParams;
+import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.S3JSONinputParams;
+import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.SMSJSONinputParams;
+import org.apache.fineract.infrastructure.configuration.service.ExternalServicesConstants.SMTPJSONinputParams;
import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,10 +36,10 @@ import org.springframework.stereotype.Component;
@Component
public class ExternalServicesPropertiesCommandFromApiJsonDeserializer {
- private final Set S3SupportedParameters = S3_JSON_INPUT_PARAMS.getAllValues();
- private final Set SMTPSupportedParameters = SMTP_JSON_INPUT_PARAMS.getAllValues();
- private final Set SMSSupportedParameters = SMS_JSON_INPUT_PARAMS.getAllValues();
- private final Set NotificationSupportedParameters = NOTIFICATION_JSON_INPUT_PARAMS.getAllValues();
+ private final Set S3SupportedParameters = S3JSONinputParams.getAllValues();
+ private final Set SMTPSupportedParameters = SMTPJSONinputParams.getAllValues();
+ private final Set SMSSupportedParameters = SMSJSONinputParams.getAllValues();
+ private final Set NotificationSupportedParameters = NotificationJSONinputParams.getAllValues();
private final FromJsonHelper fromApiJsonHelper;
@Autowired
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ExternalServicesConstants.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ExternalServicesConstants.java
index e6a04ffdb..6e831c750 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ExternalServicesConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/configuration/service/ExternalServicesConstants.java
@@ -48,19 +48,19 @@ public class ExternalServicesConstants {
public static final String NOTIFICATION_GCM_END_POINT = "gcm_end_point";
public static final String NOTIFICATION_FCM_END_POINT = "fcm_end_point";
- public static enum EXTERNALSERVICEPROPERTIES_JSON_INPUT_PARAMS {
+ public static enum ExternalservicePropertiesJSONinputParams {
EXTERNAL_SERVICE_ID("external_service_id"), NAME("name"), VALUE("value");
private final String value;
- private EXTERNALSERVICEPROPERTIES_JSON_INPUT_PARAMS(final String value) {
+ private ExternalservicePropertiesJSONinputParams(final String value) {
this.value = value;
}
private static final Set values = new HashSet<>();
static {
- for (final EXTERNALSERVICEPROPERTIES_JSON_INPUT_PARAMS type : EXTERNALSERVICEPROPERTIES_JSON_INPUT_PARAMS.values()) {
+ for (final ExternalservicePropertiesJSONinputParams type : ExternalservicePropertiesJSONinputParams.values()) {
values.add(type.value);
}
}
@@ -79,19 +79,19 @@ public class ExternalServicesConstants {
}
}
- public static enum SMTP_JSON_INPUT_PARAMS {
+ public static enum SMTPJSONinputParams {
USERNAME("username"), PASSWORD("password"), HOST("host"), PORT("port"), USETLS("useTLS"), FROM_EMAIL("fromEmail"), FROM_NAME("fromName");
private final String value;
- private SMTP_JSON_INPUT_PARAMS(final String value) {
+ private SMTPJSONinputParams(final String value) {
this.value = value;
}
private static final Set values = new HashSet<>();
static {
- for (final SMTP_JSON_INPUT_PARAMS type : SMTP_JSON_INPUT_PARAMS.values()) {
+ for (final SMTPJSONinputParams type : SMTPJSONinputParams.values()) {
values.add(type.value);
}
}
@@ -110,19 +110,19 @@ public class ExternalServicesConstants {
}
}
- public static enum SMS_JSON_INPUT_PARAMS {
+ public static enum SMSJSONinputParams {
HASTNAME("host_name"), PORT("port_number"), END_POINT("end_point"), TENANT_APP_KEY("tenant_app_key");
private final String value;
- private SMS_JSON_INPUT_PARAMS(final String value) {
+ private SMSJSONinputParams(final String value) {
this.value = value;
}
private static final Set values = new HashSet<>();
static {
- for (final SMS_JSON_INPUT_PARAMS type : SMS_JSON_INPUT_PARAMS.values()) {
+ for (final SMSJSONinputParams type : SMSJSONinputParams.values()) {
values.add(type.value);
}
}
@@ -141,19 +141,19 @@ public class ExternalServicesConstants {
}
}
- public static enum S3_JSON_INPUT_PARAMS {
+ public static enum S3JSONinputParams {
S3_ACCESS_KEY("s3_access_key"), S3_BUCKET_NAME("s3_bucket_name"), S3_SECRET_KEY("s3_secret_key");
private final String value;
- private S3_JSON_INPUT_PARAMS(final String value) {
+ private S3JSONinputParams(final String value) {
this.value = value;
}
private static final Set values = new HashSet<>();
static {
- for (final S3_JSON_INPUT_PARAMS type : S3_JSON_INPUT_PARAMS.values()) {
+ for (final S3JSONinputParams type : S3JSONinputParams.values()) {
values.add(type.value);
}
}
@@ -172,19 +172,19 @@ public class ExternalServicesConstants {
}
}
- public static enum NOTIFICATION_JSON_INPUT_PARAMS {
+ public static enum NotificationJSONinputParams {
SERVER_KEY("server_key"), GCM_END_POINT("gcm_end_point"), FCM_END_POINT("fcm_end_point");
private final String value;
- private NOTIFICATION_JSON_INPUT_PARAMS(final String value) {
+ private NotificationJSONinputParams(final String value) {
this.value = value;
}
private static final Set values = new HashSet<>();
static {
- for (final NOTIFICATION_JSON_INPUT_PARAMS type : NOTIFICATION_JSON_INPUT_PARAMS.values()) {
+ for (final NotificationJSONinputParams type : NotificationJSONinputParams.values()) {
values.add(type.value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java
index 36122c8e6..f5db11f37 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java
@@ -42,7 +42,7 @@ import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.domain.Base64EncodedImage;
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepositoryUtils;
-import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepositoryUtils.IMAGE_FILE_EXTENSION;
+import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepositoryUtils.ImageFileExtension;
import org.apache.fineract.infrastructure.documentmanagement.data.ImageData;
import org.apache.fineract.infrastructure.documentmanagement.exception.InvalidEntityTypeForImageManagementException;
import org.apache.fineract.infrastructure.documentmanagement.service.ImageReadPlatformService;
@@ -121,9 +121,9 @@ public class ImagesApiResource {
@QueryParam("maxWidth") final Integer maxWidth, @QueryParam("maxHeight") final Integer maxHeight,
@QueryParam("output") final String output) {
validateEntityTypeforImage(entityName);
- if (ENTITY_TYPE_FOR_IMAGES.CLIENTS.toString().equalsIgnoreCase(entityName)) {
+ if (EntityTypeForImages.CLIENTS.toString().equalsIgnoreCase(entityName)) {
this.context.authenticatedUser().validateHasReadPermission("CLIENTIMAGE");
- } else if (ENTITY_TYPE_FOR_IMAGES.STAFF.toString().equalsIgnoreCase(entityName)) {
+ } else if (EntityTypeForImages.STAFF.toString().equalsIgnoreCase(entityName)) {
this.context.authenticatedUser().validateHasReadPermission("STAFFIMAGE");
}
@@ -133,11 +133,11 @@ public class ImagesApiResource {
final ImageData imageData = this.imageReadPlatformService.retrieveImage(entityName, entityId);
// TODO: Need a better way of determining image type
- String imageDataURISuffix = ContentRepositoryUtils.IMAGE_DATA_URI_SUFFIX.JPEG.getValue();
- if (StringUtils.endsWith(imageData.location(), ContentRepositoryUtils.IMAGE_FILE_EXTENSION.GIF.getValue())) {
- imageDataURISuffix = ContentRepositoryUtils.IMAGE_DATA_URI_SUFFIX.GIF.getValue();
- } else if (StringUtils.endsWith(imageData.location(), ContentRepositoryUtils.IMAGE_FILE_EXTENSION.PNG.getValue())) {
- imageDataURISuffix = ContentRepositoryUtils.IMAGE_DATA_URI_SUFFIX.PNG.getValue();
+ String imageDataURISuffix = ContentRepositoryUtils.ImageDataURIsuffix.JPEG.getValue();
+ if (StringUtils.endsWith(imageData.location(), ContentRepositoryUtils.ImageFileExtension.GIF.getValue())) {
+ imageDataURISuffix = ContentRepositoryUtils.ImageDataURIsuffix.GIF.getValue();
+ } else if (StringUtils.endsWith(imageData.location(), ContentRepositoryUtils.ImageFileExtension.PNG.getValue())) {
+ imageDataURISuffix = ContentRepositoryUtils.ImageDataURIsuffix.PNG.getValue();
}
final String clientImageAsBase64Text = imageDataURISuffix + Base64.encodeBytes(imageData.getContentOfSize(maxWidth, maxHeight));
@@ -151,9 +151,9 @@ public class ImagesApiResource {
@QueryParam("maxWidth") final Integer maxWidth, @QueryParam("maxHeight") final Integer maxHeight,
@QueryParam("output") String output) {
validateEntityTypeforImage(entityName);
- if (ENTITY_TYPE_FOR_IMAGES.CLIENTS.toString().equalsIgnoreCase(entityName)) {
+ if (EntityTypeForImages.CLIENTS.toString().equalsIgnoreCase(entityName)) {
this.context.authenticatedUser().validateHasReadPermission("CLIENTIMAGE");
- } else if (ENTITY_TYPE_FOR_IMAGES.STAFF.toString().equalsIgnoreCase(entityName)) {
+ } else if (EntityTypeForImages.STAFF.toString().equalsIgnoreCase(entityName)) {
this.context.authenticatedUser().validateHasReadPermission("STAFFIMAGE");
}
@@ -162,7 +162,7 @@ public class ImagesApiResource {
final ResponseBuilder response = Response.ok(imageData.getContentOfSize(maxWidth, maxHeight));
String dispositionType = "inline_octet".equals(output) ? "inline" : "attachment";
response.header("Content-Disposition", dispositionType + "; filename=\"" + imageData.getEntityDisplayName()
- + IMAGE_FILE_EXTENSION.JPEG + "\"");
+ + ImageFileExtension.JPEG + "\"");
// TODO: Need a better way of determining image type
@@ -207,7 +207,7 @@ public class ImagesApiResource {
}
/*** Entities for document Management **/
- public static enum ENTITY_TYPE_FOR_IMAGES {
+ public static enum EntityTypeForImages {
STAFF, CLIENTS;
@Override
@@ -221,7 +221,7 @@ public class ImagesApiResource {
}
private static boolean checkValidEntityType(final String entityType) {
- for (final ENTITY_TYPE_FOR_IMAGES entities : ENTITY_TYPE_FOR_IMAGES.values()) {
+ for (final EntityTypeForImages entities : EntityTypeForImages.values()) {
if (entities.name().equalsIgnoreCase(entityType)) { return true; }
}
return false;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
index d8a1d1a69..cdd26d3f3 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
@@ -33,12 +33,12 @@ public class ContentRepositoryUtils {
private static final Random random = new Random();
- public static enum IMAGE_MIME_TYPE {
+ public static enum ImageMIMEtype {
GIF("image/gif"), JPEG("image/jpeg"), PNG("image/png");
private final String value;
- private IMAGE_MIME_TYPE(final String value) {
+ private ImageMIMEtype(final String value) {
this.value = value;
}
@@ -46,27 +46,27 @@ public class ContentRepositoryUtils {
return this.value;
}
- public static IMAGE_MIME_TYPE fromFileExtension(IMAGE_FILE_EXTENSION fileExtension) {
+ public static ImageMIMEtype fromFileExtension(ImageFileExtension fileExtension) {
switch (fileExtension) {
case GIF:
- return IMAGE_MIME_TYPE.GIF;
+ return ImageMIMEtype.GIF;
case JPG:
case JPEG:
- return IMAGE_MIME_TYPE.JPEG;
+ return ImageMIMEtype.JPEG;
case PNG:
- return IMAGE_MIME_TYPE.PNG;
+ return ImageMIMEtype.PNG;
default:
throw new IllegalArgumentException();
}
}
}
- public static enum IMAGE_FILE_EXTENSION {
+ public static enum ImageFileExtension {
GIF(".gif"), JPEG(".jpeg"), JPG(".jpg"), PNG(".png");
private final String value;
- private IMAGE_FILE_EXTENSION(final String value) {
+ private ImageFileExtension(final String value) {
this.value = value;
}
@@ -78,27 +78,27 @@ public class ContentRepositoryUtils {
return this.value.substring(1);
}
- public IMAGE_FILE_EXTENSION getFileExtension() {
+ public ImageFileExtension getFileExtension() {
switch (this) {
case GIF:
- return IMAGE_FILE_EXTENSION.GIF;
+ return ImageFileExtension.GIF;
case JPEG:
- return IMAGE_FILE_EXTENSION.JPEG;
+ return ImageFileExtension.JPEG;
case PNG:
- return IMAGE_FILE_EXTENSION.PNG;
+ return ImageFileExtension.PNG;
default:
throw new IllegalArgumentException();
}
}
}
- public static enum IMAGE_DATA_URI_SUFFIX {
- GIF("data:" + IMAGE_MIME_TYPE.GIF.getValue() + ";base64,"), JPEG("data:" + IMAGE_MIME_TYPE.JPEG.getValue() + ";base64,"), PNG(
- "data:" + IMAGE_MIME_TYPE.PNG.getValue() + ";base64,");
+ public static enum ImageDataURIsuffix {
+ GIF("data:" + ImageMIMEtype.GIF.getValue() + ";base64,"), JPEG("data:" + ImageMIMEtype.JPEG.getValue() + ";base64,"), PNG(
+ "data:" + ImageMIMEtype.PNG.getValue() + ";base64,");
private final String value;
- private IMAGE_DATA_URI_SUFFIX(final String value) {
+ private ImageDataURIsuffix(final String value) {
this.value = value;
}
@@ -113,8 +113,8 @@ public class ContentRepositoryUtils {
* @param mimeType
*/
public static void validateImageMimeType(final String mimeType) {
- if (!(mimeType.equalsIgnoreCase(IMAGE_MIME_TYPE.GIF.getValue()) || mimeType.equalsIgnoreCase(IMAGE_MIME_TYPE.JPEG.getValue()) || mimeType
- .equalsIgnoreCase(IMAGE_MIME_TYPE.PNG.getValue()))) { throw new ImageUploadException(); }
+ if (!(mimeType.equalsIgnoreCase(ImageMIMEtype.GIF.getValue()) || mimeType.equalsIgnoreCase(ImageMIMEtype.JPEG.getValue()) || mimeType
+ .equalsIgnoreCase(ImageMIMEtype.PNG.getValue()))) { throw new ImageUploadException(); }
}
/**
@@ -125,15 +125,15 @@ public class ContentRepositoryUtils {
public static Base64EncodedImage extractImageFromDataURL(final String dataURL) {
String fileExtension = "";
String base64EncodedString = null;
- if (StringUtils.startsWith(dataURL, IMAGE_DATA_URI_SUFFIX.GIF.getValue())) {
- base64EncodedString = dataURL.replaceAll(IMAGE_DATA_URI_SUFFIX.GIF.getValue(), "");
- fileExtension = IMAGE_FILE_EXTENSION.GIF.getValue();
- } else if (StringUtils.startsWith(dataURL, IMAGE_DATA_URI_SUFFIX.PNG.getValue())) {
- base64EncodedString = dataURL.replaceAll(IMAGE_DATA_URI_SUFFIX.PNG.getValue(), "");
- fileExtension = IMAGE_FILE_EXTENSION.PNG.getValue();
- } else if (StringUtils.startsWith(dataURL, IMAGE_DATA_URI_SUFFIX.JPEG.getValue())) {
- base64EncodedString = dataURL.replaceAll(IMAGE_DATA_URI_SUFFIX.JPEG.getValue(), "");
- fileExtension = IMAGE_FILE_EXTENSION.JPEG.getValue();
+ if (StringUtils.startsWith(dataURL, ImageDataURIsuffix.GIF.getValue())) {
+ base64EncodedString = dataURL.replaceAll(ImageDataURIsuffix.GIF.getValue(), "");
+ fileExtension = ImageFileExtension.GIF.getValue();
+ } else if (StringUtils.startsWith(dataURL, ImageDataURIsuffix.PNG.getValue())) {
+ base64EncodedString = dataURL.replaceAll(ImageDataURIsuffix.PNG.getValue(), "");
+ fileExtension = ImageFileExtension.PNG.getValue();
+ } else if (StringUtils.startsWith(dataURL, ImageDataURIsuffix.JPEG.getValue())) {
+ base64EncodedString = dataURL.replaceAll(ImageDataURIsuffix.JPEG.getValue(), "");
+ fileExtension = ImageFileExtension.JPEG.getValue();
} else {
throw new ImageDataURLNotValidException();
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java
index f9dc731b0..4f5b3bacb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/data/ImageData.java
@@ -48,7 +48,7 @@ public class ImageData {
private final String entityDisplayName;
private File file;
- private ContentRepositoryUtils.IMAGE_FILE_EXTENSION fileExtension;
+ private ContentRepositoryUtils.ImageFileExtension fileExtension;
private InputStream inputStream;
public ImageData(final Long imageId, final String location, final Integer storageType, final String entityDisplayName) {
@@ -94,7 +94,7 @@ public class ImageData {
int newWidth = (int) (src.getWidth() / scaleRatio);
int newHeight = (int) (src.getHeight() / scaleRatio);
- int colorModel = fileExtension == ContentRepositoryUtils.IMAGE_FILE_EXTENSION.JPEG ? BufferedImage.TYPE_INT_RGB
+ int colorModel = fileExtension == ContentRepositoryUtils.ImageFileExtension.JPEG ? BufferedImage.TYPE_INT_RGB
: BufferedImage.TYPE_INT_ARGB;
BufferedImage target = new BufferedImage(newWidth, newHeight, colorModel);
Graphics2D g = target.createGraphics();
@@ -135,12 +135,12 @@ public class ImageData {
}
private void setImageContentType(String filename) {
- fileExtension = ContentRepositoryUtils.IMAGE_FILE_EXTENSION.JPEG;
+ fileExtension = ContentRepositoryUtils.ImageFileExtension.JPEG;
- if (StringUtils.endsWith(filename.toLowerCase(), ContentRepositoryUtils.IMAGE_FILE_EXTENSION.GIF.getValue())) {
- fileExtension = ContentRepositoryUtils.IMAGE_FILE_EXTENSION.GIF;
- } else if (StringUtils.endsWith(filename, ContentRepositoryUtils.IMAGE_FILE_EXTENSION.PNG.getValue())) {
- fileExtension = ContentRepositoryUtils.IMAGE_FILE_EXTENSION.PNG;
+ if (StringUtils.endsWith(filename.toLowerCase(), ContentRepositoryUtils.ImageFileExtension.GIF.getValue())) {
+ fileExtension = ContentRepositoryUtils.ImageFileExtension.GIF;
+ } else if (StringUtils.endsWith(filename, ContentRepositoryUtils.ImageFileExtension.PNG.getValue())) {
+ fileExtension = ContentRepositoryUtils.ImageFileExtension.PNG;
}
}
@@ -152,7 +152,7 @@ public class ImageData {
}
public String contentType() {
- return ContentRepositoryUtils.IMAGE_MIME_TYPE.fromFileExtension(this.fileExtension).getValue();
+ return ContentRepositoryUtils.ImageMIMEtype.fromFileExtension(this.fileExtension).getValue();
}
public StorageType storageType() {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java
index f9a13098e..d2aaf95a8 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/DocumentWritePlatformServiceJpaRepositoryImpl.java
@@ -168,14 +168,14 @@ public class DocumentWritePlatformServiceJpaRepositoryImpl implements DocumentWr
}
private static boolean checkValidEntityType(final String entityType) {
- for (final DOCUMENT_MANAGEMENT_ENTITY entities : DOCUMENT_MANAGEMENT_ENTITY.values()) {
+ for (final DocumentManagementEntity entities : DocumentManagementEntity.values()) {
if (entities.name().equalsIgnoreCase(entityType)) { return true; }
}
return false;
}
/*** Entities for document Management **/
- public static enum DOCUMENT_MANAGEMENT_ENTITY {
+ public static enum DocumentManagementEntity {
CLIENTS, CLIENT_IDENTIFIERS, STAFF, LOANS, SAVINGS, GROUPS,IMPORT;
@Override
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformServiceImpl.java
index 6719d81ec..557120bce 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageReadPlatformServiceImpl.java
@@ -22,7 +22,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
-import org.apache.fineract.infrastructure.documentmanagement.api.ImagesApiResource.ENTITY_TYPE_FOR_IMAGES;
+import org.apache.fineract.infrastructure.documentmanagement.api.ImagesApiResource.EntityTypeForImages;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepository;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepositoryFactory;
import org.apache.fineract.infrastructure.documentmanagement.data.ImageData;
@@ -64,9 +64,9 @@ public class ImageReadPlatformServiceImpl implements ImageReadPlatformService {
public String schema(String entityType) {
StringBuilder builder = new StringBuilder("image.id as id, image.location as location, image.storage_type_enum as storageType ");
- if (ENTITY_TYPE_FOR_IMAGES.CLIENTS.toString().equalsIgnoreCase(entityType)) {
+ if (EntityTypeForImages.CLIENTS.toString().equalsIgnoreCase(entityType)) {
builder.append(" from m_image image , m_client client " + " where client.image_id = image.id and client.id=?");
- } else if (ENTITY_TYPE_FOR_IMAGES.STAFF.toString().equalsIgnoreCase(entityType)) {
+ } else if (EntityTypeForImages.STAFF.toString().equalsIgnoreCase(entityType)) {
builder.append("from m_image image , m_staff staff " + " where staff.image_id = image.id and staff.id=?");
}
return builder.toString();
@@ -87,10 +87,10 @@ public class ImageReadPlatformServiceImpl implements ImageReadPlatformService {
try {
Object owner;
String displayName = null;
- if (ENTITY_TYPE_FOR_IMAGES.CLIENTS.toString().equalsIgnoreCase(entityType)) {
+ if (EntityTypeForImages.CLIENTS.toString().equalsIgnoreCase(entityType)) {
owner = this.clientRepositoryWrapper.findOneWithNotFoundDetection(entityId);
displayName = ((Client) owner).getDisplayName();
- } else if (ENTITY_TYPE_FOR_IMAGES.STAFF.toString().equalsIgnoreCase(entityType)) {
+ } else if (EntityTypeForImages.STAFF.toString().equalsIgnoreCase(entityType)) {
owner = this.staffRepositoryWrapper.findOneWithNotFoundDetection(entityId);
displayName = ((Staff) owner).displayName();
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageWritePlatformServiceJpaRepositoryImpl.java
index ee1130eb0..5b8350705 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/service/ImageWritePlatformServiceJpaRepositoryImpl.java
@@ -21,7 +21,7 @@ package org.apache.fineract.infrastructure.documentmanagement.service;
import java.io.InputStream;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.domain.Base64EncodedImage;
-import org.apache.fineract.infrastructure.documentmanagement.api.ImagesApiResource.ENTITY_TYPE_FOR_IMAGES;
+import org.apache.fineract.infrastructure.documentmanagement.api.ImagesApiResource.EntityTypeForImages;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepository;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepositoryFactory;
import org.apache.fineract.infrastructure.documentmanagement.domain.Image;
@@ -80,14 +80,14 @@ public class ImageWritePlatformServiceJpaRepositoryImpl implements ImageWritePla
public CommandProcessingResult deleteImage(String entityName, final Long clientId) {
Object owner = null;
Image image = null;
- if (ENTITY_TYPE_FOR_IMAGES.CLIENTS.toString().equals(entityName)) {
+ if (EntityTypeForImages.CLIENTS.toString().equals(entityName)) {
owner = this.clientRepositoryWrapper.findOneWithNotFoundDetection(clientId);
Client client = (Client) owner;
image = client.getImage();
client.setImage(null);
this.clientRepositoryWrapper.save(client);
- } else if (ENTITY_TYPE_FOR_IMAGES.STAFF.toString().equals(entityName)) {
+ } else if (EntityTypeForImages.STAFF.toString().equals(entityName)) {
owner = this.staffRepositoryWrapper.findOneWithNotFoundDetection(clientId);
Staff staff = (Staff) owner;
image = staff.getImage();
@@ -114,11 +114,11 @@ public class ImageWritePlatformServiceJpaRepositoryImpl implements ImageWritePla
private Object deletePreviousImage(String entityName, final Long entityId) {
Object owner = null;
Image image = null;
- if (ENTITY_TYPE_FOR_IMAGES.CLIENTS.toString().equals(entityName)) {
+ if (EntityTypeForImages.CLIENTS.toString().equals(entityName)) {
Client client = this.clientRepositoryWrapper.findOneWithNotFoundDetection(entityId);
image = client.getImage();
owner = client;
- } else if (ENTITY_TYPE_FOR_IMAGES.STAFF.toString().equals(entityName)) {
+ } else if (EntityTypeForImages.STAFF.toString().equals(entityName)) {
Staff staff = this.staffRepositoryWrapper.findOneWithNotFoundDetection(entityId);
image = staff.getImage();
owner = staff;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/FineractEntityAccessConstants.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/FineractEntityAccessConstants.java
index a91ddfa33..fcb23a8b1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/FineractEntityAccessConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/FineractEntityAccessConstants.java
@@ -27,7 +27,7 @@ public class FineractEntityAccessConstants {
/***
* Enum of all parameters passed in while creating/updating an entity access
***/
- public static enum ENTITY_ACCESS_JSON_INPUT_PARAMS {
+ public static enum EntityAccessJSONinputParams {
ENTITY_TYPE("entityType"),
ENTITY_ID("entityId"),
ENTITY_ACCESS_TYPE_ID("entityAccessTypeId"),
@@ -37,7 +37,7 @@ public class FineractEntityAccessConstants {
private final String value;
- private ENTITY_ACCESS_JSON_INPUT_PARAMS(final String value) {
+ private EntityAccessJSONinputParams(final String value) {
this.value = value;
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java
index 77c431c96..fe5b2936d 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/entityaccess/domain/FineractEntityAccess.java
@@ -73,13 +73,13 @@ public class FineractEntityAccess extends AbstractPersistableCustom {
public static FineractEntityAccess fromJson(final CodeValue accessType, final JsonCommand command) {
final String entityType = command.stringValueOfParameterNamed(
- FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.ENTITY_TYPE.getValue());
+ FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_TYPE.getValue());
final Long entityId = command.longValueOfParameterNamed(
- FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.ENTITY_ID.getValue());
+ FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_ID.getValue());
final String secondEntityType = command.stringValueOfParameterNamed(
- FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.SECOND_ENTITY_ID.getValue());
+ FineractEntityAccessConstants.EntityAccessJSONinputParams.SECOND_ENTITY_ID.getValue());
final Long secondEntityId = command.longValueOfParameterNamed(
- FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.SECOND_ENTITY_ID.getValue());
+ FineractEntityAccessConstants.EntityAccessJSONinputParams.SECOND_ENTITY_ID.getValue());
return new FineractEntityAccess (entityType, entityId, accessType,
secondEntityType, secondEntityId);
@@ -92,14 +92,14 @@ public class FineractEntityAccess extends AbstractPersistableCustom {
String paramName = null;
- paramName = FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.ENTITY_TYPE.getValue();
+ paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_TYPE.getValue();
if (command.isChangeInStringParameterNamed(paramName, this.entityType)) {
final String newValue = command.stringValueOfParameterNamed(paramName);
actualChanges.put(paramName, newValue);
this.entityType = newValue;
}
- paramName = FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.ENTITY_ID.getValue();
+ paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_ID.getValue();
if (command.isChangeInLongParameterNamed(paramName, getEntityId())) {
this.entityId = command.longValueOfParameterNamed(paramName);
actualChanges.put(paramName, this.entityId);
@@ -110,20 +110,20 @@ public class FineractEntityAccess extends AbstractPersistableCustom {
existingAccessTypeId = this.accessType.getId();
}
- paramName = FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.ENTITY_ACCESS_TYPE_ID.getValue();
+ paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.ENTITY_ACCESS_TYPE_ID.getValue();
if (command.isChangeInLongParameterNamed(paramName, existingAccessTypeId)) {
final Long newValue = command.longValueOfParameterNamed(paramName);
actualChanges.put(paramName, newValue);
}
- paramName = FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.SECOND_ENTITY_TYPE.getValue();
+ paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.SECOND_ENTITY_TYPE.getValue();
if (command.isChangeInStringParameterNamed(paramName, this.secondEntityType)) {
final String newValue = command.stringValueOfParameterNamed(paramName);
actualChanges.put(paramName, newValue);
this.secondEntityType = newValue;
}
- paramName = FineractEntityAccessConstants.ENTITY_ACCESS_JSON_INPUT_PARAMS.SECOND_ENTITY_ID.getValue();
+ paramName = FineractEntityAccessConstants.EntityAccessJSONinputParams.SECOND_ENTITY_ID.getValue();
if (command.isChangeInLongParameterNamed(paramName, getSecondEntityId())) {
this.secondEntityId = command.longValueOfParameterNamed(paramName);
actualChanges.put(paramName, this.secondEntityId);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
index 8668ba5d4..64ccbb6a5 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/notification/service/NotificationDomainServiceImpl.java
@@ -36,8 +36,8 @@ import org.apache.fineract.notification.eventandlistener.SpringEventPublisher;
import org.apache.fineract.organisation.office.domain.OfficeRepository;
import org.apache.fineract.portfolio.client.domain.Client;
import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants;
-import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BUSINESS_ENTITY;
-import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BUSINESS_EVENTS;
+import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BusinessEntity;
+import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BusinessEvents;
import org.apache.fineract.portfolio.common.service.BusinessEventListner;
import org.apache.fineract.portfolio.common.service.BusinessEventNotifierService;
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
@@ -82,58 +82,58 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
@PostConstruct
public void addListeners() {
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.CLIENTS_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.CLIENTS_CREATE,
new ClientCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_APPROVE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_APPROVE,
new SavingsAccountApprovedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.CENTERS_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.CENTERS_CREATE,
new CenterCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.GROUPS_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.GROUPS_CREATE,
new GroupCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_DEPOSIT,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_DEPOSIT,
new SavingsAccountDepositListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SHARE_PRODUCT_DIVIDENDS_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SHARE_PRODUCT_DIVIDENDS_CREATE,
new ShareProductDividendCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.FIXED_DEPOSIT_ACCOUNT_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.FIXED_DEPOSIT_ACCOUNT_CREATE,
new FixedDepositAccountCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.RECURRING_DEPOSIT_ACCOUNT_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.RECURRING_DEPOSIT_ACCOUNT_CREATE,
new RecurringDepositAccountCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_POST_INTEREST,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_POST_INTEREST,
new SavingsPostInterestListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_CREATE,
new LoanCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_APPROVED,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_APPROVED,
new LoanApprovedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_CLOSE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_CLOSE,
new LoanClosedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_CLOSE_AS_RESCHEDULE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_CLOSE_AS_RESCHEDULE,
new LoanCloseAsRescheduledListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_MAKE_REPAYMENT,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_MAKE_REPAYMENT,
new LoanMakeRepaymentListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.LOAN_PRODUCT_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.LOAN_PRODUCT_CREATE,
new LoanProductCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_CREATE,
new SavingsAccountCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SAVINGS_CLOSE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SAVINGS_CLOSE,
new SavingsAccountClosedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SHARE_ACCOUNT_CREATE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SHARE_ACCOUNT_CREATE,
new ShareAccountCreatedListener());
- businessEventNotifierService.addBusinessEventPostListners(BUSINESS_EVENTS.SHARE_ACCOUNT_APPROVE,
+ businessEventNotifierService.addBusinessEventPostListners(BusinessEvents.SHARE_ACCOUNT_APPROVE,
new ShareAccountApprovedListener());
}
private abstract class NotificationBusinessEventAdapter implements BusinessEventListner {
@Override
- public void businessEventToBeExecuted(Map businessEventEntity) {
+ public void businessEventToBeExecuted(Map businessEventEntity) {
}
}
private class ClientCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
Client client;
- Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BUSINESS_ENTITY.CLIENT);
+ Object entity = businessEventEntity.get(BusinessEventNotificationConstants.BusinessEntity.CLIENT);
if (entity != null) {
client = (Client) entity;
buildNotification(
@@ -152,9 +152,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class CenterCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
CommandProcessingResult commandProcessingResult;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.GROUP);
+ Object entity = businessEventEntity.get(BusinessEntity.GROUP);
if (entity != null) {
commandProcessingResult = (CommandProcessingResult) entity;
buildNotification(
@@ -173,9 +173,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class GroupCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
CommandProcessingResult commandProcessingResult;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.GROUP);
+ Object entity = businessEventEntity.get(BusinessEntity.GROUP);
if (entity != null) {
commandProcessingResult = (CommandProcessingResult) entity;
buildNotification(
@@ -194,9 +194,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class SavingsAccountDepositListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
SavingsAccountTransaction savingsAccountTransaction;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.SAVINGS_TRANSACTION);
+ Object entity = businessEventEntity.get(BusinessEntity.SAVINGS_TRANSACTION);
if (entity != null) {
savingsAccountTransaction = (SavingsAccountTransaction) entity;
buildNotification(
@@ -215,9 +215,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class ShareProductDividendCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
Long shareProductId;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.SHARE_PRODUCT);
+ Object entity = businessEventEntity.get(BusinessEntity.SHARE_PRODUCT);
if (entity != null) {
shareProductId = (Long) entity;
buildNotification(
@@ -236,9 +236,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class FixedDepositAccountCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
FixedDepositAccount fixedDepositAccount;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.DEPOSIT_ACCOUNT);
+ Object entity = businessEventEntity.get(BusinessEntity.DEPOSIT_ACCOUNT);
if (entity != null) {
fixedDepositAccount = (FixedDepositAccount) entity;
buildNotification(
@@ -257,9 +257,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class RecurringDepositAccountCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
RecurringDepositAccount recurringDepositAccount;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.DEPOSIT_ACCOUNT);
+ Object entity = businessEventEntity.get(BusinessEntity.DEPOSIT_ACCOUNT);
if (entity != null) {
recurringDepositAccount = (RecurringDepositAccount) entity;
buildNotification(
@@ -278,9 +278,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class SavingsAccountApprovedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
SavingsAccount savingsAccount;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.SAVING);
+ Object entity = businessEventEntity.get(BusinessEntity.SAVING);
if (entity != null) {
savingsAccount = (SavingsAccount) entity;
if (savingsAccount.depositAccountType().equals(DepositAccountType.FIXED_DEPOSIT)) {
@@ -324,9 +324,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class SavingsPostInterestListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
SavingsAccount savingsAccount;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.SAVING);
+ Object entity = businessEventEntity.get(BusinessEntity.SAVING);
if (entity != null) {
savingsAccount = (SavingsAccount) entity;
buildNotification(
@@ -345,9 +345,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class LoanCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
Loan loan;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.LOAN);
+ Object entity = businessEventEntity.get(BusinessEntity.LOAN);
if (entity != null) {
loan = (Loan) entity;
buildNotification(
@@ -367,9 +367,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class LoanApprovedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
Loan loan;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.LOAN);
+ Object entity = businessEventEntity.get(BusinessEntity.LOAN);
if (entity != null) {
loan = (Loan) entity;
buildNotification(
@@ -388,10 +388,10 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class LoanClosedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
Loan loan;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.LOAN);
+ Object entity = businessEventEntity.get(BusinessEntity.LOAN);
if (entity != null) {
loan = (Loan) entity;
buildNotification(
@@ -410,9 +410,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class LoanCloseAsRescheduledListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
Loan loan;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.LOAN);
+ Object entity = businessEventEntity.get(BusinessEntity.LOAN);
if (entity != null) {
loan = (Loan) entity;
buildNotification(
@@ -431,9 +431,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class LoanMakeRepaymentListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
Loan loan;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.LOAN);
+ Object entity = businessEventEntity.get(BusinessEntity.LOAN);
if (entity != null) {
loan = (Loan) entity;
buildNotification(
@@ -452,10 +452,10 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class LoanProductCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
LoanProduct loanProduct;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.LOAN_PRODUCT);
+ Object entity = businessEventEntity.get(BusinessEntity.LOAN_PRODUCT);
if (entity != null) {
loanProduct = (LoanProduct) entity;
buildNotification(
@@ -474,9 +474,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class SavingsAccountCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
SavingsAccount savingsAccount;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.SAVING);
+ Object entity = businessEventEntity.get(BusinessEntity.SAVING);
if (entity != null) {
savingsAccount = (SavingsAccount) entity;
buildNotification(
@@ -495,9 +495,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class SavingsAccountClosedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
SavingsAccount savingsAccount;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.SAVING);
+ Object entity = businessEventEntity.get(BusinessEntity.SAVING);
if (entity != null) {
savingsAccount = (SavingsAccount) entity;
buildNotification(
@@ -516,9 +516,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class ShareAccountCreatedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
ShareAccount shareAccount;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.SHARE_ACCOUNT);
+ Object entity = businessEventEntity.get(BusinessEntity.SHARE_ACCOUNT);
if (entity != null) {
shareAccount = (ShareAccount) entity;
buildNotification(
@@ -537,9 +537,9 @@ public class NotificationDomainServiceImpl implements NotificationDomainService
private class ShareAccountApprovedListener extends NotificationBusinessEventAdapter {
@Override
- public void businessEventWasExecuted(Map businessEventEntity) {
+ public void businessEventWasExecuted(Map businessEventEntity) {
ShareAccount shareAccount;
- Object entity = businessEventEntity.get(BUSINESS_ENTITY.SHARE_ACCOUNT);
+ Object entity = businessEventEntity.get(BusinessEntity.SHARE_ACCOUNT);
if (entity != null) {
shareAccount = (ShareAccount) entity;
buildNotification(
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/exception/StaffRoleException.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/exception/StaffRoleException.java
index a5f980fc5..ec782e4f1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/exception/StaffRoleException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/staff/exception/StaffRoleException.java
@@ -25,7 +25,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourc
*/
public class StaffRoleException extends AbstractPlatformResourceNotFoundException {
- public static enum STAFF_ROLE {
+ public static enum StaffRole {
LOAN_OFFICER, BRANCH_MANAGER,SAVINGS_OFFICER;
@Override
@@ -34,7 +34,7 @@ public class StaffRoleException extends AbstractPlatformResourceNotFoundExceptio
}
}
- public StaffRoleException(final Long id, final STAFF_ROLE role) {
+ public StaffRoleException(final Long id, final StaffRole role) {
super("error.msg.staff.id.invalid.role", "Staff with identifier " + id + " is not a " + role.toString(), id);
}
}
\ No newline at end of file
diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java
index 3254c7837..674308b5f 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/teller/service/TellerWritePlatformServiceJpaImpl.java
@@ -22,7 +22,7 @@ import java.util.Map;
import java.util.Set;
import javax.persistence.PersistenceException;
import org.apache.commons.lang3.exception.ExceptionUtils;
-import org.apache.fineract.accounting.common.AccountingConstants.FINANCIAL_ACTIVITY;
+import org.apache.fineract.accounting.common.AccountingConstants.FinancialActivity;
import org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccount;
import org.apache.fineract.accounting.financialactivityaccount.domain.FinancialActivityAccountRepositoryWrapper;
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
@@ -411,9 +411,9 @@ public class TellerWritePlatformServiceJpaImpl implements TellerWritePlatformSer
// Pass the journal entries
FinancialActivityAccount mainVaultFinancialActivityAccount = this.financialActivityAccountRepositoryWrapper
- .findByFinancialActivityTypeWithNotFoundDetection(FINANCIAL_ACTIVITY.CASH_AT_MAINVAULT.getValue());
+ .findByFinancialActivityTypeWithNotFoundDetection(FinancialActivity.CASH_AT_MAINVAULT.getValue());
FinancialActivityAccount tellerCashFinancialActivityAccount = this.financialActivityAccountRepositoryWrapper
- .findByFinancialActivityTypeWithNotFoundDetection(FINANCIAL_ACTIVITY.CASH_AT_TELLER.getValue());
+ .findByFinancialActivityTypeWithNotFoundDetection(FinancialActivity.CASH_AT_TELLER.getValue());
GLAccount creditAccount = null;
GLAccount debitAccount = null;
if (txnType.equals(CashierTxnType.ALLOCATE)) {
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/CalendarConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/CalendarConstants.java
index b96eee544..c380b4ba7 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/CalendarConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/CalendarConstants.java
@@ -25,7 +25,7 @@ public class CalendarConstants {
public static final String CALENDAR_RESOURCE_NAME = "calendar";
- public static enum CALENDAR_SUPPORTED_PARAMETERS {
+ public static enum CalendarSupportedParameters {
CALENDAR_ID("id"), ENTITY_TYPE("entityType"), ENTITY_ID("entityId"), TITLE("title"), DESCRIPTION("description"), LOCATION(
"location"), START_DATE("startDate"), END_DATE("endDate"), CREATED_DATE("createdDate"), DURATION("duration"), TYPE_ID(
"typeId"), REPEATING("repeating"), REMIND_BY_ID("remindById"), FIRST_REMINDER("firstReminder"), SECOND_REMINDER(
@@ -36,13 +36,13 @@ public class CalendarConstants {
private final String value;
- private CALENDAR_SUPPORTED_PARAMETERS(final String value) {
+ private CalendarSupportedParameters(final String value) {
this.value = value;
}
private static final Set values = new HashSet<>();
static {
- for (final CALENDAR_SUPPORTED_PARAMETERS param : CALENDAR_SUPPORTED_PARAMETERS.values()) {
+ for (final CalendarSupportedParameters param : CalendarSupportedParameters.values()) {
values.add(param.value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java
index 50047ac35..da8cf1d48 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/Calendar.java
@@ -42,7 +42,7 @@ import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
import org.apache.fineract.infrastructure.core.service.DateUtils;
-import org.apache.fineract.portfolio.calendar.CalendarConstants.CALENDAR_SUPPORTED_PARAMETERS;
+import org.apache.fineract.portfolio.calendar.CalendarConstants.CalendarSupportedParameters;
import org.apache.fineract.portfolio.calendar.exception.CalendarDateException;
import org.apache.fineract.portfolio.calendar.exception.CalendarParameterUpdateNotSupportedException;
import org.apache.fineract.portfolio.calendar.service.CalendarUtils;
@@ -113,7 +113,7 @@ public class Calendar extends AbstractAuditableCustom {
final CalendarType calendarType = CalendarType.fromInt(typeId);
if (calendarType.isCollection() && !repeating) {
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue())
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.REPEATING.getValue())
.failWithCodeNoParameterAddedToErrorCode("must.repeat.for.collection.calendar");
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
}
@@ -172,20 +172,20 @@ public class Calendar extends AbstractAuditableCustom {
// final Integer entityTypeId =
// CalendarEntityType.valueOf(command.getSupportedEntityType().toUpperCase()).getValue();
Date meetingtime=null;
- final String title = command.stringValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue());
- final String description = command.stringValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue());
- final String location = command.stringValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue());
- final LocalDate startDate = command.localDateValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue());
- final LocalDate endDate = command.localDateValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue());
- final Integer duration = command.integerValueSansLocaleOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue());
- final Integer typeId = command.integerValueSansLocaleOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.TYPE_ID.getValue());
- final boolean repeating = command.booleanPrimitiveValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue());
- final Integer remindById = command.integerValueSansLocaleOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue());
- final Integer firstReminder = command.integerValueSansLocaleOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER
+ final String title = command.stringValueOfParameterNamed(CalendarSupportedParameters.TITLE.getValue());
+ final String description = command.stringValueOfParameterNamed(CalendarSupportedParameters.DESCRIPTION.getValue());
+ final String location = command.stringValueOfParameterNamed(CalendarSupportedParameters.LOCATION.getValue());
+ final LocalDate startDate = command.localDateValueOfParameterNamed(CalendarSupportedParameters.START_DATE.getValue());
+ final LocalDate endDate = command.localDateValueOfParameterNamed(CalendarSupportedParameters.END_DATE.getValue());
+ final Integer duration = command.integerValueSansLocaleOfParameterNamed(CalendarSupportedParameters.DURATION.getValue());
+ final Integer typeId = command.integerValueSansLocaleOfParameterNamed(CalendarSupportedParameters.TYPE_ID.getValue());
+ final boolean repeating = command.booleanPrimitiveValueOfParameterNamed(CalendarSupportedParameters.REPEATING.getValue());
+ final Integer remindById = command.integerValueSansLocaleOfParameterNamed(CalendarSupportedParameters.REMIND_BY_ID.getValue());
+ final Integer firstReminder = command.integerValueSansLocaleOfParameterNamed(CalendarSupportedParameters.FIRST_REMINDER
.getValue());
- final Integer secondReminder = command.integerValueSansLocaleOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER
+ final Integer secondReminder = command.integerValueSansLocaleOfParameterNamed(CalendarSupportedParameters.SECOND_REMINDER
.getValue());
- final LocalDateTime time= command.localTimeValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue());
+ final LocalDateTime time= command.localTimeValueOfParameterNamed(CalendarSupportedParameters.MEETING_TIME.getValue());
if(time!=null){
meetingtime=time.toDate();
}
@@ -213,7 +213,7 @@ public class Calendar extends AbstractAuditableCustom {
getStartDateLocalDate());
} else {
- actualChanges.put(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue(), newMeetingStartDate.toString());
+ actualChanges.put(CalendarSupportedParameters.START_DATE.getValue(), newMeetingStartDate.toString());
this.startDate = newMeetingStartDate.toDate();
/*
@@ -251,27 +251,27 @@ public class Calendar extends AbstractAuditableCustom {
final Map actualChanges = new LinkedHashMap<>(9);
- if (command.isChangeInStringParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue(), this.title)) {
- final String newValue = command.stringValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue());
- actualChanges.put(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue(), newValue);
+ if (command.isChangeInStringParameterNamed(CalendarSupportedParameters.TITLE.getValue(), this.title)) {
+ final String newValue = command.stringValueOfParameterNamed(CalendarSupportedParameters.TITLE.getValue());
+ actualChanges.put(CalendarSupportedParameters.TITLE.getValue(), newValue);
this.title = StringUtils.defaultIfEmpty(newValue, null);
}
- if (command.isChangeInStringParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue(), this.description)) {
- final String newValue = command.stringValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue());
- actualChanges.put(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue(), newValue);
+ if (command.isChangeInStringParameterNamed(CalendarSupportedParameters.DESCRIPTION.getValue(), this.description)) {
+ final String newValue = command.stringValueOfParameterNamed(CalendarSupportedParameters.DESCRIPTION.getValue());
+ actualChanges.put(CalendarSupportedParameters.DESCRIPTION.getValue(), newValue);
this.description = StringUtils.defaultIfEmpty(newValue, null);
}
- if (command.isChangeInStringParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue(), this.location)) {
- final String newValue = command.stringValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue());
- actualChanges.put(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue(), newValue);
+ if (command.isChangeInStringParameterNamed(CalendarSupportedParameters.LOCATION.getValue(), this.location)) {
+ final String newValue = command.stringValueOfParameterNamed(CalendarSupportedParameters.LOCATION.getValue());
+ actualChanges.put(CalendarSupportedParameters.LOCATION.getValue(), newValue);
this.location = StringUtils.defaultIfEmpty(newValue, null);
}
final String dateFormatAsInput = command.dateFormat();
final String localeAsInput = command.locale();
- final String startDateParamName = CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue();
+ final String startDateParamName = CalendarSupportedParameters.START_DATE.getValue();
if (command.isChangeInLocalDateParameterNamed(startDateParamName, getStartDateLocalDate())) {
final String valueAsInput = command.stringValueOfParameterNamed(startDateParamName);
@@ -295,7 +295,7 @@ public class Calendar extends AbstractAuditableCustom {
}
}
- final String endDateParamName = CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue();
+ final String endDateParamName = CalendarSupportedParameters.END_DATE.getValue();
if (command.isChangeInLocalDateParameterNamed(endDateParamName, getEndDateLocalDate())) {
final String valueAsInput = command.stringValueOfParameterNamed(endDateParamName);
actualChanges.put(endDateParamName, valueAsInput);
@@ -306,7 +306,7 @@ public class Calendar extends AbstractAuditableCustom {
this.endDate = newValue.toDate();
}
- final String durationParamName = CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue();
+ final String durationParamName = CalendarSupportedParameters.DURATION.getValue();
if (command.isChangeInIntegerSansLocaleParameterNamed(durationParamName, this.duration)) {
final Integer newValue = command.integerValueSansLocaleOfParameterNamed(durationParamName);
actualChanges.put(durationParamName, newValue);
@@ -316,7 +316,7 @@ public class Calendar extends AbstractAuditableCustom {
// Do not allow to change calendar type
// TODO: AA Instead of throwing an exception, do not allow meeting
// calendar type to update.
- final String typeParamName = CALENDAR_SUPPORTED_PARAMETERS.TYPE_ID.getValue();
+ final String typeParamName = CalendarSupportedParameters.TYPE_ID.getValue();
if (command.isChangeInIntegerSansLocaleParameterNamed(typeParamName, this.typeId)) {
final Integer newValue = command.integerValueSansLocaleOfParameterNamed(typeParamName);
final String defaultUserMessage = "Meeting calendar type update is not supported";
@@ -332,7 +332,7 @@ public class Calendar extends AbstractAuditableCustom {
*/
}
- final String repeatingParamName = CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue();
+ final String repeatingParamName = CalendarSupportedParameters.REPEATING.getValue();
if (command.isChangeInBooleanParameterNamed(repeatingParamName, this.repeating)) {
final boolean newValue = command.booleanPrimitiveValueOfParameterNamed(repeatingParamName);
actualChanges.put(repeatingParamName, newValue);
@@ -347,7 +347,7 @@ public class Calendar extends AbstractAuditableCustom {
final CalendarType calendarType = CalendarType.fromInt(this.typeId);
if (calendarType.isCollection() && !this.repeating) {
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue())
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.REPEATING.getValue())
.failWithCodeNoParameterAddedToErrorCode("must.repeat.for.collection.calendar");
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException(dataValidationErrors); }
}
@@ -378,32 +378,32 @@ public class Calendar extends AbstractAuditableCustom {
this.recurrence = StringUtils.defaultIfEmpty(newRecurrence, null);
}
- final String remindByParamName = CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue();
+ final String remindByParamName = CalendarSupportedParameters.REMIND_BY_ID.getValue();
if (command.isChangeInIntegerSansLocaleParameterNamed(remindByParamName, this.remindById)) {
final Integer newValue = command.integerValueSansLocaleOfParameterNamed(remindByParamName);
actualChanges.put(remindByParamName, newValue);
this.remindById = newValue;
}
- final String firstRemindarParamName = CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER.getValue();
+ final String firstRemindarParamName = CalendarSupportedParameters.FIRST_REMINDER.getValue();
if (command.isChangeInIntegerSansLocaleParameterNamed(firstRemindarParamName, this.firstReminder)) {
final Integer newValue = command.integerValueSansLocaleOfParameterNamed(firstRemindarParamName);
actualChanges.put(firstRemindarParamName, newValue);
this.firstReminder = newValue;
}
- final String secondRemindarParamName = CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER.getValue();
+ final String secondRemindarParamName = CalendarSupportedParameters.SECOND_REMINDER.getValue();
if (command.isChangeInIntegerSansLocaleParameterNamed(secondRemindarParamName, this.secondReminder)) {
final Integer newValue = command.integerValueSansLocaleOfParameterNamed(secondRemindarParamName);
actualChanges.put(secondRemindarParamName, newValue);
this.secondReminder = newValue;
}
- final String timeFormat = command.stringValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.Time_Format.getValue());
- final String time = CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue();
- if (command.isChangeInTimeParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue(), this.meetingtime,timeFormat)) {
- final String newValue = command.stringValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue());
- actualChanges.put(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue(), newValue);
+ final String timeFormat = command.stringValueOfParameterNamed(CalendarSupportedParameters.Time_Format.getValue());
+ final String time = CalendarSupportedParameters.MEETING_TIME.getValue();
+ if (command.isChangeInTimeParameterNamed(CalendarSupportedParameters.MEETING_TIME.getValue(), this.meetingtime,timeFormat)) {
+ final String newValue = command.stringValueOfParameterNamed(CalendarSupportedParameters.MEETING_TIME.getValue());
+ actualChanges.put(CalendarSupportedParameters.MEETING_TIME.getValue(), newValue);
LocalDateTime timeInLocalDateTimeFormat=command.localTimeValueOfParameterNamed(time);
if(timeInLocalDateTimeFormat!=null){
this.meetingtime= timeInLocalDateTimeFormat.toDate();
@@ -546,8 +546,8 @@ public class Calendar extends AbstractAuditableCustom {
private static String constructRecurrence(final JsonCommand command, final Calendar calendar) {
final boolean repeating;
- if (command.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue())) {
- repeating = command.booleanPrimitiveValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue());
+ if (command.parameterExists(CalendarSupportedParameters.REPEATING.getValue())) {
+ repeating = command.booleanPrimitiveValueOfParameterNamed(CalendarSupportedParameters.REPEATING.getValue());
} else if (calendar != null) {
repeating = calendar.isRepeating();
} else {
@@ -555,22 +555,22 @@ public class Calendar extends AbstractAuditableCustom {
}
if (repeating) {
- final Integer frequency = command.integerValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.FREQUENCY.getValue());
+ final Integer frequency = command.integerValueOfParameterNamed(CalendarSupportedParameters.FREQUENCY.getValue());
final CalendarFrequencyType frequencyType = CalendarFrequencyType.fromInt(frequency);
- final Integer interval = command.integerValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.INTERVAL.getValue());
+ final Integer interval = command.integerValueOfParameterNamed(CalendarSupportedParameters.INTERVAL.getValue());
Integer repeatsOnDay = null;
if (frequencyType.isWeekly()) {
- repeatsOnDay = command.integerValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_DAY.getValue());
+ repeatsOnDay = command.integerValueOfParameterNamed(CalendarSupportedParameters.REPEATS_ON_DAY.getValue());
}
Integer repeatsOnNthDayOfMonth = null;
if (frequencyType.isMonthly()) {
- repeatsOnNthDayOfMonth = command.integerValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_NTH_DAY_OF_MONTH
+ repeatsOnNthDayOfMonth = command.integerValueOfParameterNamed(CalendarSupportedParameters.REPEATS_ON_NTH_DAY_OF_MONTH
.getValue());
final NthDayType nthDay = NthDayType.fromInt(repeatsOnNthDayOfMonth);
- repeatsOnDay = command.integerValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_LAST_WEEKDAY_OF_MONTH
+ repeatsOnDay = command.integerValueOfParameterNamed(CalendarSupportedParameters.REPEATS_ON_LAST_WEEKDAY_OF_MONTH
.getValue());
if (nthDay.isOnDay()) {
- repeatsOnNthDayOfMonth = command.integerValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_DAY_OF_MONTH
+ repeatsOnNthDayOfMonth = command.integerValueOfParameterNamed(CalendarSupportedParameters.REPEATS_ON_DAY_OF_MONTH
.getValue());
repeatsOnDay = null;
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/serialization/CalendarCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/serialization/CalendarCommandFromApiJsonDeserializer.java
index 192e1d696..81e11db4d 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/serialization/CalendarCommandFromApiJsonDeserializer.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/serialization/CalendarCommandFromApiJsonDeserializer.java
@@ -32,7 +32,7 @@ import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
import org.apache.fineract.infrastructure.core.serialization.AbstractFromApiJsonDeserializer;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
-import org.apache.fineract.portfolio.calendar.CalendarConstants.CALENDAR_SUPPORTED_PARAMETERS;
+import org.apache.fineract.portfolio.calendar.CalendarConstants.CalendarSupportedParameters;
import org.apache.fineract.portfolio.calendar.command.CalendarCommand;
import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType;
import org.apache.fineract.portfolio.calendar.domain.CalendarFrequencyType;
@@ -50,7 +50,7 @@ public class CalendarCommandFromApiJsonDeserializer extends AbstractFromApiJsonD
/**
* The parameters supported for this command.
*/
- private final Set supportedParameters = CALENDAR_SUPPORTED_PARAMETERS.getAllValues();
+ private final Set supportedParameters = CalendarSupportedParameters.getAllValues();
private final FromJsonHelper fromApiJsonHelper;
@@ -67,25 +67,25 @@ public class CalendarCommandFromApiJsonDeserializer extends AbstractFromApiJsonD
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.supportedParameters);
final JsonElement element = this.fromApiJsonHelper.parse(json);
- final String title = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue(), element);
- final String description = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue(), element);
- final String location = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue(), element);
- final LocalDate startDate = this.fromApiJsonHelper.extractLocalDateNamed(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue(),
+ final String title = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.TITLE.getValue(), element);
+ final String description = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.DESCRIPTION.getValue(), element);
+ final String location = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.LOCATION.getValue(), element);
+ final LocalDate startDate = this.fromApiJsonHelper.extractLocalDateNamed(CalendarSupportedParameters.START_DATE.getValue(),
element);
- final LocalDate endDate = this.fromApiJsonHelper.extractLocalDateNamed(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue(), element);
- final LocalDate createdDate = this.fromApiJsonHelper.extractLocalDateNamed(CALENDAR_SUPPORTED_PARAMETERS.CREATED_DATE.getValue(),
+ final LocalDate endDate = this.fromApiJsonHelper.extractLocalDateNamed(CalendarSupportedParameters.END_DATE.getValue(), element);
+ final LocalDate createdDate = this.fromApiJsonHelper.extractLocalDateNamed(CalendarSupportedParameters.CREATED_DATE.getValue(),
element);
- final Integer duration = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue(),
+ final Integer duration = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CalendarSupportedParameters.DURATION.getValue(),
element);
- final Integer typeId = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CALENDAR_SUPPORTED_PARAMETERS.TYPE_ID.getValue(),
+ final Integer typeId = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CalendarSupportedParameters.TYPE_ID.getValue(),
element);
- final boolean repeating = this.fromApiJsonHelper.extractBooleanNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue(), element);
+ final boolean repeating = this.fromApiJsonHelper.extractBooleanNamed(CalendarSupportedParameters.REPEATING.getValue(), element);
final Integer remindById = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue(), element);
+ CalendarSupportedParameters.REMIND_BY_ID.getValue(), element);
final Integer firstReminder = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER.getValue(), element);
+ CalendarSupportedParameters.FIRST_REMINDER.getValue(), element);
final Integer secondReminder = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER.getValue(), element);
+ CalendarSupportedParameters.SECOND_REMINDER.getValue(), element);
return new CalendarCommand(title, description, location, startDate, endDate, createdDate, duration, typeId, repeating, remindById,
firstReminder, secondReminder);
@@ -103,107 +103,107 @@ public class CalendarCommandFromApiJsonDeserializer extends AbstractFromApiJsonD
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("calendar");
- final String title = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue()).value(title).notBlank()
+ final String title = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.TITLE.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.TITLE.getValue()).value(title).notBlank()
.notExceedingLengthOf(50);
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue(), element)) {
- final String description = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.DESCRIPTION.getValue(), element)) {
+ final String description = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.DESCRIPTION.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue()).value(description).ignoreIfNull()
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.DESCRIPTION.getValue()).value(description).ignoreIfNull()
.notExceedingLengthOf(100);
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue(), element)) {
- final String location = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue()).value(location).ignoreIfNull()
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.LOCATION.getValue(), element)) {
+ final String location = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.LOCATION.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.LOCATION.getValue()).value(location).ignoreIfNull()
.notExceedingLengthOf(50);
}
- final String startDateStr = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue()).value(startDateStr).notBlank();
+ final String startDateStr = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.START_DATE.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.START_DATE.getValue()).value(startDateStr).notBlank();
if (!StringUtils.isBlank(startDateStr)) {
- final LocalDate startDate = this.fromApiJsonHelper.extractLocalDateNamed(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue(),
+ final LocalDate startDate = this.fromApiJsonHelper.extractLocalDateNamed(CalendarSupportedParameters.START_DATE.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue()).value(startDate).notNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.START_DATE.getValue()).value(startDate).notNull();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue(), element)) {
- final String endDateStr = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue()).value(endDateStr).notBlank();
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.END_DATE.getValue(), element)) {
+ final String endDateStr = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.END_DATE.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.END_DATE.getValue()).value(endDateStr).notBlank();
- final LocalDate endDate = this.fromApiJsonHelper.extractLocalDateNamed(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue(),
+ final LocalDate endDate = this.fromApiJsonHelper.extractLocalDateNamed(CalendarSupportedParameters.END_DATE.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue()).value(endDate).notNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.END_DATE.getValue()).value(endDate).notNull();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.DURATION.getValue(), element)) {
final Integer duration = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue()).value(duration).ignoreIfNull();
+ CalendarSupportedParameters.DURATION.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.DURATION.getValue()).value(duration).ignoreIfNull();
}
- final Integer typeId = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CALENDAR_SUPPORTED_PARAMETERS.TYPE_ID.getValue(),
+ final Integer typeId = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CalendarSupportedParameters.TYPE_ID.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.TYPE_ID.getValue()).value(typeId).notNull()
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.TYPE_ID.getValue()).value(typeId).notNull()
.inMinMaxRange(CalendarEntityType.getMinValue(), CalendarEntityType.getMaxValue());
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.REPEATING.getValue(), element)) {
// FIXME - Throws NullPointerException when boolean value is null
- final boolean repeating = this.fromApiJsonHelper.extractBooleanNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue(),
+ final boolean repeating = this.fromApiJsonHelper.extractBooleanNamed(CalendarSupportedParameters.REPEATING.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue()).value(repeating).notNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.REPEATING.getValue()).value(repeating).notNull();
if (repeating) {
final Integer frequency = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.FREQUENCY.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.FREQUENCY.getValue()).value(frequency).notBlank()
+ CalendarSupportedParameters.FREQUENCY.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.FREQUENCY.getValue()).value(frequency).notBlank()
.inMinMaxRange(CalendarFrequencyType.getMinValue(), CalendarFrequencyType.getMaxValue());
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.INTERVAL.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.INTERVAL.getValue(), element)) {
final Integer interval = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.INTERVAL.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.INTERVAL.getValue()).value(interval).notNull()
+ CalendarSupportedParameters.INTERVAL.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.INTERVAL.getValue()).value(interval).notNull()
.integerGreaterThanZero();
}
if (CalendarFrequencyType.fromInt(frequency).isWeekly()) {
final Integer repeatsOnDay = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_DAY.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_DAY.getValue()).value(repeatsOnDay)
+ CalendarSupportedParameters.REPEATS_ON_DAY.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.REPEATS_ON_DAY.getValue()).value(repeatsOnDay)
.notBlank().inMinMaxRange(CalendarWeekDaysType.getMinValue(), CalendarWeekDaysType.getMaxValue());
} else if (CalendarFrequencyType.fromInt(frequency).isMonthly()) {
CalendarUtils.validateNthDayOfMonthFrequency(baseDataValidator,
- CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_NTH_DAY_OF_MONTH.getValue(),
- CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_LAST_WEEKDAY_OF_MONTH.getValue(), element, this.fromApiJsonHelper);
+ CalendarSupportedParameters.REPEATS_ON_NTH_DAY_OF_MONTH.getValue(),
+ CalendarSupportedParameters.REPEATS_ON_LAST_WEEKDAY_OF_MONTH.getValue(), element, this.fromApiJsonHelper);
}
}
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.REMIND_BY_ID.getValue(), element)) {
final Integer remindById = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue()).value(remindById).ignoreIfNull()
+ CalendarSupportedParameters.REMIND_BY_ID.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.REMIND_BY_ID.getValue()).value(remindById).ignoreIfNull()
.inMinMaxRange(CalendarRemindBy.getMinValue(), CalendarRemindBy.getMaxValue());
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.FIRST_REMINDER.getValue(), element)) {
final Integer firstReminder = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER.getValue()).value(firstReminder)
+ CalendarSupportedParameters.FIRST_REMINDER.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.FIRST_REMINDER.getValue()).value(firstReminder)
.ignoreIfNull().integerGreaterThanZero();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.SECOND_REMINDER.getValue(), element)) {
final Integer secondReminder = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER.getValue()).value(secondReminder)
+ CalendarSupportedParameters.SECOND_REMINDER.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.SECOND_REMINDER.getValue()).value(secondReminder)
.ignoreIfNull().integerGreaterThanZero();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue(), element)) {
- final LocalDateTime meetingTime = this.fromApiJsonHelper.extractLocalTimeNamed(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.MEETING_TIME.getValue(), element)) {
+ final LocalDateTime meetingTime = this.fromApiJsonHelper.extractLocalTimeNamed(CalendarSupportedParameters.MEETING_TIME.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue()).value(meetingTime).ignoreIfNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.MEETING_TIME.getValue()).value(meetingTime).ignoreIfNull();
}
@@ -223,130 +223,130 @@ public class CalendarCommandFromApiJsonDeserializer extends AbstractFromApiJsonD
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("calendar");
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.RESCHEDULE_BASED_ON_MEETING_DATES.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.RESCHEDULE_BASED_ON_MEETING_DATES.getValue(), element)) {
final Boolean rescheduleBasedOnMeetingDates = this.fromApiJsonHelper.extractBooleanNamed(
- CALENDAR_SUPPORTED_PARAMETERS.RESCHEDULE_BASED_ON_MEETING_DATES.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.RESCHEDULE_BASED_ON_MEETING_DATES.getValue())
+ CalendarSupportedParameters.RESCHEDULE_BASED_ON_MEETING_DATES.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.RESCHEDULE_BASED_ON_MEETING_DATES.getValue())
.value(rescheduleBasedOnMeetingDates).validateForBooleanValue();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.PRESENT_MEETING_DATE.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.PRESENT_MEETING_DATE.getValue(), element)) {
final String presentMeetingDate = this.fromApiJsonHelper.extractStringNamed(
- CALENDAR_SUPPORTED_PARAMETERS.PRESENT_MEETING_DATE.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.PRESENT_MEETING_DATE.getValue()).value(presentMeetingDate)
+ CalendarSupportedParameters.PRESENT_MEETING_DATE.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.PRESENT_MEETING_DATE.getValue()).value(presentMeetingDate)
.notNull();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.NEW_MEETING_DATE.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.NEW_MEETING_DATE.getValue(), element)) {
final String newMeetingDate = this.fromApiJsonHelper.extractStringNamed(
- CALENDAR_SUPPORTED_PARAMETERS.NEW_MEETING_DATE.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.NEW_MEETING_DATE.getValue()).value(newMeetingDate).notNull();
+ CalendarSupportedParameters.NEW_MEETING_DATE.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.NEW_MEETING_DATE.getValue()).value(newMeetingDate).notNull();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue(), element)) {
- final String title = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.TITLE.getValue()).value(title).notBlank()
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.TITLE.getValue(), element)) {
+ final String title = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.TITLE.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.TITLE.getValue()).value(title).notBlank()
.notExceedingLengthOf(50);
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue(), element)) {
- final String description = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.DESCRIPTION.getValue(), element)) {
+ final String description = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.DESCRIPTION.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.DESCRIPTION.getValue()).value(description).ignoreIfNull()
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.DESCRIPTION.getValue()).value(description).ignoreIfNull()
.notExceedingLengthOf(100);
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue(), element)) {
- final String location = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.LOCATION.getValue()).value(location).ignoreIfNull()
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.LOCATION.getValue(), element)) {
+ final String location = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.LOCATION.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.LOCATION.getValue()).value(location).ignoreIfNull()
.notExceedingLengthOf(50);
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue(), element)) {
- final String startDateStr = this.fromApiJsonHelper.extractStringNamed(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.START_DATE.getValue(), element)) {
+ final String startDateStr = this.fromApiJsonHelper.extractStringNamed(CalendarSupportedParameters.START_DATE.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue()).value(startDateStr).notNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.START_DATE.getValue()).value(startDateStr).notNull();
- final LocalDate startDate = this.fromApiJsonHelper.extractLocalDateNamed(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue(),
+ final LocalDate startDate = this.fromApiJsonHelper.extractLocalDateNamed(CalendarSupportedParameters.START_DATE.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue()).value(startDate).notNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.START_DATE.getValue()).value(startDate).notNull();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue(), element)) {
- final LocalDate endDate = this.fromApiJsonHelper.extractLocalDateNamed(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.END_DATE.getValue(), element)) {
+ final LocalDate endDate = this.fromApiJsonHelper.extractLocalDateNamed(CalendarSupportedParameters.END_DATE.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.END_DATE.getValue()).value(endDate).notNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.END_DATE.getValue()).value(endDate).notNull();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.DURATION.getValue(), element)) {
final Integer duration = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.DURATION.getValue()).value(duration).ignoreIfNull();
+ CalendarSupportedParameters.DURATION.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.DURATION.getValue()).value(duration).ignoreIfNull();
}
// TODO: AA do not allow to change calendar type.
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.TYPE_ID.getValue(), element)) {
- final Integer typeId = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CALENDAR_SUPPORTED_PARAMETERS.TYPE_ID.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.TYPE_ID.getValue(), element)) {
+ final Integer typeId = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(CalendarSupportedParameters.TYPE_ID.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.TYPE_ID.getValue()).value(typeId).notNull()
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.TYPE_ID.getValue()).value(typeId).notNull()
.inMinMaxRange(CalendarEntityType.getMinValue(), CalendarEntityType.getMaxValue());
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.REPEATING.getValue(), element)) {
// FIXME - Throws NullPointerException when boolean value is null
- final boolean repeating = this.fromApiJsonHelper.extractBooleanNamed(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue(),
+ final boolean repeating = this.fromApiJsonHelper.extractBooleanNamed(CalendarSupportedParameters.REPEATING.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.REPEATING.getValue()).value(repeating).notNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.REPEATING.getValue()).value(repeating).notNull();
if (repeating) {
final Integer frequency = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.FREQUENCY.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.FREQUENCY.getValue()).value(frequency).notBlank()
+ CalendarSupportedParameters.FREQUENCY.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.FREQUENCY.getValue()).value(frequency).notBlank()
.inMinMaxRange(CalendarFrequencyType.getMinValue(), CalendarFrequencyType.getMaxValue());
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.INTERVAL.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.INTERVAL.getValue(), element)) {
final Integer interval = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.INTERVAL.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.INTERVAL.getValue()).value(interval).notNull()
+ CalendarSupportedParameters.INTERVAL.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.INTERVAL.getValue()).value(interval).notNull()
.integerGreaterThanZero();
}
if (CalendarFrequencyType.fromInt(frequency).isWeekly()) {
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_DAY.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.REPEATS_ON_DAY.getValue(), element)) {
final Integer repeatsOnDay = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_DAY.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_DAY.getValue()).value(repeatsOnDay)
+ CalendarSupportedParameters.REPEATS_ON_DAY.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.REPEATS_ON_DAY.getValue()).value(repeatsOnDay)
.notBlank().inMinMaxRange(CalendarWeekDaysType.getMinValue(), CalendarWeekDaysType.getMaxValue());
}
} else if (CalendarFrequencyType.fromInt(frequency).isMonthly()) {
CalendarUtils.validateNthDayOfMonthFrequency(baseDataValidator,
- CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_NTH_DAY_OF_MONTH.getValue(),
- CALENDAR_SUPPORTED_PARAMETERS.REPEATS_ON_LAST_WEEKDAY_OF_MONTH.getValue(), element, this.fromApiJsonHelper);
+ CalendarSupportedParameters.REPEATS_ON_NTH_DAY_OF_MONTH.getValue(),
+ CalendarSupportedParameters.REPEATS_ON_LAST_WEEKDAY_OF_MONTH.getValue(), element, this.fromApiJsonHelper);
}
}
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.REMIND_BY_ID.getValue(), element)) {
final Integer remindById = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.REMIND_BY_ID.getValue()).value(remindById).ignoreIfNull()
+ CalendarSupportedParameters.REMIND_BY_ID.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.REMIND_BY_ID.getValue()).value(remindById).ignoreIfNull()
.inMinMaxRange(CalendarRemindBy.getMinValue(), CalendarRemindBy.getMaxValue());
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.FIRST_REMINDER.getValue(), element)) {
final Integer firstReminder = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.FIRST_REMINDER.getValue()).value(firstReminder)
+ CalendarSupportedParameters.FIRST_REMINDER.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.FIRST_REMINDER.getValue()).value(firstReminder)
.ignoreIfNull();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER.getValue(), element)) {
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.SECOND_REMINDER.getValue(), element)) {
final Integer secondReminder = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(
- CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER.getValue(), element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.SECOND_REMINDER.getValue()).value(secondReminder)
+ CalendarSupportedParameters.SECOND_REMINDER.getValue(), element);
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.SECOND_REMINDER.getValue()).value(secondReminder)
.ignoreIfNull();
}
- if (this.fromApiJsonHelper.parameterExists(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue(), element)) {
- final LocalDateTime startDate = this.fromApiJsonHelper.extractLocalTimeNamed(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue(),
+ if (this.fromApiJsonHelper.parameterExists(CalendarSupportedParameters.MEETING_TIME.getValue(), element)) {
+ final LocalDateTime startDate = this.fromApiJsonHelper.extractLocalTimeNamed(CalendarSupportedParameters.MEETING_TIME.getValue(),
element);
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.MEETING_TIME.getValue()).value(startDate).ignoreIfNull();
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.MEETING_TIME.getValue()).value(startDate).ignoreIfNull();
}
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist",
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java
index c362e496b..4e1eacfeb 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/service/CalendarWritePlatformServiceJpaRepositoryImpl.java
@@ -32,7 +32,7 @@ import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
-import org.apache.fineract.portfolio.calendar.CalendarConstants.CALENDAR_SUPPORTED_PARAMETERS;
+import org.apache.fineract.portfolio.calendar.CalendarConstants.CalendarSupportedParameters;
import org.apache.fineract.portfolio.calendar.domain.Calendar;
import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType;
import org.apache.fineract.portfolio.calendar.domain.CalendarHistory;
@@ -125,7 +125,7 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr
if (entityActivationDate != null) dateAsString = formatter.print(entityActivationDate);
final String errorMessage = "cannot.be.before." + entityType.name().toLowerCase() + ".activation.date";
- baseDataValidator.reset().parameter(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue()).value(dateAsString)
+ baseDataValidator.reset().parameter(CalendarSupportedParameters.START_DATE.getValue()).value(dateAsString)
.failWithCodeNoParameterAddedToErrorCode(errorMessage);
}
@@ -244,7 +244,7 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr
Map changes = null;
final Boolean reschedulebasedOnMeetingDates = command
- .booleanObjectValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.RESCHEDULE_BASED_ON_MEETING_DATES.getValue());
+ .booleanObjectValueOfParameterNamed(CalendarSupportedParameters.RESCHEDULE_BASED_ON_MEETING_DATES.getValue());
/*
* System allows to change the meeting date by two means,
@@ -269,8 +269,8 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr
if (reschedulebasedOnMeetingDates != null && reschedulebasedOnMeetingDates) {
- newMeetingDate = command.localDateValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.NEW_MEETING_DATE.getValue());
- presentMeetingDate = command.localDateValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.PRESENT_MEETING_DATE.getValue());
+ newMeetingDate = command.localDateValueOfParameterNamed(CalendarSupportedParameters.NEW_MEETING_DATE.getValue());
+ presentMeetingDate = command.localDateValueOfParameterNamed(CalendarSupportedParameters.PRESENT_MEETING_DATE.getValue());
/*
* New meeting date proposed will become the new start date for the
@@ -287,7 +287,7 @@ public class CalendarWritePlatformServiceJpaRepositoryImpl implements CalendarWr
// update calendar history table only if there is a change in
// calendar start date.
if (reschedulebasedOnMeetingDates == null){
- presentMeetingDate = command.localDateValueOfParameterNamed(CALENDAR_SUPPORTED_PARAMETERS.START_DATE.getValue());
+ presentMeetingDate = command.localDateValueOfParameterNamed(CalendarSupportedParameters.START_DATE.getValue());
}
if (null != newMeetingDate) {
final Date endDate = presentMeetingDate.minusDays(1).toDate();
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeDeletedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeDeletedException.java
index a2540ce8d..25ef2e30c 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeDeletedException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeDeletedException.java
@@ -23,7 +23,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class LoanChargeCannotBeDeletedException extends AbstractPlatformDomainRuleException {
/*** enum of reasons of why Loan Charge cannot be waived **/
- public static enum LOAN_CHARGE_CANNOT_BE_DELETED_REASON {
+ public static enum LoanChargeCannotBeDeletedReason {
ALREADY_PAID, ALREADY_WAIVED, LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE;
public String errorMessage() {
@@ -45,7 +45,7 @@ public class LoanChargeCannotBeDeletedException extends AbstractPlatformDomainRu
}
}
- public LoanChargeCannotBeDeletedException(final LOAN_CHARGE_CANNOT_BE_DELETED_REASON reason, final Long loanChargeId) {
+ public LoanChargeCannotBeDeletedException(final LoanChargeCannotBeDeletedReason reason, final Long loanChargeId) {
super(reason.errorCode(), reason.errorMessage(), loanChargeId);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBePayedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBePayedException.java
index 8a2ed1c3d..c391ae75a 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBePayedException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBePayedException.java
@@ -23,7 +23,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class LoanChargeCannotBePayedException extends AbstractPlatformDomainRuleException {
/*** enum of reasons of why Loan Charge cannot be waived **/
- public static enum LOAN_CHARGE_CANNOT_BE_PAYED_REASON {
+ public static enum LoanChargeCannotBePayedReason {
ALREADY_PAID, ALREADY_WAIVED, LOAN_INACTIVE, CHARGE_NOT_ACCOUNT_TRANSFER, CHARGE_NOT_PAYABLE;
public String errorMessage() {
@@ -54,7 +54,7 @@ public class LoanChargeCannotBePayedException extends AbstractPlatformDomainRule
}
}
- public LoanChargeCannotBePayedException(final LOAN_CHARGE_CANNOT_BE_PAYED_REASON reason, final Long loanChargeId) {
+ public LoanChargeCannotBePayedException(final LoanChargeCannotBePayedReason reason, final Long loanChargeId) {
super(reason.errorCode(), reason.errorMessage(), loanChargeId);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeUpdatedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeUpdatedException.java
index fd56d1a1d..220dea060 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeUpdatedException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeUpdatedException.java
@@ -23,7 +23,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class LoanChargeCannotBeUpdatedException extends AbstractPlatformDomainRuleException {
/*** enum of reasons of why Loan Charge cannot be waived **/
- public static enum LOAN_CHARGE_CANNOT_BE_UPDATED_REASON {
+ public static enum LoanChargeCannotBeUpdatedReason {
ALREADY_PAID, ALREADY_WAIVED, LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE;
public String errorMessage() {
@@ -45,7 +45,7 @@ public class LoanChargeCannotBeUpdatedException extends AbstractPlatformDomainRu
}
}
- public LoanChargeCannotBeUpdatedException(final LOAN_CHARGE_CANNOT_BE_UPDATED_REASON reason, final Long loanChargeId) {
+ public LoanChargeCannotBeUpdatedException(final LoanChargeCannotBeUpdatedReason reason, final Long loanChargeId) {
super(reason.errorCode(), reason.errorMessage(), loanChargeId);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeWaivedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeWaivedException.java
index 4507a7814..154b7ddec 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeWaivedException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/LoanChargeCannotBeWaivedException.java
@@ -23,7 +23,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class LoanChargeCannotBeWaivedException extends AbstractPlatformDomainRuleException {
/*** enum of reasons of why Loan Charge cannot be waived **/
- public static enum LOAN_CHARGE_CANNOT_BE_WAIVED_REASON {
+ public static enum LoanChargeCannotBeWaivedReason {
ALREADY_PAID, ALREADY_WAIVED, LOAN_INACTIVE, WAIVE_NOT_ALLOWED_FOR_CHARGE;
public String errorMessage() {
@@ -50,7 +50,7 @@ public class LoanChargeCannotBeWaivedException extends AbstractPlatformDomainRul
}
}
- public LoanChargeCannotBeWaivedException(final LOAN_CHARGE_CANNOT_BE_WAIVED_REASON reason, final Long loanChargeId) {
+ public LoanChargeCannotBeWaivedException(final LoanChargeCannotBeWaivedReason reason, final Long loanChargeId) {
super(reason.errorCode(), reason.errorMessage(), loanChargeId);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeCannotBeWaivedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeCannotBeWaivedException.java
index 891da1fe9..a9c7f4d8d 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeCannotBeWaivedException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/exception/SavingsAccountChargeCannotBeWaivedException.java
@@ -23,7 +23,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class SavingsAccountChargeCannotBeWaivedException extends AbstractPlatformDomainRuleException {
/*** enum of reasons of why Savings Account Charge cannot be waived **/
- public static enum SAVINGS_ACCOUNT_CHARGE_CANNOT_BE_WAIVED_REASON {
+ public static enum SavingsAccountChargeCannotBeWaivedReason {
ALREADY_PAID, ALREADY_WAIVED, SAVINGS_ACCOUNT_NOT_ACTIVE, SAVINGS_ACCOUNT_CLOSED;
public String errorMessage() {
@@ -49,7 +49,7 @@ public class SavingsAccountChargeCannotBeWaivedException extends AbstractPlatfor
}
}
- public SavingsAccountChargeCannotBeWaivedException(final SAVINGS_ACCOUNT_CHARGE_CANNOT_BE_WAIVED_REASON reason,
+ public SavingsAccountChargeCannotBeWaivedException(final SavingsAccountChargeCannotBeWaivedReason reason,
final Long savingsAccountChargeId) {
super(reason.errorCode(), reason.errorMessage(), savingsAccountChargeId);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java
index 493638f5d..7083106d9 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientWritePlatformServiceJpaRepositoryImpl.java
@@ -65,8 +65,8 @@ import org.apache.fineract.portfolio.client.exception.ClientHasNoStaffException;
import org.apache.fineract.portfolio.client.exception.ClientMustBePendingToBeDeletedException;
import org.apache.fineract.portfolio.client.exception.InvalidClientSavingProductException;
import org.apache.fineract.portfolio.client.exception.InvalidClientStateTransitionException;
-import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BUSINESS_ENTITY;
-import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BUSINESS_EVENTS;
+import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BusinessEntity;
+import org.apache.fineract.portfolio.common.BusinessEventNotificationConstants.BusinessEvents;
import org.apache.fineract.portfolio.common.service.BusinessEventNotifierService;
import org.apache.fineract.portfolio.group.domain.Group;
import org.apache.fineract.portfolio.group.domain.GroupRepository;
@@ -301,8 +301,8 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
this.clientRepository.save(newClient);
if (newClient.isActive()) {
- this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.CLIENTS_ACTIVATE,
- constructEntityMap(BUSINESS_ENTITY.CLIENT, newClient));
+ this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvents.CLIENTS_ACTIVATE,
+ constructEntityMap(BusinessEntity.CLIENT, newClient));
}
if (newClient.isAccountNumberRequiresAutoGeneration()) {
AccountNumberFormat accountNumberFormat = this.accountNumberFormatRepository.findByAccountType(EntityAccountType.CLIENT);
@@ -338,8 +338,8 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
command.arrayOfParameterNamed(ClientApiConstants.datatables));
}
- this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.CLIENTS_CREATE,
- constructEntityMap(BUSINESS_ENTITY.CLIENT, newClient));
+ this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvents.CLIENTS_CREATE,
+ constructEntityMap(BusinessEntity.CLIENT, newClient));
this.entityDatatableChecksWritePlatformService.runTheCheck(newClient.getId(), EntityTables.CLIENT.getName(),
StatusEnum.CREATE.getCode().longValue(), EntityTables.CLIENT.getForeignKeyColumnNameOnDatatable());
@@ -583,8 +583,8 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
client.activate(currentUser, fmt, activationDate);
CommandProcessingResult result = openSavingsAccount(client, fmt);
this.clientRepository.saveAndFlush(client);
- this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.CLIENTS_ACTIVATE,
- constructEntityMap(BUSINESS_ENTITY.CLIENT, client));
+ this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvents.CLIENTS_ACTIVATE,
+ constructEntityMap(BusinessEntity.CLIENT, client));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withOfficeId(client.officeId()) //
@@ -837,8 +837,8 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
}
client.reject(currentUser, rejectionReason, rejectionDate.toDate());
this.clientRepository.saveAndFlush(client);
- this.businessEventNotifierService.notifyBusinessEventWasExecuted(BUSINESS_EVENTS.CLIENTS_REJECT,
- constructEntityMap(BUSINESS_ENTITY.CLIENT, client));
+ this.businessEventNotifierService.notifyBusinessEventWasExecuted(BusinessEvents.CLIENTS_REJECT,
+ constructEntityMap(BusinessEntity.CLIENT, client));
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withClientId(entityId) //
@@ -956,8 +956,8 @@ public class ClientWritePlatformServiceJpaRepositoryImpl implements ClientWriteP
.build();
}
- private Map constructEntityMap(final BUSINESS_ENTITY entityEvent, Object entity) {
- Map map = new HashMap<>(1);
+ private Map constructEntityMap(final BusinessEntity entityEvent, Object entity) {
+ Map map = new HashMap<>(1);
map.put(entityEvent, entity);
return map;
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralApiConstants.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralApiConstants.java
index 063206b70..98d57792e 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralApiConstants.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/api/CollateralApiConstants.java
@@ -28,18 +28,18 @@ public class CollateralApiConstants {
/***
* Enum of all parameters passed in while creating/updating a collateral
***/
- public static enum COLLATERAL_JSON_INPUT_PARAMS {
+ public static enum CollateralJSONinputParams {
LOAN_ID("loanId"), COLLATERAL_ID("collateralId"), COLLATERAL_TYPE_ID("collateralTypeId"), VALUE("value"), DESCRIPTION("description");
private final String value;
- private COLLATERAL_JSON_INPUT_PARAMS(final String value) {
+ private CollateralJSONinputParams(final String value) {
this.value = value;
}
private static final Set values = new HashSet<>();
static {
- for (final COLLATERAL_JSON_INPUT_PARAMS type : COLLATERAL_JSON_INPUT_PARAMS.values()) {
+ for (final CollateralJSONinputParams type : CollateralJSONinputParams.values()) {
values.add(type.value);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/command/CollateralCommand.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/command/CollateralCommand.java
index 226e8c169..e792d0022 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/command/CollateralCommand.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/command/CollateralCommand.java
@@ -24,7 +24,7 @@ import java.util.List;
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
-import org.apache.fineract.portfolio.collateral.api.CollateralApiConstants.COLLATERAL_JSON_INPUT_PARAMS;
+import org.apache.fineract.portfolio.collateral.api.CollateralApiConstants.CollateralJSONinputParams;
/**
* Immutable command for creating or updating details of a Collateral.
@@ -58,11 +58,11 @@ public class CollateralCommand {
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("collateral");
- baseDataValidator.reset().parameter(COLLATERAL_JSON_INPUT_PARAMS.COLLATERAL_TYPE_ID.getValue()).value(this.collateralTypeId)
+ baseDataValidator.reset().parameter(CollateralJSONinputParams.COLLATERAL_TYPE_ID.getValue()).value(this.collateralTypeId)
.notNull().integerGreaterThanZero();
- baseDataValidator.reset().parameter(COLLATERAL_JSON_INPUT_PARAMS.VALUE.getValue()).value(this.value).ignoreIfNull()
+ baseDataValidator.reset().parameter(CollateralJSONinputParams.VALUE.getValue()).value(this.value).ignoreIfNull()
.positiveAmount();
- baseDataValidator.reset().parameter(COLLATERAL_JSON_INPUT_PARAMS.DESCRIPTION.getValue()).value(this.description).ignoreIfNull()
+ baseDataValidator.reset().parameter(CollateralJSONinputParams.DESCRIPTION.getValue()).value(this.description).ignoreIfNull()
.notExceedingLengthOf(500);
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist",
@@ -74,11 +74,11 @@ public class CollateralCommand {
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("collateral");
- baseDataValidator.reset().parameter(COLLATERAL_JSON_INPUT_PARAMS.COLLATERAL_TYPE_ID.getValue()).value(this.collateralTypeId)
+ baseDataValidator.reset().parameter(CollateralJSONinputParams.COLLATERAL_TYPE_ID.getValue()).value(this.collateralTypeId)
.ignoreIfNull().integerGreaterThanZero();
- baseDataValidator.reset().parameter(COLLATERAL_JSON_INPUT_PARAMS.VALUE.getValue()).value(this.value).ignoreIfNull()
+ baseDataValidator.reset().parameter(CollateralJSONinputParams.VALUE.getValue()).value(this.value).ignoreIfNull()
.positiveAmount();
- baseDataValidator.reset().parameter(COLLATERAL_JSON_INPUT_PARAMS.DESCRIPTION.getValue()).value(this.description).ignoreIfNull()
+ baseDataValidator.reset().parameter(CollateralJSONinputParams.DESCRIPTION.getValue()).value(this.description).ignoreIfNull()
.notExceedingLengthOf(500);
if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist",
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java
index 445ee924c..f2b4b17b1 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/domain/LoanCollateral.java
@@ -31,7 +31,7 @@ import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.domain.CodeValue;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
-import org.apache.fineract.portfolio.collateral.api.CollateralApiConstants.COLLATERAL_JSON_INPUT_PARAMS;
+import org.apache.fineract.portfolio.collateral.api.CollateralApiConstants.CollateralJSONinputParams;
import org.apache.fineract.portfolio.collateral.data.CollateralData;
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
@@ -79,8 +79,8 @@ public class LoanCollateral extends AbstractPersistableCustom {
}
public static LoanCollateral fromJson(final Loan loan, final CodeValue collateralType, final JsonCommand command) {
- final String description = command.stringValueOfParameterNamed(COLLATERAL_JSON_INPUT_PARAMS.DESCRIPTION.getValue());
- final BigDecimal value = command.bigDecimalValueOfParameterNamed(COLLATERAL_JSON_INPUT_PARAMS.VALUE.getValue());
+ final String description = command.stringValueOfParameterNamed(CollateralJSONinputParams.DESCRIPTION.getValue());
+ final BigDecimal value = command.bigDecimalValueOfParameterNamed(CollateralJSONinputParams.VALUE.getValue());
return new LoanCollateral(loan, collateralType, value, description);
}
@@ -88,20 +88,20 @@ public class LoanCollateral extends AbstractPersistableCustom {
final Map actualChanges = new LinkedHashMap<>(7);
- final String collateralTypeIdParamName = COLLATERAL_JSON_INPUT_PARAMS.COLLATERAL_TYPE_ID.getValue();
+ final String collateralTypeIdParamName = CollateralJSONinputParams.COLLATERAL_TYPE_ID.getValue();
if (command.isChangeInLongParameterNamed(collateralTypeIdParamName, this.type.getId())) {
final Long newValue = command.longValueOfParameterNamed(collateralTypeIdParamName);
actualChanges.put(collateralTypeIdParamName, newValue);
}
- final String descriptionParamName = COLLATERAL_JSON_INPUT_PARAMS.DESCRIPTION.getValue();
+ final String descriptionParamName = CollateralJSONinputParams.DESCRIPTION.getValue();
if (command.isChangeInStringParameterNamed(descriptionParamName, this.description)) {
final String newValue = command.stringValueOfParameterNamed(descriptionParamName);
actualChanges.put(descriptionParamName, newValue);
this.description = StringUtils.defaultIfEmpty(newValue, null);
}
- final String valueParamName = COLLATERAL_JSON_INPUT_PARAMS.VALUE.getValue();
+ final String valueParamName = CollateralJSONinputParams.VALUE.getValue();
if (command.isChangeInBigDecimalParameterNamed(valueParamName, this.value)) {
final BigDecimal newValue = command.bigDecimalValueOfParameterNamed(valueParamName);
actualChanges.put(valueParamName, newValue);
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeCreatedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeCreatedException.java
index eedde632f..178faf06e 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeCreatedException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeCreatedException.java
@@ -23,7 +23,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class CollateralCannotBeCreatedException extends AbstractPlatformDomainRuleException {
/*** enum of reasons of why Loan Charge cannot be waived **/
- public static enum LOAN_COLLATERAL_CANNOT_BE_CREATED_REASON {
+ public static enum LoanCollateralCannotBeCreatedReason {
LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE;
public String errorMessage() {
@@ -37,7 +37,7 @@ public class CollateralCannotBeCreatedException extends AbstractPlatformDomainRu
}
}
- public CollateralCannotBeCreatedException(final LOAN_COLLATERAL_CANNOT_BE_CREATED_REASON reason, final Long loanId) {
+ public CollateralCannotBeCreatedException(final LoanCollateralCannotBeCreatedReason reason, final Long loanId) {
super(reason.errorCode(), reason.errorMessage(), loanId);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeDeletedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeDeletedException.java
index a92074604..5b541a857 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeDeletedException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeDeletedException.java
@@ -23,7 +23,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class CollateralCannotBeDeletedException extends AbstractPlatformDomainRuleException {
/*** enum of reasons of why Loan Charge cannot be waived **/
- public static enum LOAN_COLLATERAL_CANNOT_BE_DELETED_REASON {
+ public static enum LoanCollateralCannotBeDeletedReason {
LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE;
public String errorMessage() {
@@ -37,7 +37,7 @@ public class CollateralCannotBeDeletedException extends AbstractPlatformDomainRu
}
}
- public CollateralCannotBeDeletedException(final LOAN_COLLATERAL_CANNOT_BE_DELETED_REASON reason, final Long loanId,
+ public CollateralCannotBeDeletedException(final LoanCollateralCannotBeDeletedReason reason, final Long loanId,
final Long loanCollateralId) {
super(reason.errorCode(), reason.errorMessage(), loanId, loanCollateralId);
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeUpdatedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeUpdatedException.java
index 5f48f700a..9ebf00e49 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeUpdatedException.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/exception/CollateralCannotBeUpdatedException.java
@@ -23,7 +23,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
public class CollateralCannotBeUpdatedException extends AbstractPlatformDomainRuleException {
/*** enum of reasons of why Loan Charge cannot be waived **/
- public static enum LOAN_COLLATERAL_CANNOT_BE_UPDATED_REASON {
+ public static enum LoanCollateralCannotBeUpdatedReason {
LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE;
public String errorMessage() {
@@ -37,7 +37,7 @@ public class CollateralCannotBeUpdatedException extends AbstractPlatformDomainRu
}
}
- public CollateralCannotBeUpdatedException(final LOAN_COLLATERAL_CANNOT_BE_UPDATED_REASON reason, final Long loanCollateralId) {
+ public CollateralCannotBeUpdatedException(final LoanCollateralCannotBeUpdatedReason reason, final Long loanCollateralId) {
super(reason.errorCode(), reason.errorMessage(), loanCollateralId);
}
}
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/serialization/CollateralCommandFromApiJsonDeserializer.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/serialization/CollateralCommandFromApiJsonDeserializer.java
index 3cebb57d5..c75a23a8c 100755
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/serialization/CollateralCommandFromApiJsonDeserializer.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/collateral/serialization/CollateralCommandFromApiJsonDeserializer.java
@@ -31,7 +31,7 @@ import org.apache.fineract.infrastructure.core.exception.InvalidJsonException;
import org.apache.fineract.infrastructure.core.serialization.AbstractFromApiJsonDeserializer;
import org.apache.fineract.infrastructure.core.serialization.FromApiJsonDeserializer;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
-import org.apache.fineract.portfolio.collateral.api.CollateralApiConstants.COLLATERAL_JSON_INPUT_PARAMS;
+import org.apache.fineract.portfolio.collateral.api.CollateralApiConstants.CollateralJSONinputParams;
import org.apache.fineract.portfolio.collateral.command.CollateralCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -55,7 +55,7 @@ public final class CollateralCommandFromApiJsonDeserializer extends AbstractFrom
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
final Type typeOfMap = new TypeToken