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)
|
||||
* Рекомендуется использовать не эту валидацию, а DictionaryPresentRule
|
||||
* @param <R> Класс проверяемого объекта
|
||||
* @param <E> Enum
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -81,12 +81,6 @@ public class ClearingMemberCategoryValidationConfig {
|
|||
return CompanyErrors.CompanyDisabled;
|
||||
return null;
|
||||
}),
|
||||
EnumPresentRule.instance("clearingMemberCategory",
|
||||
ClearingMemberCategoryUpdateRequest::getClearingMemberCategory,
|
||||
ClearingCategory.values(),
|
||||
false,
|
||||
CompanyErrors.WrongFieldValue,
|
||||
CompanyErrors.RequiredFieldEmpty),
|
||||
DictionaryPresentRule.instance("clearingMemberCategory",
|
||||
ClearingMemberCategoryUpdateRequest::getClearingMemberCategory,
|
||||
IMDGDistributedNames.Map_ClearingCategoryDictionary,
|
||||
|
|
|
|||
|
|
@ -49,11 +49,6 @@ public class CompanyValidationConfig {
|
|||
WorkflowStatusDictionary.class,
|
||||
CompanyErrors.RequiredFieldEmpty,
|
||||
CompanyErrors.WrongFieldValue),
|
||||
EnumPresentRule.instance("companySymbol",
|
||||
CompanyNewRequest::getCompanySymbol,
|
||||
CompanySymbol.values(),
|
||||
CompanyErrors.WrongFieldValue,
|
||||
CompanyErrors.RequiredFieldEmpty),
|
||||
DictionaryPresentRule.instance("companySymbol",
|
||||
CompanyNewRequest::getCompanySymbol,
|
||||
IMDGDistributedNames.Map_CompanySymbolDictionary,
|
||||
|
|
|
|||
|
|
@ -44,11 +44,6 @@ public class ContactValidationConfig {
|
|||
Company.class,
|
||||
CompanyErrors.RequiredFieldEmpty,
|
||||
CompanyErrors.CompanyNotFound),
|
||||
EnumPresentRule.instance("contactType",
|
||||
ContactNewRequest::getContactType,
|
||||
ContactTypes.values(),
|
||||
CompanyErrors.WrongFieldValue,
|
||||
CompanyErrors.RequiredFieldEmpty),
|
||||
DictionaryPresentRule.instance("contactType",
|
||||
ContactNewRequest::getContactType,
|
||||
IMDGDistributedNames.Map_ContactTypeDictionary,
|
||||
|
|
@ -86,12 +81,6 @@ public class ContactValidationConfig {
|
|||
}
|
||||
return null;
|
||||
}),
|
||||
EnumPresentRule.instance("contactType",
|
||||
ContactUpdateRequest::getContactType,
|
||||
ContactTypes.values(),
|
||||
false,
|
||||
CompanyErrors.WrongFieldValue,
|
||||
CompanyErrors.RequiredFieldEmpty),
|
||||
DictionaryPresentRule.instance("contactType",
|
||||
ContactUpdateRequest::getContactType,
|
||||
IMDGDistributedNames.Map_ContactTypeDictionary,
|
||||
|
|
|
|||
|
|
@ -45,11 +45,6 @@ public class ProfileDocumentValidationConfig {
|
|||
CompanyErrors.RequiredFieldEmpty,
|
||||
CompanyErrors.CompanyNotFound,
|
||||
company -> WorkflowStatus.Active.getKey().equals(company.getWorkflowStatus()) ? null : CompanyErrors.CompanyDisabled),
|
||||
EnumPresentRule.instance("documentType",
|
||||
ProfileDocumentNewRequest::getDocumentType,
|
||||
DocumentTypes.values(),
|
||||
CompanyErrors.WrongFieldValue,
|
||||
CompanyErrors.RequiredFieldEmpty),
|
||||
DictionaryPresentRule.instance("documentType",
|
||||
ProfileDocumentNewRequest::getDocumentType,
|
||||
IMDGDistributedNames.Map_DocumentTypeDictionary,
|
||||
|
|
@ -109,12 +104,6 @@ public class ProfileDocumentValidationConfig {
|
|||
CompanyErrors.CompanyNotFound,
|
||||
false,
|
||||
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",
|
||||
ProfileDocumentUpdateRequest::getDocumentType,
|
||||
IMDGDistributedNames.Map_DocumentTypeDictionary,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue