make staff Id optional for client creation/updation

This commit is contained in:
Vishwas Babu AJ
2013-06-19 11:55:08 +05:30
parent 10ad444668
commit 3c9184bf1c
@@ -63,7 +63,7 @@ public final class ClientDataValidator {
if (this.fromApiJsonHelper.parameterExists(ClientApiConstants.staffIdParamName, element)) {
final Long staffId = this.fromApiJsonHelper.extractLongNamed(ClientApiConstants.staffIdParamName, element);
baseDataValidator.reset().parameter(ClientApiConstants.staffIdParamName).value(staffId).notNull().longGreaterThanZero();
baseDataValidator.reset().parameter(ClientApiConstants.staffIdParamName).value(staffId).ignoreIfNull().longGreaterThanZero();
}
if (this.fromApiJsonHelper.parameterExists(ClientApiConstants.accountNoParamName, element)) {
@@ -289,7 +289,7 @@ public final class ClientDataValidator {
if (this.fromApiJsonHelper.parameterExists(ClientApiConstants.staffIdParamName, element)) {
final Long staffId = this.fromApiJsonHelper.extractLongNamed(ClientApiConstants.staffIdParamName, element);
baseDataValidator.reset().parameter(ClientApiConstants.staffIdParamName).value(staffId).notNull().longGreaterThanZero();
baseDataValidator.reset().parameter(ClientApiConstants.staffIdParamName).value(staffId).ignoreIfNull().longGreaterThanZero();
}
if (!atLeastOneParameterPassedForUpdate) {