company-service убрал проверки по enum, оставил по dictionary
This commit is contained in:
parent
8beb210e32
commit
bca9879cc9
5 changed files with 1 additions and 33 deletions
|
|
@ -11,6 +11,7 @@ import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Проверка поля со значением из множества (enum)
|
* Проверка поля со значением из множества (enum)
|
||||||
|
* Рекомендуется использовать не эту валидацию, а DictionaryPresentRule
|
||||||
* @param <R> Класс проверяемого объекта
|
* @param <R> Класс проверяемого объекта
|
||||||
* @param <E> Enum
|
* @param <E> Enum
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,6 @@ public class ClearingMemberCategoryValidationConfig {
|
||||||
return CompanyErrors.CompanyDisabled;
|
return CompanyErrors.CompanyDisabled;
|
||||||
return null;
|
return null;
|
||||||
}),
|
}),
|
||||||
EnumPresentRule.instance("clearingMemberCategory",
|
|
||||||
ClearingMemberCategoryUpdateRequest::getClearingMemberCategory,
|
|
||||||
ClearingCategory.values(),
|
|
||||||
false,
|
|
||||||
CompanyErrors.WrongFieldValue,
|
|
||||||
CompanyErrors.RequiredFieldEmpty),
|
|
||||||
DictionaryPresentRule.instance("clearingMemberCategory",
|
DictionaryPresentRule.instance("clearingMemberCategory",
|
||||||
ClearingMemberCategoryUpdateRequest::getClearingMemberCategory,
|
ClearingMemberCategoryUpdateRequest::getClearingMemberCategory,
|
||||||
IMDGDistributedNames.Map_ClearingCategoryDictionary,
|
IMDGDistributedNames.Map_ClearingCategoryDictionary,
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,6 @@ public class CompanyValidationConfig {
|
||||||
WorkflowStatusDictionary.class,
|
WorkflowStatusDictionary.class,
|
||||||
CompanyErrors.RequiredFieldEmpty,
|
CompanyErrors.RequiredFieldEmpty,
|
||||||
CompanyErrors.WrongFieldValue),
|
CompanyErrors.WrongFieldValue),
|
||||||
EnumPresentRule.instance("companySymbol",
|
|
||||||
CompanyNewRequest::getCompanySymbol,
|
|
||||||
CompanySymbol.values(),
|
|
||||||
CompanyErrors.WrongFieldValue,
|
|
||||||
CompanyErrors.RequiredFieldEmpty),
|
|
||||||
DictionaryPresentRule.instance("companySymbol",
|
DictionaryPresentRule.instance("companySymbol",
|
||||||
CompanyNewRequest::getCompanySymbol,
|
CompanyNewRequest::getCompanySymbol,
|
||||||
IMDGDistributedNames.Map_CompanySymbolDictionary,
|
IMDGDistributedNames.Map_CompanySymbolDictionary,
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,6 @@ public class ContactValidationConfig {
|
||||||
Company.class,
|
Company.class,
|
||||||
CompanyErrors.RequiredFieldEmpty,
|
CompanyErrors.RequiredFieldEmpty,
|
||||||
CompanyErrors.CompanyNotFound),
|
CompanyErrors.CompanyNotFound),
|
||||||
EnumPresentRule.instance("contactType",
|
|
||||||
ContactNewRequest::getContactType,
|
|
||||||
ContactTypes.values(),
|
|
||||||
CompanyErrors.WrongFieldValue,
|
|
||||||
CompanyErrors.RequiredFieldEmpty),
|
|
||||||
DictionaryPresentRule.instance("contactType",
|
DictionaryPresentRule.instance("contactType",
|
||||||
ContactNewRequest::getContactType,
|
ContactNewRequest::getContactType,
|
||||||
IMDGDistributedNames.Map_ContactTypeDictionary,
|
IMDGDistributedNames.Map_ContactTypeDictionary,
|
||||||
|
|
@ -86,12 +81,6 @@ public class ContactValidationConfig {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}),
|
}),
|
||||||
EnumPresentRule.instance("contactType",
|
|
||||||
ContactUpdateRequest::getContactType,
|
|
||||||
ContactTypes.values(),
|
|
||||||
false,
|
|
||||||
CompanyErrors.WrongFieldValue,
|
|
||||||
CompanyErrors.RequiredFieldEmpty),
|
|
||||||
DictionaryPresentRule.instance("contactType",
|
DictionaryPresentRule.instance("contactType",
|
||||||
ContactUpdateRequest::getContactType,
|
ContactUpdateRequest::getContactType,
|
||||||
IMDGDistributedNames.Map_ContactTypeDictionary,
|
IMDGDistributedNames.Map_ContactTypeDictionary,
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,6 @@ public class ProfileDocumentValidationConfig {
|
||||||
CompanyErrors.RequiredFieldEmpty,
|
CompanyErrors.RequiredFieldEmpty,
|
||||||
CompanyErrors.CompanyNotFound,
|
CompanyErrors.CompanyNotFound,
|
||||||
company -> WorkflowStatus.Active.getKey().equals(company.getWorkflowStatus()) ? null : CompanyErrors.CompanyDisabled),
|
company -> WorkflowStatus.Active.getKey().equals(company.getWorkflowStatus()) ? null : CompanyErrors.CompanyDisabled),
|
||||||
EnumPresentRule.instance("documentType",
|
|
||||||
ProfileDocumentNewRequest::getDocumentType,
|
|
||||||
DocumentTypes.values(),
|
|
||||||
CompanyErrors.WrongFieldValue,
|
|
||||||
CompanyErrors.RequiredFieldEmpty),
|
|
||||||
DictionaryPresentRule.instance("documentType",
|
DictionaryPresentRule.instance("documentType",
|
||||||
ProfileDocumentNewRequest::getDocumentType,
|
ProfileDocumentNewRequest::getDocumentType,
|
||||||
IMDGDistributedNames.Map_DocumentTypeDictionary,
|
IMDGDistributedNames.Map_DocumentTypeDictionary,
|
||||||
|
|
@ -109,12 +104,6 @@ public class ProfileDocumentValidationConfig {
|
||||||
CompanyErrors.CompanyNotFound,
|
CompanyErrors.CompanyNotFound,
|
||||||
false,
|
false,
|
||||||
company -> WorkflowStatus.Active.getKey().equals(company.getWorkflowStatus()) ? null : CompanyErrors.CompanyDisabled),
|
company -> WorkflowStatus.Active.getKey().equals(company.getWorkflowStatus()) ? null : CompanyErrors.CompanyDisabled),
|
||||||
EnumPresentRule.instance("documentType",
|
|
||||||
ProfileDocumentUpdateRequest::getDocumentType,
|
|
||||||
DocumentTypes.values(),
|
|
||||||
false,
|
|
||||||
CompanyErrors.WrongFieldValue,
|
|
||||||
CompanyErrors.RequiredFieldEmpty),
|
|
||||||
DictionaryPresentRule.instance("documentType",
|
DictionaryPresentRule.instance("documentType",
|
||||||
ProfileDocumentUpdateRequest::getDocumentType,
|
ProfileDocumentUpdateRequest::getDocumentType,
|
||||||
IMDGDistributedNames.Map_DocumentTypeDictionary,
|
IMDGDistributedNames.Map_DocumentTypeDictionary,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue