FINERACT-2081: Fetch configurations by name
This commit is contained in:
+27
-2
@@ -59,7 +59,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Global Configuration", description = "Global configuration related to set of supported enable/disable configurations:\n" + "\n"
|
||||
+ "maker-checker - defaults to false - if true turns on maker-checker functionality\n"
|
||||
+ "reschedule-future-repayments - defaults to false - if true reschedules repayemnts which falls on a non-working day to configured repayment rescheduling rule\n"
|
||||
+ "allow-transactions-on-non_workingday - defaults to false - if true allows transactions on non-working days\n"
|
||||
+ "allow-transactions-on-non-workingday - defaults to false - if true allows transactions on non-working days\n"
|
||||
+ "reschedule-repayments-on-holidays - defaults to false - if true reschedules repayemnts which falls on a non-working day to defined reschedule date\n"
|
||||
+ "allow-transactions-on-holiday - defaults to false - if true allows transactions on holidays\n"
|
||||
+ "savings-interest-posting-current-period-end - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.\n"
|
||||
@@ -123,7 +123,7 @@ public class GlobalConfigurationApiResource {
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Retrieve Global Configuration", description = "Returns a global enable/disable configuration.\n" + "\n"
|
||||
+ "Example Requests:\n" + "\n" + "configurations/name/Enable-Address")
|
||||
+ "Example Requests:\n" + "\n" + "configurations/name/enable-address")
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GlobalConfigurationPropertyData.class))) })
|
||||
public String retrieveOneByName(@PathParam("name") @Parameter(description = "name") final String name, @Context final UriInfo uriInfo) {
|
||||
@@ -156,4 +156,29 @@ public class GlobalConfigurationApiResource {
|
||||
|
||||
return this.toApiJsonSerializer.serialize(result);
|
||||
}
|
||||
|
||||
@PUT
|
||||
@Path("/name/{configName}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Update Global Configuration by name", description = "Updates an enable/disable global configuration item by name")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsRequest.class)))
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsResponse.class))) })
|
||||
public String updateConfigurationByName(@PathParam("configName") @Parameter(description = "configName") final String configName,
|
||||
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||
|
||||
// TODO: Would be better to support string based identifier in Commands and resolve the entity by name in the
|
||||
// service
|
||||
final GlobalConfigurationPropertyData configurationData = this.readPlatformService.retrieveGlobalConfiguration(configName);
|
||||
|
||||
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||
.updateGlobalConfiguration(configurationData.getId()) //
|
||||
.withJson(apiRequestBodyAsJson) //
|
||||
.build();
|
||||
|
||||
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||
|
||||
return this.toApiJsonSerializer.serialize(result);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-12
@@ -20,14 +20,12 @@ package org.apache.fineract.infrastructure.configuration.api;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
import jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.PUT;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.Context;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import jakarta.ws.rs.core.UriInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
||||
@@ -37,7 +35,6 @@ import org.apache.fineract.organisation.monetary.domain.MoneyHelper;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@Profile(FineractProfiles.TEST)
|
||||
@Component
|
||||
@@ -61,24 +58,22 @@ public class InternalConfigurationsApiResource implements InitializingBean {
|
||||
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("{configId}/value/{configValue}")
|
||||
@PUT
|
||||
@Path("name/{configName}/value/{configValue}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@SuppressFBWarnings("SLF4J_SIGN_ONLY_FORMAT")
|
||||
public Response updateGlobalConfiguration(@Context final UriInfo uriInfo, @PathParam("configId") Long configId,
|
||||
@PathParam("configValue") Long configValue, @RequestBody(required = false) String error) {
|
||||
public Response updateGlobalConfiguration(@PathParam("configName") String configName, @PathParam("configValue") Long configValue) {
|
||||
log.warn("------------------------------------------------------------");
|
||||
log.warn(" ");
|
||||
log.warn("Update trap-door config: {}", configId);
|
||||
log.warn("Update trap-door config: {}", configName);
|
||||
log.warn(" ");
|
||||
log.warn("------------------------------------------------------------");
|
||||
|
||||
final GlobalConfigurationProperty config = repository.findOneWithNotFoundDetection(configId);
|
||||
log.warn("Config to be updated {} original value {}", config.getName(), config.getValue());
|
||||
final GlobalConfigurationProperty config = repository.findOneByNameWithNotFoundDetection(configName);
|
||||
config.setValue(configValue);
|
||||
repository.save(config);
|
||||
log.warn("Config to be updated to {}", config.getValue());
|
||||
log.warn("Config {} updated to {}", config.getName(), config.getValue());
|
||||
repository.removeFromCache(config.getName());
|
||||
MoneyHelper.fetchRoundingModeFromGlobalConfig();
|
||||
|
||||
|
||||
+95
-101
@@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.cache.domain.CacheType;
|
||||
import org.apache.fineract.infrastructure.cache.domain.PlatformCache;
|
||||
import org.apache.fineract.infrastructure.cache.domain.PlatformCacheRepository;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
||||
import org.apache.fineract.useradministration.domain.Permission;
|
||||
import org.apache.fineract.useradministration.domain.PermissionRepository;
|
||||
@@ -38,23 +39,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@RequiredArgsConstructor
|
||||
public class ConfigurationDomainServiceJpa implements ConfigurationDomainService {
|
||||
|
||||
public static final String ENABLE_BUSINESS_DATE = "enable_business_date";
|
||||
public static final String ENABLE_AUTOMATIC_COB_DATE_ADJUSTMENT = "enable_automatic_cob_date_adjustment";
|
||||
public static final String EXTERNAL_EVENTS_PURGE_DAYS = "purge-external-events-older-than-days";
|
||||
|
||||
public static final String PROCESSED_COMMANDS_PURGE_DAYS = "purge-processed-commands-older-than-days";
|
||||
private static final String DAYS_BEFORE_REPAYMENT_IS_DUE = "days-before-repayment-is-due";
|
||||
private static final String DAYS_AFTER_REPAYMENT_IS_OVERDUE = "days-after-repayment-is-overdue";
|
||||
private static final String ENABLE_EXTERNAL_ID_AUTO_GENERATION = "enable-auto-generated-external-id";
|
||||
private static final String ENABLE_ADDRESS = "Enable-Address";
|
||||
private static final String ENABLE_COB_BULK_EVENT = "enable-cob-bulk-event";
|
||||
private static final String EXTERNAL_EVENT_BATCH_SIZE = "external-event-batch-size";
|
||||
|
||||
private static final String REPORT_EXPORT_S3_FOLDER_NAME = "report-export-s3-folder-name";
|
||||
|
||||
public static final String CHARGE_ACCRUAL_DATE_CRITERIA = "charge-accrual-date";
|
||||
public static final String NEXT_PAYMENT_DUE_DATE = "next-payment-due-date";
|
||||
|
||||
private final PermissionRepository permissionRepository;
|
||||
private final GlobalConfigurationRepositoryWrapper globalConfigurationRepository;
|
||||
private final PlatformCacheRepository cacheTypeRepository;
|
||||
@@ -64,8 +48,7 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
if (StringUtils.isBlank(taskPermissionCode)) {
|
||||
throw new PermissionNotFoundException(taskPermissionCode);
|
||||
}
|
||||
final String makerCheckerConfigurationProperty = "maker-checker";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(makerCheckerConfigurationProperty);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(GlobalConfigurationConstants.MAKER_CHECKER);
|
||||
if (property.isEnabled()) {
|
||||
final Permission thisTask = this.permissionRepository.findOneByCode(taskPermissionCode);
|
||||
if (thisTask == null) {
|
||||
@@ -79,18 +62,18 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public boolean isSameMakerCheckerEnabled() {
|
||||
return getGlobalConfigurationPropertyData("enable-same-maker-checker").isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ENABLE_SAME_MAKER_CHECKER).isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAmazonS3Enabled() {
|
||||
return getGlobalConfigurationPropertyData("amazon-S3").isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.AMAZON_S3).isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRescheduleFutureRepaymentsEnabled() {
|
||||
final String rescheduleRepaymentsConfigurationProperty = "reschedule-future-repayments";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(rescheduleRepaymentsConfigurationProperty);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.RESCHEDULE_FUTURE_REPAYMENTS);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@@ -101,29 +84,29 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
*/
|
||||
@Override
|
||||
public boolean isRescheduleRepaymentsOnHolidaysEnabled() {
|
||||
final String holidaysConfigurationProperty = "reschedule-repayments-on-holidays";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(holidaysConfigurationProperty);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.RESCHEDULE_REPAYMENTS_ON_HOLIDAYS);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowTransactionsOnHolidayEnabled() {
|
||||
final String allowTransactionsOnHolidayProperty = "allow-transactions-on-holiday";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(allowTransactionsOnHolidayProperty);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ALLOW_TRANSACTIONS_ON_HOLIDAY);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowTransactionsOnNonWorkingDayEnabled() {
|
||||
final String propertyName = "allow-transactions-on-non_workingday";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ALLOW_TRANSACTIONS_ON_NON_WORKING_DAY);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConstraintApproachEnabledForDatatables() {
|
||||
final String propertyName = "constraint_approach_for_datatables";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.CONSTRAINT_APPROACH_FOR_DATATABLES);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@@ -143,50 +126,50 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public Long retrievePenaltyWaitPeriod() {
|
||||
final String propertyName = "penalty-wait-period";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.PENALTY_WAIT_PERIOD);
|
||||
return property.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrieveGraceOnPenaltyPostingPeriod() {
|
||||
final String propertyName = "grace-on-penalty-posting";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.GRACE_ON_PENALTY_POSTING);
|
||||
return property.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPasswordForcedResetEnable() {
|
||||
final String propertyName = "force-password-reset-days";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.FORCE_PASSWORD_RESET_DAYS);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrievePasswordLiveTime() {
|
||||
final String propertyName = "force-password-reset-days";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.FORCE_PASSWORD_RESET_DAYS);
|
||||
return property.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrieveOpeningBalancesContraAccount() {
|
||||
final String propertyName = "office-opening-balances-contra-account";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.OFFICE_OPENING_BALANCES_CONTRA_ACCOUNT);
|
||||
return property.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSavingsInterestPostingAtCurrentPeriodEnd() {
|
||||
final String propertyName = "savings-interest-posting-current-period-end";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.SAVINGS_INTEREST_POSTING_CURRENT_PERIOD_END);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer retrieveFinancialYearBeginningMonth() {
|
||||
final String propertyName = "financial-year-beginning-month";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.FINANCIAL_YEAR_BEGINNING_MONTH);
|
||||
if (property.isEnabled()) {
|
||||
return property.getValue().intValue();
|
||||
}
|
||||
@@ -195,8 +178,8 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public Integer retrieveMinAllowedClientsInGroup() {
|
||||
final String propertyName = "min-clients-in-group";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.MIN_CLIENTS_IN_GROUP);
|
||||
if (property.isEnabled()) {
|
||||
return property.getValue().intValue();
|
||||
}
|
||||
@@ -205,8 +188,8 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public Integer retrieveMaxAllowedClientsInGroup() {
|
||||
final String propertyName = "max-clients-in-group";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.MAX_CLIENTS_IN_GROUP);
|
||||
if (property.isEnabled()) {
|
||||
return property.getValue().intValue();
|
||||
}
|
||||
@@ -215,16 +198,15 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public boolean isMeetingMandatoryForJLGLoans() {
|
||||
final String propertyName = "meetings-mandatory-for-jlg-loans";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.MEETINGS_MANDATORY_FOR_JLG_LOANS);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRoundingMode() {
|
||||
final String propertyName = "rounding-mode";
|
||||
int defaultValue = 6; // 6 Stands for HALF-EVEN
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ROUNDING_MODE);
|
||||
if (property.isEnabled()) {
|
||||
int value = property.getValue().intValue();
|
||||
if (value < 0 || value > 6) {
|
||||
@@ -237,78 +219,80 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public boolean isBackdatePenaltiesEnabled() {
|
||||
final String propertyName = "backdate-penalties-enabled";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.BACKDATE_PENALTIES_ENABLED);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOrganisationstartDateEnabled() {
|
||||
final String propertyName = "organisation-start-date";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ORGANISATION_START_DATE);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalDate retrieveOrganisationStartDate() {
|
||||
final String propertyName = "organisation-start-date";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ORGANISATION_START_DATE);
|
||||
return property.getDateValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPaymentTypeApplicableForDisbursementCharge() {
|
||||
final String propertyName = "paymenttype-applicable-for-disbursement-charges";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.PAYMENT_TYPE_APPLICABLE_FOR_DISBURSEMENT_CHARGES);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSkippingMeetingOnFirstDayOfMonthEnabled() {
|
||||
return getGlobalConfigurationPropertyData("skip-repayment-on-first-day-of-month").isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.SKIP_REPAYMENT_ON_FIRST_DAY_OF_MONTH).isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFirstRepaymentDateAfterRescheduleAllowedOnHoliday() {
|
||||
return getGlobalConfigurationPropertyData("loan-reschedule-is-first-payday-allowed-on-holiday").isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.LOAN_RESCHEDULE_IS_FIRST_PAYDAY_ALLOWED_ON_HOLIDAY)
|
||||
.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterestToBeRecoveredFirstWhenGreaterThanEMI() {
|
||||
return getGlobalConfigurationPropertyData("is-interest-to-be-recovered-first-when-greater-than-emi").isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI)
|
||||
.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPrincipalCompoundingDisabledForOverdueLoans() {
|
||||
return getGlobalConfigurationPropertyData("is-principal-compounding-disabled-for-overdue-loans").isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.IS_PRINCIPAL_COMPOUNDING_DISABLED_FOR_OVERDUE_LOANS)
|
||||
.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retreivePeriodInNumberOfDaysForSkipMeetingDate() {
|
||||
final String propertyName = "skip-repayment-on-first-day-of-month";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.SKIP_REPAYMENT_ON_FIRST_DAY_OF_MONTH);
|
||||
return property.getValue();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterestChargedFromDateSameAsDisbursementDate() {
|
||||
final String propertyName = "interest-charged-from-date-same-as-disbursal-date";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.INTEREST_CHARGED_FROM_DATE_SAME_AS_DISBURSAL_DATE);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled() {
|
||||
final String propertyName = "change-emi-if-repaymentdate-same-as-disbursementdate";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.CHANGE_EMI_IF_REPAYMENT_DATE_SAME_AS_DISBURSEMENT_DATE);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDailyTPTLimitEnabled() {
|
||||
final String propertyName = "daily-tpt-limit";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(GlobalConfigurationConstants.DAILY_TPT_LIMIT);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@@ -364,23 +348,23 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public boolean retrievePivotDateConfig() {
|
||||
final String propertyName = "allow-backdated-transaction-before-interest-posting";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING);
|
||||
return !property.isEnabled();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRelaxingDaysConfigForPivotDateEnabled() {
|
||||
final String propertyName = "allow-backdated-transaction-before-interest-posting-date-for-days";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING_DATE_FOR_DAYS);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrieveRelaxingDaysConfigForPivotDate() {
|
||||
final String propertyName = "allow-backdated-transaction-before-interest-posting-date-for-days";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING_DATE_FOR_DAYS);
|
||||
if (property.getValue() == null) {
|
||||
return 0L;
|
||||
}
|
||||
@@ -394,14 +378,14 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public boolean isSubRatesEnabled() {
|
||||
return getGlobalConfigurationPropertyData("sub-rates").isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.SUB_RATES).isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccountMappingForPaymentType() {
|
||||
final String propertyName = "account-mapping-for-payment-type";
|
||||
String defaultValue = "Asset"; // 1 Stands for Account mapped from asset only
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ACCOUNT_MAPPING_FOR_PAYMENT_TYPE);
|
||||
if (property.isEnabled()) {
|
||||
String value = property.getStringValue();
|
||||
if (StringUtils.isBlank(value)) {
|
||||
@@ -414,9 +398,9 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public String getAccountMappingForCharge() {
|
||||
final String propertyName = "account-mapping-for-charge";
|
||||
String defaultValue = "Income"; // 1 Stands for Account mapped from income only
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ACCOUNT_MAPPING_FOR_CHARGE);
|
||||
if (property.isEnabled()) {
|
||||
String value = property.getStringValue();
|
||||
if (StringUtils.isBlank(value)) {
|
||||
@@ -429,88 +413,97 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
|
||||
@Override
|
||||
public boolean isNextDayFixedDepositInterestTransferEnabledForPeriodEnd() {
|
||||
final String propertyName = "fixed-deposit-transfer-interest-next-day-for-period-end-posting";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.FIXED_DEPOSIT_TRANSFER_INTEREST_NEXT_DAY_FOR_PERIOD_END_POSTING);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBusinessDateEnabled() {
|
||||
return getGlobalConfigurationPropertyData(ENABLE_BUSINESS_DATE).isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE).isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCOBDateAdjustmentEnabled() {
|
||||
return getGlobalConfigurationPropertyData(ENABLE_AUTOMATIC_COB_DATE_ADJUSTMENT).isEnabled();
|
||||
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ENABLE_AUTOMATIC_COB_DATE_ADJUSTMENT).isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReversalTransactionAllowed() {
|
||||
final String propertyName = "enable-post-reversal-txns-for-reverse-transactions";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ENABLE_POST_REVERSAL_TXNS_FOR_REVERSE_TRANSACTIONS);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrieveExternalEventsPurgeDaysCriteria() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(EXTERNAL_EVENTS_PURGE_DAYS);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.PURGE_EXTERNAL_EVENTS_OLDER_THAN_DAYS);
|
||||
return property.getValue();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrieveProcessedCommandsPurgeDaysCriteria() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(PROCESSED_COMMANDS_PURGE_DAYS);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.PURGE_PROCESSED_COMMANDS_OLDER_THAN_DAYS);
|
||||
return property.getValue();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrieveRepaymentDueDays() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(DAYS_BEFORE_REPAYMENT_IS_DUE);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.DAYS_BEFORE_REPAYMENT_IS_DUE);
|
||||
return property.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrieveRepaymentOverdueDays() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(DAYS_AFTER_REPAYMENT_IS_OVERDUE);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.DAYS_AFTER_REPAYMENT_IS_OVERDUE);
|
||||
return property.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExternalIdAutoGenerationEnabled() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(ENABLE_EXTERNAL_ID_AUTO_GENERATION);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAddressEnabled() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(ENABLE_ADDRESS);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ENABLE_ADDRESS);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCOBBulkEventEnabled() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(ENABLE_COB_BULK_EVENT);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.ENABLE_COB_BULK_EVENT);
|
||||
return property.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long retrieveExternalEventBatchSize() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(EXTERNAL_EVENT_BATCH_SIZE);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.EXTERNAL_EVENT_BATCH_SIZE);
|
||||
return property.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String retrieveReportExportS3FolderName() {
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(REPORT_EXPORT_S3_FOLDER_NAME);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.REPORT_EXPORT_S3_FOLDER_NAME);
|
||||
return property.getStringValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccrualDateConfigForCharge() {
|
||||
String defaultValue = "due-date";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(CHARGE_ACCRUAL_DATE_CRITERIA);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE);
|
||||
String value = property.getStringValue();
|
||||
if (StringUtils.isBlank(value)) {
|
||||
return defaultValue;
|
||||
@@ -521,7 +514,8 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
||||
@Override
|
||||
public String getNextPaymentDateConfigForLoan() {
|
||||
String defaultValue = "earliest-unpaid-date";
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(NEXT_PAYMENT_DUE_DATE);
|
||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||
GlobalConfigurationConstants.NEXT_PAYMENT_DUE_DATE);
|
||||
String value = property.getStringValue();
|
||||
if (StringUtils.isBlank(value)) {
|
||||
return defaultValue;
|
||||
|
||||
+2
-1
@@ -28,6 +28,7 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
||||
import org.apache.fineract.infrastructure.configuration.exception.GlobalConfigurationPropertyCannotBeModfied;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||
@@ -99,7 +100,7 @@ public class GlobalConfigurationProperty extends AbstractPersistableCustom<Long>
|
||||
this.stringValue = newStringValue;
|
||||
}
|
||||
|
||||
final String passwordPropertyName = "force-password-reset-days";
|
||||
final String passwordPropertyName = GlobalConfigurationConstants.FORCE_PASSWORD_RESET_DAYS;
|
||||
if (this.name.equalsIgnoreCase(passwordPropertyName)) {
|
||||
if ((this.enabled == true && command.hasParameter(valueParamName) && (this.value == 0))
|
||||
|| (this.enabled == true && !command.hasParameter(valueParamName) && (previousValue == 0))) {
|
||||
|
||||
-2
@@ -24,8 +24,6 @@ public final class FineractEntityAccessConstants {
|
||||
|
||||
}
|
||||
|
||||
public static final String GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS = "office-specific-products-enabled";
|
||||
public static final String GLOBAL_CONFIG_FOR_RESTRICT_PRODUCTS_TO_USER_OFFICE = "restrict-products-to-user-office";
|
||||
public static final String ENTITY_ACCESS_CODENAME = "Entity to Entity Access Types";
|
||||
|
||||
/***
|
||||
|
||||
+4
-4
@@ -21,9 +21,9 @@ package org.apache.fineract.infrastructure.entityaccess.service;
|
||||
import java.time.LocalDate;
|
||||
import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
||||
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationRepositoryWrapper;
|
||||
import org.apache.fineract.infrastructure.entityaccess.FineractEntityAccessConstants;
|
||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
|
||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelation;
|
||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepositoryWrapper;
|
||||
@@ -77,13 +77,13 @@ public class FineractEntityAccessUtil {
|
||||
// i.e. this product or charge is specific for this office.
|
||||
|
||||
final GlobalConfigurationProperty property = this.globalConfigurationRepository
|
||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS);
|
||||
.findOneByNameWithNotFoundDetection(GlobalConfigurationConstants.OFFICE_SPECIFIC_PRODUCTS_ENABLED);
|
||||
if (property.isEnabled()) {
|
||||
// If this property is enabled, then Fineract need to restrict
|
||||
// access to this loan product to only the office of the current
|
||||
// user
|
||||
final GlobalConfigurationProperty restrictToUserOfficeProperty = this.globalConfigurationRepository
|
||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_RESTRICT_PRODUCTS_TO_USER_OFFICE);
|
||||
.findOneByNameWithNotFoundDetection(GlobalConfigurationConstants.RESTRICT_PRODUCTS_TO_USER_OFFICE);
|
||||
|
||||
if (restrictToUserOfficeProperty.isEnabled()) {
|
||||
final Long officeId = thisUser.getOffice().getId();
|
||||
@@ -105,7 +105,7 @@ public class FineractEntityAccessUtil {
|
||||
String inClause = "";
|
||||
|
||||
final GlobalConfigurationProperty property = this.globalConfigurationRepository
|
||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS);
|
||||
.findOneByNameWithNotFoundDetection(GlobalConfigurationConstants.OFFICE_SPECIFIC_PRODUCTS_ENABLED);
|
||||
|
||||
if (property.isEnabled()) {
|
||||
// Get 'SQL In Clause' for fetching only products/charges that are
|
||||
|
||||
+1
-1
@@ -26,9 +26,9 @@ import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||
import org.apache.fineract.infrastructure.businessdate.service.BusinessDateReadPlatformService;
|
||||
import org.apache.fineract.infrastructure.core.domain.ActionContext;
|
||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||
import org.apache.fineract.infrastructure.core.service.JdbcTemplateFactory;
|
||||
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
|
||||
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
||||
import org.apache.fineract.infrastructure.event.external.service.JdbcTemplateFactory;
|
||||
import org.apache.fineract.infrastructure.jobs.domain.JobExecutionRepository;
|
||||
import org.apache.fineract.useradministration.domain.AppUser;
|
||||
import org.apache.fineract.useradministration.domain.AppUserRepositoryWrapper;
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Working days", description = "The days of the week that are workdays.\n" + "\n"
|
||||
+ "Rescheduling of repayments when it falls on a non-working is turned on /off by enable/disable reschedule-future-repayments parameter in Global configurations\n"
|
||||
+ "\n"
|
||||
+ "Allow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non_workingday parameter in Global configurations.")
|
||||
+ "Allow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non-workingday parameter in Global configurations.")
|
||||
@RequiredArgsConstructor
|
||||
public class WorkingDaysApiResource {
|
||||
|
||||
|
||||
+3
-2
@@ -27,6 +27,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.accountnumberformat.domain.AccountNumberFormat;
|
||||
import org.apache.fineract.infrastructure.accountnumberformat.domain.AccountNumberFormatEnumerations.AccountNumberPrefixType;
|
||||
import org.apache.fineract.infrastructure.codes.domain.CodeValue;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
||||
import org.apache.fineract.infrastructure.configuration.service.ConfigurationReadPlatformService;
|
||||
import org.apache.fineract.portfolio.client.domain.Client;
|
||||
@@ -105,7 +106,7 @@ public class AccountNumberGenerator {
|
||||
|
||||
// find if the custom length is defined
|
||||
final GlobalConfigurationPropertyData customLength = this.configurationReadPlatformService
|
||||
.retrieveGlobalConfiguration("custom-account-number-length");
|
||||
.retrieveGlobalConfiguration(GlobalConfigurationConstants.CUSTOM_ACCOUNT_NUMBER_LENGTH);
|
||||
|
||||
if (customLength.isEnabled()) {
|
||||
// if it is enabled, and has the value, get it from the repository.
|
||||
@@ -115,7 +116,7 @@ public class AccountNumberGenerator {
|
||||
}
|
||||
|
||||
final GlobalConfigurationPropertyData randomAccountNumber = this.configurationReadPlatformService
|
||||
.retrieveGlobalConfiguration("random-account-number");
|
||||
.retrieveGlobalConfiguration(GlobalConfigurationConstants.RANDOM_ACCOUNT_NUMBER);
|
||||
|
||||
if (randomAccountNumber.isEnabled()) {
|
||||
accountNumber = randomNumberGenerator(accountMaxLength, propertyMap);
|
||||
|
||||
+2
-1
@@ -31,6 +31,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.infrastructure.configuration.service.ConfigurationReadPlatformService;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
||||
@@ -224,7 +225,7 @@ public final class ClientDataValidator {
|
||||
baseDataValidator.reset().parameter("isStaff").value(isStaffFlag).notNull();
|
||||
}
|
||||
|
||||
if (this.configurationReadPlatformService.retrieveGlobalConfiguration("Enable-Address").isEnabled()) {
|
||||
if (this.configurationReadPlatformService.retrieveGlobalConfiguration(GlobalConfigurationConstants.ENABLE_ADDRESS).isEnabled()) {
|
||||
final JsonArray address = this.fromApiJsonHelper.extractJsonArrayNamed(ClientApiConstants.address, element);
|
||||
baseDataValidator.reset().parameter(ClientApiConstants.address).value(address).notNull().jsonArrayNotEmpty();
|
||||
}
|
||||
|
||||
+2
-2
@@ -37,6 +37,7 @@ import java.util.function.Consumer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationRepositoryWrapper;
|
||||
@@ -55,7 +56,6 @@ import org.apache.fineract.infrastructure.core.service.ExternalIdFactory;
|
||||
import org.apache.fineract.infrastructure.dataqueries.data.EntityTables;
|
||||
import org.apache.fineract.infrastructure.dataqueries.data.StatusEnum;
|
||||
import org.apache.fineract.infrastructure.dataqueries.service.EntityDatatableChecksWritePlatformService;
|
||||
import org.apache.fineract.infrastructure.entityaccess.FineractEntityAccessConstants;
|
||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
|
||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelation;
|
||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepository;
|
||||
@@ -1760,7 +1760,7 @@ public final class LoanApplicationValidator {
|
||||
|
||||
private void officeSpecificLoanProductValidation(final Long productId, final Long officeId) {
|
||||
final GlobalConfigurationProperty restrictToUserOfficeProperty = this.globalConfigurationRepository
|
||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS);
|
||||
.findOneByNameWithNotFoundDetection(GlobalConfigurationConstants.OFFICE_SPECIFIC_PRODUCTS_ENABLED);
|
||||
if (restrictToUserOfficeProperty.isEnabled()) {
|
||||
FineractEntityRelation fineractEntityRelation = fineractEntityRelationRepository
|
||||
.findOneByCodeName(FineractEntityAccessType.OFFICE_ACCESS_TO_LOAN_PRODUCTS.getStr());
|
||||
|
||||
@@ -167,4 +167,5 @@
|
||||
<include file="parts/0145_job_short_name.xml" relativeToChangelogFile="true" />
|
||||
<include file="parts/0147_enable_payment_hub_integration.xml" relativeToChangelogFile="true" />
|
||||
<include file="parts/0148_transaction_summary_with_asset_owner_report_performance_improvement.xml" relativeToChangelogFile="true" />
|
||||
<include file="parts/0149_update_global_configuration_names.xml" relativeToChangelogFile="true" />
|
||||
</databaseChangeLog>
|
||||
|
||||
+1
-1
@@ -28,8 +28,8 @@
|
||||
</sql>
|
||||
</changeSet>
|
||||
<changeSet author="fineract" id="2">
|
||||
<validCheckSum>9:64863870bbd61795b1a8ced20a6dd7a3</validCheckSum>
|
||||
<insert tableName="c_configuration">
|
||||
<column name="id" valueNumeric="60"/>
|
||||
<column name="name" value="enable-payment-hub-integration"/>
|
||||
<column name="value" valueNumeric="0"/>
|
||||
<column name="date_value"/>
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
-->
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">
|
||||
<changeSet author="fineract" id="1">
|
||||
<sql>
|
||||
UPDATE c_configuration SET name = REPLACE(REPLACE(LOWER(name), '_', '-'), ' ', '-');
|
||||
</sql>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
+1
@@ -31,6 +31,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||
import org.apache.fineract.infrastructure.core.service.JdbcTemplateFactory;
|
||||
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
||||
import org.apache.fineract.infrastructure.event.external.exception.ExternalEventConfigurationNotFoundException;
|
||||
import org.apache.fineract.infrastructure.event.external.service.validation.ExternalEventSourceService;
|
||||
|
||||
Reference in New Issue
Block a user