Merge branch 'FINERACT-470' into develop
This commit is contained in:
-3
@@ -30,7 +30,4 @@ public class AccrualAccountingConstants {
|
|||||||
|
|
||||||
public static final String PERIODIC_ACCRUAL_ACCOUNTING_RESOURCE_NAME = "periodicaccrual";
|
public static final String PERIODIC_ACCRUAL_ACCOUNTING_RESOURCE_NAME = "periodicaccrual";
|
||||||
public static final String PERIODIC_ACCRUAL_ACCOUNTING_EXECUTION_ERROR_CODE = "execution.failed";
|
public static final String PERIODIC_ACCRUAL_ACCOUNTING_EXECUTION_ERROR_CODE = "execution.failed";
|
||||||
|
|
||||||
public static final Set<String> LOAN_PERIODIC_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(accrueTillParamName,
|
|
||||||
localeParamName, dateFormatParamName));
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -18,14 +18,16 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.accounting.accrual.serialization;
|
package org.apache.fineract.accounting.accrual.serialization;
|
||||||
|
|
||||||
import static org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants.LOAN_PERIODIC_REQUEST_DATA_PARAMETERS;
|
|
||||||
import static org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants.PERIODIC_ACCRUAL_ACCOUNTING_RESOURCE_NAME;
|
import static org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants.PERIODIC_ACCRUAL_ACCOUNTING_RESOURCE_NAME;
|
||||||
import static org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants.accrueTillParamName;
|
import static org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants.accrueTillParamName;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants;
|
import org.apache.fineract.accounting.accrual.api.AccrualAccountingConstants;
|
||||||
@@ -52,6 +54,9 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
public final class AccrualAccountingDataValidator {
|
public final class AccrualAccountingDataValidator {
|
||||||
|
|
||||||
private final FromJsonHelper fromApiJsonHelper;
|
private final FromJsonHelper fromApiJsonHelper;
|
||||||
|
private static final Set<String> LOAN_PERIODIC_REQUEST_DATA_PARAMETERS = new HashSet<>(
|
||||||
|
Arrays.asList(accrueTillParamName, AccrualAccountingConstants.localeParamName,
|
||||||
|
AccrualAccountingConstants.dateFormatParamName));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public AccrualAccountingDataValidator(final FromJsonHelper fromApiJsonfromApiJsonHelper) {
|
public AccrualAccountingDataValidator(final FromJsonHelper fromApiJsonfromApiJsonHelper) {
|
||||||
|
|||||||
+13
-6
@@ -18,7 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.accountnumberformat.api;
|
package org.apache.fineract.infrastructure.accountnumberformat.api;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@@ -58,6 +61,10 @@ public class AccountNumberFormatsApiResource {
|
|||||||
private final ToApiJsonSerializer<AccountNumberFormatData> toApiJsonSerializer;
|
private final ToApiJsonSerializer<AccountNumberFormatData> toApiJsonSerializer;
|
||||||
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
||||||
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
||||||
|
private static final Set<String> ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
|
||||||
|
AccountNumberFormatConstants.idParamName, AccountNumberFormatConstants.accountTypeParamName,
|
||||||
|
AccountNumberFormatConstants.prefixTypeParamName, AccountNumberFormatConstants.accountTypeOptionsParamName,
|
||||||
|
AccountNumberFormatConstants.prefixTypeOptionsParamName));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public AccountNumberFormatsApiResource(final PlatformSecurityContext context,
|
public AccountNumberFormatsApiResource(final PlatformSecurityContext context,
|
||||||
@@ -84,8 +91,8 @@ public class AccountNumberFormatsApiResource {
|
|||||||
AccountNumberFormatData accountNumberFormatData = this.accountNumberFormatReadPlatformService.retrieveTemplate(accountType);
|
AccountNumberFormatData accountNumberFormatData = this.accountNumberFormatReadPlatformService.retrieveTemplate(accountType);
|
||||||
|
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
|
return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
|
||||||
AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
|
ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@@ -99,8 +106,8 @@ public class AccountNumberFormatsApiResource {
|
|||||||
.getAllAccountNumberFormats();
|
.getAllAccountNumberFormats();
|
||||||
|
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
|
return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
|
||||||
AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
|
ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@@ -121,8 +128,8 @@ public class AccountNumberFormatsApiResource {
|
|||||||
accountNumberFormatData.templateOnTop(templateData.getAccountTypeOptions(), templateData.getPrefixTypeOptions());
|
accountNumberFormatData.templateOnTop(templateData.getAccountTypeOptions(), templateData.getPrefixTypeOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
|
return this.toApiJsonSerializer.serialize(settings, accountNumberFormatData,
|
||||||
AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
|
ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
|||||||
+10
-4
@@ -20,6 +20,7 @@ package org.apache.fineract.infrastructure.accountnumberformat.data;
|
|||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -45,6 +46,11 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
public class AccountNumberFormatDataValidator {
|
public class AccountNumberFormatDataValidator {
|
||||||
|
|
||||||
private final FromJsonHelper fromApiJsonHelper;
|
private final FromJsonHelper fromApiJsonHelper;
|
||||||
|
private static final Set<String> ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
|
||||||
|
AccountNumberFormatConstants.accountTypeParamName, AccountNumberFormatConstants.prefixTypeParamName));
|
||||||
|
|
||||||
|
private static final Set<String> ACCOUNT_NUMBER_FORMAT_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(
|
||||||
|
Arrays.asList(AccountNumberFormatConstants.prefixTypeParamName));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public AccountNumberFormatDataValidator(final FromJsonHelper fromApiJsonHelper) {
|
public AccountNumberFormatDataValidator(final FromJsonHelper fromApiJsonHelper) {
|
||||||
@@ -55,8 +61,8 @@ public class AccountNumberFormatDataValidator {
|
|||||||
|
|
||||||
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
||||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
|
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
|
||||||
AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS);
|
ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS);
|
||||||
final JsonElement element = this.fromApiJsonHelper.parse(json);
|
final JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||||
|
|
||||||
@@ -137,8 +143,8 @@ public class AccountNumberFormatDataValidator {
|
|||||||
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
||||||
|
|
||||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
|
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
|
||||||
AccountNumberFormatConstants.ACCOUNT_NUMBER_FORMAT_UPDATE_REQUEST_DATA_PARAMETERS);
|
ACCOUNT_NUMBER_FORMAT_UPDATE_REQUEST_DATA_PARAMETERS);
|
||||||
final JsonElement element = this.fromApiJsonHelper.parse(json);
|
final JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||||
|
|
||||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||||
|
|||||||
-7
@@ -49,18 +49,11 @@ public class AccountNumberFormatConstants {
|
|||||||
public static final String accountTypeOptionsParamName = "accountTypeOptions";
|
public static final String accountTypeOptionsParamName = "accountTypeOptions";
|
||||||
public static final String prefixTypeOptionsParamName = "prefixTypeOptions";
|
public static final String prefixTypeOptionsParamName = "prefixTypeOptions";
|
||||||
|
|
||||||
public static final Set<String> ACCOUNT_NUMBER_FORMAT_CREATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
|
|
||||||
accountTypeParamName, prefixTypeParamName));
|
|
||||||
|
|
||||||
public static final Set<String> ACCOUNT_NUMBER_FORMAT_UPDATE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(prefixTypeParamName));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These parameters will match the class level parameters of
|
* These parameters will match the class level parameters of
|
||||||
* {@link AccountNumberFormatData}. Where possible, we try to get response
|
* {@link AccountNumberFormatData}. Where possible, we try to get response
|
||||||
* parameters to match those of request parameters.
|
* parameters to match those of request parameters.
|
||||||
*/
|
*/
|
||||||
public static final Set<String> ACCOUNT_NUMBER_FORMAT_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName,
|
|
||||||
accountTypeParamName, prefixTypeParamName, accountTypeOptionsParamName, prefixTypeOptionsParamName));
|
|
||||||
|
|
||||||
// Error messages codes
|
// Error messages codes
|
||||||
public static final String EXCEPTION_DUPLICATE_ACCOUNT_TYPE = "error.msg.account.number.format.duplicate.account.type";
|
public static final String EXCEPTION_DUPLICATE_ACCOUNT_TYPE = "error.msg.account.number.format.duplicate.account.type";
|
||||||
|
|||||||
Vendored
-1
@@ -26,6 +26,5 @@ public class CacheApiConstants {
|
|||||||
|
|
||||||
public static final String RESOURCE_NAME = "CACHE";
|
public static final String RESOURCE_NAME = "CACHE";
|
||||||
public static final String cacheTypeParameter = "cacheType";
|
public static final String cacheTypeParameter = "cacheType";
|
||||||
public static final Set<String> REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(cacheTypeParameter));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -20,8 +20,11 @@ package org.apache.fineract.infrastructure.cache.command;
|
|||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.fineract.commands.annotation.CommandType;
|
import org.apache.fineract.commands.annotation.CommandType;
|
||||||
@@ -47,6 +50,8 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
public class UpdateCacheCommandHandler implements NewCommandSourceHandler {
|
public class UpdateCacheCommandHandler implements NewCommandSourceHandler {
|
||||||
|
|
||||||
private final CacheWritePlatformService cacheService;
|
private final CacheWritePlatformService cacheService;
|
||||||
|
private static final Set<String> REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(CacheApiConstants
|
||||||
|
.cacheTypeParameter));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public UpdateCacheCommandHandler(final CacheWritePlatformService cacheService) {
|
public UpdateCacheCommandHandler(final CacheWritePlatformService cacheService) {
|
||||||
@@ -62,7 +67,7 @@ public class UpdateCacheCommandHandler implements NewCommandSourceHandler {
|
|||||||
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
||||||
|
|
||||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||||
command.checkForUnsupportedParameters(typeOfMap, json, CacheApiConstants.REQUEST_DATA_PARAMETERS);
|
command.checkForUnsupportedParameters(typeOfMap, json, REQUEST_DATA_PARAMETERS);
|
||||||
|
|
||||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
|
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
|
||||||
|
|||||||
+22
-22
@@ -151,6 +151,7 @@ public class DepositsApiConstants {
|
|||||||
public static final String runningBalanceParamName = "runningBalance";
|
public static final String runningBalanceParamName = "runningBalance";
|
||||||
public static final String reversedParamName = "reversed";
|
public static final String reversedParamName = "reversed";
|
||||||
public static final String dateParamName = "date";
|
public static final String dateParamName = "date";
|
||||||
|
public static final String accountIdParamName = "accountId";
|
||||||
|
|
||||||
// recurring deposits update parameters
|
// recurring deposits update parameters
|
||||||
public static final String effectiveDateParamName = "effectiveDate";
|
public static final String effectiveDateParamName = "effectiveDate";
|
||||||
@@ -199,9 +200,6 @@ public class DepositsApiConstants {
|
|||||||
// template
|
// template
|
||||||
public static final String chartTemplate = "chartTemplate";
|
public static final String chartTemplate = "chartTemplate";
|
||||||
|
|
||||||
// allowed column names for sorting the query result
|
|
||||||
public final static Set<String> supportedOrderByValues = new HashSet<>(Arrays.asList("id", "accountNumbr", "officeId", "officeName"));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deposit Product Parameters
|
* Deposit Product Parameters
|
||||||
*/
|
*/
|
||||||
@@ -244,7 +242,7 @@ public class DepositsApiConstants {
|
|||||||
adjustAdvanceTowardsFuturePaymentsParamName, recurringFrequencyTypeParamName, recurringFrequencyParamName,
|
adjustAdvanceTowardsFuturePaymentsParamName, recurringFrequencyTypeParamName, recurringFrequencyParamName,
|
||||||
isCalendarInheritedParamName));
|
isCalendarInheritedParamName));
|
||||||
|
|
||||||
public static final Set<String> DEPOSIT_PRECLOSURE_CALCULATION_REQUEST_DATA_PARAMETERS = new HashSet<>(
|
private static final Set<String> DEPOSIT_PRECLOSURE_CALCULATION_REQUEST_DATA_PARAMETERS = new HashSet<>(
|
||||||
Arrays.asList(preMatureCloseOnDateParamName));
|
Arrays.asList(preMatureCloseOnDateParamName));
|
||||||
|
|
||||||
public static final Set<String> FIXED_DEPOSIT_PRODUCT_REQUEST_DATA_PARAMETERS = fixedDepositProductRequestData();
|
public static final Set<String> FIXED_DEPOSIT_PRODUCT_REQUEST_DATA_PARAMETERS = fixedDepositProductRequestData();
|
||||||
@@ -293,13 +291,15 @@ public class DepositsApiConstants {
|
|||||||
* Depost Account parameters
|
* Depost Account parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static final Set<String> DEPOSIT_ACCOUNT_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
|
private static final Set<String> DEPOSIT_ACCOUNT_REQUEST_DATA_PARAMETERS = new HashSet<>(
|
||||||
dateFormatParamName, monthDayFormatParamName, accountNoParamName, externalIdParamName, clientIdParamName, groupIdParamName,
|
Arrays.asList(localeParamName, dateFormatParamName, monthDayFormatParamName, accountNoParamName,
|
||||||
productIdParamName, fieldOfficerIdParamName, submittedOnDateParamName, nominalAnnualInterestRateParamName,
|
externalIdParamName, clientIdParamName, groupIdParamName, productIdParamName,
|
||||||
interestCompoundingPeriodTypeParamName, interestPostingPeriodTypeParamName, interestCalculationTypeParamName,
|
fieldOfficerIdParamName, submittedOnDateParamName, nominalAnnualInterestRateParamName,
|
||||||
interestCalculationDaysInYearTypeParamName, lockinPeriodFrequencyParamName, lockinPeriodFrequencyTypeParamName,
|
interestCompoundingPeriodTypeParamName, interestPostingPeriodTypeParamName,
|
||||||
chargesParamName, chartsParamName, depositAmountParamName, depositPeriodParamName, depositPeriodFrequencyIdParamName,
|
interestCalculationTypeParamName, interestCalculationDaysInYearTypeParamName,
|
||||||
savingsAccounts, expectedFirstDepositOnDateParamName, SavingsApiConstants.withHoldTaxParamName));
|
lockinPeriodFrequencyParamName, lockinPeriodFrequencyTypeParamName, chargesParamName,
|
||||||
|
chartsParamName, depositAmountParamName, depositPeriodParamName, depositPeriodFrequencyIdParamName,
|
||||||
|
savingsAccounts, expectedFirstDepositOnDateParamName, SavingsApiConstants.withHoldTaxParamName));
|
||||||
|
|
||||||
public static final Set<String> FIXED_DEPOSIT_ACCOUNT_REQUEST_DATA_PARAMETERS = fixedDepositAccountRequestData();
|
public static final Set<String> FIXED_DEPOSIT_ACCOUNT_REQUEST_DATA_PARAMETERS = fixedDepositAccountRequestData();
|
||||||
public static final Set<String> FIXED_DEPOSIT_ACCOUNT_RESPONSE_DATA_PARAMETERS = fixedDepositAccountResponseData();
|
public static final Set<String> FIXED_DEPOSIT_ACCOUNT_RESPONSE_DATA_PARAMETERS = fixedDepositAccountResponseData();
|
||||||
@@ -345,27 +345,27 @@ public class DepositsApiConstants {
|
|||||||
return recurringDepositResponseData;
|
return recurringDepositResponseData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Set<String> FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName,
|
private static final Set<String> RECURRING_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
"accountId", accountNoParamName, "currency", "amount", dateParamName, paymentDetailDataParamName, runningBalanceParamName,
|
Arrays.asList(idParamName, "accountId", accountNoParamName, "currency", "amount", dateParamName,
|
||||||
reversedParamName));
|
paymentDetailDataParamName, runningBalanceParamName, reversedParamName));
|
||||||
|
|
||||||
public static final Set<String> RECURRING_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(idParamName,
|
private static final Set<String> SAVINGS_ACCOUNT_ACTIVATION_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList
|
||||||
"accountId", accountNoParamName, "currency", "amount", dateParamName, paymentDetailDataParamName, runningBalanceParamName,
|
(localeParamName,
|
||||||
reversedParamName));
|
|
||||||
|
|
||||||
public static final Set<String> SAVINGS_ACCOUNT_ACTIVATION_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(localeParamName,
|
|
||||||
dateFormatParamName, activatedOnDateParamName));
|
dateFormatParamName, activatedOnDateParamName));
|
||||||
|
|
||||||
public static final Set<String> SAVINGS_ACCOUNT_CHARGES_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(chargeIdParamName,
|
private static final Set<String> SAVINGS_ACCOUNT_CHARGES_RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList
|
||||||
|
(chargeIdParamName,
|
||||||
savingsAccountChargeIdParamName, chargeNameParamName, penaltyParamName, chargeTimeTypeParamName, dueAsOfDateParamName,
|
savingsAccountChargeIdParamName, chargeNameParamName, penaltyParamName, chargeTimeTypeParamName, dueAsOfDateParamName,
|
||||||
chargeCalculationTypeParamName, percentageParamName, amountPercentageAppliedToParamName, currencyParamName,
|
chargeCalculationTypeParamName, percentageParamName, amountPercentageAppliedToParamName, currencyParamName,
|
||||||
amountWaivedParamName, amountWrittenOffParamName, amountOutstandingParamName, amountOrPercentageParamName, amountParamName,
|
amountWaivedParamName, amountWrittenOffParamName, amountOutstandingParamName, amountOrPercentageParamName, amountParamName,
|
||||||
amountPaidParamName, chargeOptionsParamName));
|
amountPaidParamName, chargeOptionsParamName));
|
||||||
|
|
||||||
public static final Set<String> SAVINGS_ACCOUNT_CHARGES_ADD_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(chargeIdParamName,
|
private static final Set<String> SAVINGS_ACCOUNT_CHARGES_ADD_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList
|
||||||
|
(chargeIdParamName,
|
||||||
amountParamName, dueAsOfDateParamName, dateFormatParamName, localeParamName, feeOnMonthDayParamName, monthDayFormatParamName,
|
amountParamName, dueAsOfDateParamName, dateFormatParamName, localeParamName, feeOnMonthDayParamName, monthDayFormatParamName,
|
||||||
feeIntervalParamName));
|
feeIntervalParamName));
|
||||||
|
|
||||||
public static final Set<String> SAVINGS_ACCOUNT_CHARGES_PAY_CHARGE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(
|
private static final Set<String> SAVINGS_ACCOUNT_CHARGES_PAY_CHARGE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays
|
||||||
|
.asList(
|
||||||
amountParamName, dueAsOfDateParamName, dateFormatParamName, localeParamName));
|
amountParamName, dueAsOfDateParamName, dateFormatParamName, localeParamName));
|
||||||
}
|
}
|
||||||
+1
-4
@@ -26,7 +26,7 @@ import org.apache.fineract.accounting.common.AccountingConstants.SAVINGS_PRODUCT
|
|||||||
import org.apache.fineract.portfolio.savings.data.SavingsAccountData;
|
import org.apache.fineract.portfolio.savings.data.SavingsAccountData;
|
||||||
import org.apache.fineract.portfolio.savings.data.SavingsProductData;
|
import org.apache.fineract.portfolio.savings.data.SavingsProductData;
|
||||||
|
|
||||||
public class SavingsApiConstants {
|
public class SavingsApiConstants {
|
||||||
|
|
||||||
public static final String SAVINGS_PRODUCT_RESOURCE_NAME = "savingsproduct";
|
public static final String SAVINGS_PRODUCT_RESOURCE_NAME = "savingsproduct";
|
||||||
public static final String SAVINGS_ACCOUNT_RESOURCE_NAME = "savingsaccount";
|
public static final String SAVINGS_ACCOUNT_RESOURCE_NAME = "savingsaccount";
|
||||||
@@ -186,7 +186,4 @@ public class SavingsApiConstants {
|
|||||||
public static final String datatables = "datatables";
|
public static final String datatables = "datatables";
|
||||||
|
|
||||||
public static final String ERROR_MSG_SAVINGS_ACCOUNT_NOT_ACTIVE = "not.in.active.state";
|
public static final String ERROR_MSG_SAVINGS_ACCOUNT_NOT_ACTIVE = "not.in.active.state";
|
||||||
|
|
||||||
public static final Set<String> SAVINGS_ACCOUNT_HOLD_AMOUNT_REQUEST_DATA_PARAMETERS = new HashSet<>(
|
|
||||||
Arrays.asList(transactionDateParamName, dateFormatParamName, localeParamName, transactionAmountParamName));
|
|
||||||
}
|
}
|
||||||
+12
-3
@@ -18,7 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.savings.api;
|
package org.apache.fineract.portfolio.savings.api;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -62,7 +65,13 @@ public class FixedDepositAccountTransactionsApiResource {
|
|||||||
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
||||||
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
||||||
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
||||||
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
private static final Set<String> FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
|
Arrays.asList(DepositsApiConstants.idParamName, DepositsApiConstants.accountIdParamName,
|
||||||
|
DepositsApiConstants.accountNoParamName, DepositsApiConstants.currencyParamName,
|
||||||
|
DepositsApiConstants.amountParamName, DepositsApiConstants.dateParamName,
|
||||||
|
DepositsApiConstants.paymentDetailDataParamName, DepositsApiConstants.runningBalanceParamName,
|
||||||
|
DepositsApiConstants.reversedParamName));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public FixedDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
|
public FixedDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
|
||||||
@@ -120,8 +129,8 @@ public class FixedDepositAccountTransactionsApiResource {
|
|||||||
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.toApiJsonSerializer.serialize(settings, transactionData,
|
return this.toApiJsonSerializer.serialize(settings, transactionData,
|
||||||
DepositsApiConstants.FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS);
|
FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
|||||||
+11
-2
@@ -18,7 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.portfolio.savings.api;
|
package org.apache.fineract.portfolio.savings.api;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
@@ -65,6 +68,12 @@ public class RecurringDepositAccountTransactionsApiResource {
|
|||||||
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
||||||
private final DepositAccountReadPlatformService depositAccountReadPlatformService;
|
private final DepositAccountReadPlatformService depositAccountReadPlatformService;
|
||||||
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
private static final Set<String> FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||||
|
Arrays.asList(DepositsApiConstants.idParamName, DepositsApiConstants.accountIdParamName,
|
||||||
|
DepositsApiConstants.accountNoParamName, DepositsApiConstants.currencyParamName,
|
||||||
|
DepositsApiConstants.amountParamName, DepositsApiConstants.dateParamName,
|
||||||
|
DepositsApiConstants.paymentDetailDataParamName, DepositsApiConstants.runningBalanceParamName,
|
||||||
|
DepositsApiConstants.reversedParamName));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public RecurringDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
|
public RecurringDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
|
||||||
@@ -141,8 +150,8 @@ public class RecurringDepositAccountTransactionsApiResource {
|
|||||||
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.toApiJsonSerializer.serialize(settings, transactionData,
|
return this.toApiJsonSerializer.serialize(settings, transactionData,
|
||||||
DepositsApiConstants.FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS);
|
FIXED_DEPOSIT_TRANSACTION_RESPONSE_DATA_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
|||||||
+3
-1
@@ -29,7 +29,6 @@ import static org.apache.fineract.portfolio.savings.SavingsApiConstants.transact
|
|||||||
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.transactionAmountParamName;
|
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.transactionAmountParamName;
|
||||||
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.transactionDateParamName;
|
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.transactionDateParamName;
|
||||||
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.withdrawBalanceParamName;
|
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.withdrawBalanceParamName;
|
||||||
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.SAVINGS_ACCOUNT_HOLD_AMOUNT_REQUEST_DATA_PARAMETERS;
|
|
||||||
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.SAVINGS_ACCOUNT_RESOURCE_NAME;
|
import static org.apache.fineract.portfolio.savings.SavingsApiConstants.SAVINGS_ACCOUNT_RESOURCE_NAME;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
@@ -67,6 +66,9 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
public class SavingsAccountTransactionDataValidator {
|
public class SavingsAccountTransactionDataValidator {
|
||||||
|
|
||||||
private final FromJsonHelper fromApiJsonHelper;
|
private final FromJsonHelper fromApiJsonHelper;
|
||||||
|
private static final Set<String> SAVINGS_ACCOUNT_HOLD_AMOUNT_REQUEST_DATA_PARAMETERS = new HashSet<>(
|
||||||
|
Arrays.asList(transactionDateParamName, SavingsApiConstants.dateFormatParamName,
|
||||||
|
SavingsApiConstants.localeParamName, transactionAmountParamName));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public SavingsAccountTransactionDataValidator(final FromJsonHelper fromApiJsonHelper) {
|
public SavingsAccountTransactionDataValidator(final FromJsonHelper fromApiJsonHelper) {
|
||||||
|
|||||||
+7
-1
@@ -22,8 +22,11 @@ import java.math.BigDecimal;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||||
import org.apache.fineract.infrastructure.core.data.PaginationParameters;
|
import org.apache.fineract.infrastructure.core.data.PaginationParameters;
|
||||||
@@ -122,6 +125,9 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
private final CalendarReadPlatformService calendarReadPlatformService;
|
private final CalendarReadPlatformService calendarReadPlatformService;
|
||||||
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
||||||
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
// allowed column names for sorting the query result
|
||||||
|
private final static Set<String> supportedOrderByValues = new HashSet<>(Arrays.asList("id", "accountNumbr",
|
||||||
|
"officeId", "officeName"));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DepositAccountReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
|
public DepositAccountReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
|
||||||
@@ -178,7 +184,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
public Page<DepositAccountData> retrieveAllPaged(final DepositAccountType depositAccountType,
|
public Page<DepositAccountData> retrieveAllPaged(final DepositAccountType depositAccountType,
|
||||||
final PaginationParameters paginationParameters) {
|
final PaginationParameters paginationParameters) {
|
||||||
|
|
||||||
this.paginationParametersDataValidator.validateParameterValues(paginationParameters, DepositsApiConstants.supportedOrderByValues,
|
this.paginationParametersDataValidator.validateParameterValues(paginationParameters, supportedOrderByValues,
|
||||||
depositAccountType.resourceName());
|
depositAccountType.resourceName());
|
||||||
|
|
||||||
final DepositAccountMapper depositAccountMapper = this.getDepositAccountMapper(depositAccountType);
|
final DepositAccountMapper depositAccountMapper = this.getDepositAccountMapper(depositAccountType);
|
||||||
|
|||||||
Reference in New Issue
Block a user