diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm
index 2cb8fde3d..31ca702c4 100644
--- a/api-docs/apiLive.htm
+++ b/api-docs/apiLive.htm
@@ -2033,11 +2033,11 @@
-
Password validation policy
-
An API capability to support management of application password validation policy for user administration.
-
There is no Mifos X functionality for creating or validation policy. The validation policies come pre-installed.
-
Validation policies are not updated, except in the case of enabling them
+
Password preferences
+
This API enables management of password policy for user administration.
+
There is no Mifos X functionality for creating a validation policy. The validation policies come pre-installed.
+
Validation policies may be updated
-
@@ -30883,11 +30883,11 @@ Request Body:
Example Requests:
-
passwordValidationPolicy
+
passwordpreferences
- GET https://DomainName/api/v1/passwordValidationPolicy
+ GET https://DomainName/api/v1/passwordpreferences
[
@@ -30906,21 +30906,22 @@ Request Body:
-
-
Enable Password validation policy
+ Update password preferences
- PUT https://DomainName/api/v1/passwordValidationPolicy/{validationPolicyId}
+ PUT https://DomainName/api/v1/passwordpreferences/
- PUT passwordValidationPolicy
+ PUT passwordpreferences
Content-Type: application/json
Request Body:
{
-
+ "validationPolicyId" : 1,
+ "locale" : "en"
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/commands/domain/CommandWrapper.java b/mifosng-provider/src/main/java/org/mifosplatform/commands/domain/CommandWrapper.java
index c0297b667..f90e0bb9c 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/commands/domain/CommandWrapper.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/commands/domain/CommandWrapper.java
@@ -8,6 +8,7 @@ package org.mifosplatform.commands.domain;
import org.mifosplatform.infrastructure.accountnumberformat.service.AccountNumberFormatConstants;
import org.mifosplatform.portfolio.loanaccount.rescheduleloan.RescheduleLoansApiConstants;
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
+import org.mifosplatform.useradministration.api.PasswordPreferencesApiConstants;
public class CommandWrapper {
@@ -200,7 +201,8 @@ public class CommandWrapper {
public boolean isUpdate() {
// permissions resource has special update which involves no resource.
return isPermissionResource() && isUpdateOperation() || isCurrencyResource() && isUpdateOperation() || isCacheResource()
- && isUpdateOperation() || isWorkingDaysResource() && isUpdateOperation() || isUpdateOperation() && this.entityId != null;
+ && isUpdateOperation() || isWorkingDaysResource() && isUpdateOperation() || isPasswordPreferencesResource()
+ && isUpdateOperation() || isUpdateOperation() && this.entityId != null;
}
public boolean isUpdateOperation() {
@@ -1022,8 +1024,8 @@ public class CommandWrapper {
return this.entityName.equalsIgnoreCase("WORKINGDAYS");
}
- public boolean isPasswordValidationPolicyResource() {
- return this.entityName.equalsIgnoreCase("PASSWORD_VALIDATION_POLICY");
+ public boolean isPasswordPreferencesResource() {
+ return this.entityName.equalsIgnoreCase(PasswordPreferencesApiConstants.ENTITY_NAME);
}
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/commands/service/CommandWrapperBuilder.java b/mifosng-provider/src/main/java/org/mifosplatform/commands/service/CommandWrapperBuilder.java
index e6e46d72d..360d18154 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/commands/service/CommandWrapperBuilder.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/commands/service/CommandWrapperBuilder.java
@@ -8,6 +8,7 @@ package org.mifosplatform.commands.service;
import org.mifosplatform.commands.domain.CommandWrapper;
import org.mifosplatform.infrastructure.accountnumberformat.service.AccountNumberFormatConstants;
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
+import org.mifosplatform.useradministration.api.PasswordPreferencesApiConstants;
public class CommandWrapperBuilder {
@@ -2361,11 +2362,10 @@ public class CommandWrapperBuilder {
return this;
}
- public CommandWrapperBuilder activatePasswordValidationPolicy(final Long validationPolicyId) {
+ public CommandWrapperBuilder updatePasswordPreferences() {
this.actionName = "UPDATE";
- this.entityName = "PASSWORD_VALIDATION_POLICY";
- this.entityId = validationPolicyId;
- this.href = "/passwordValidationPolicy/" + validationPolicyId;
+ this.entityName = PasswordPreferencesApiConstants.ENTITY_NAME;
+ this.href = "/" + PasswordPreferencesApiConstants.RESOURCE_NAME;
return this;
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java b/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java
index d90498f68..4524b6f1f 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/commands/service/SynchronousCommandProcessingService.java
@@ -929,9 +929,9 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
} else {
throw new UnsupportedCommandException(wrapper.commandName());
}
- } else if (wrapper.isPasswordValidationPolicyResource()) {
+ } else if (wrapper.isPasswordPreferencesResource()) {
if (wrapper.isUpdate()) {
- handler = this.applicationContext.getBean("updatePasswordValidationPolicyCommandHandler", NewCommandSourceHandler.class);
+ handler = this.applicationContext.getBean("updatePasswordPreferencesCommandHandler", NewCommandSourceHandler.class);
} else {
throw new UnsupportedCommandException(wrapper.commandName());
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/workingdays/data/WorkingDayValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/workingdays/data/WorkingDayValidator.java
index 1f0d2868b..2d40abb1f 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/workingdays/data/WorkingDayValidator.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/workingdays/data/WorkingDayValidator.java
@@ -5,8 +5,10 @@
*/
package org.mifosplatform.organisation.workingdays.data;
-import com.google.gson.JsonElement;
-import com.google.gson.reflect.TypeToken;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
@@ -18,10 +20,8 @@ import org.mifosplatform.organisation.workingdays.api.WorkingDaysApiConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import com.google.gson.JsonElement;
+import com.google.gson.reflect.TypeToken;
@Component
public class WorkingDayValidator {
@@ -33,8 +33,7 @@ public class WorkingDayValidator {
this.fromApiJsonHelper = fromApiJsonHelper;
}
-
- public void validateForUpdate(final String json){
+ public void validateForUpdate(final String json) {
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
final Type typeOfMap = new TypeToken