Package com.skava.accounts.util
Class ContractsUtil
java.lang.Object
com.skava.accounts.util.ContractsUtil
- All Implemented Interfaces:
Serializable
The utility class AccountsUtil consists of helper and validator methods for contract entity.
- Author:
- Infosys Equinox
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
getDocumentsForLoadedContracts
(DocumentRepository documentRepository, org.springframework.data.domain.Page<ContractsEntity> contractsEntity, List<ContractsDO> contractssDO) getDocumentsForLoadedContractsstatic boolean
isContractExpired
(ContractsEntity contractEntity) static AccountRequestInternal
validateAccountAttribute
(AccountRequestInternal request, AccountCommonServices accountCommonService) Validate AccountProperties attributestatic AttributeEntity
validateAndGetAttributeEntity
(long collectionId, String locale, AccountCommonServices accountCommonService, String attributeId, List<String> attrList) Validate attribute entity is present for attributeId and return itstatic Object
validateAttributeValue
(String value, String validationData, AttributeFieldType dataType, AccountCommonServices accountCommonService, String locale) Validate Attribute Valuestatic ContractRequestInternal
validateContractAttribute
(ContractRequestInternal request, AccountCommonServices accountCommonService) Validate ContractProperties attributestatic void
validateRequiredAccountAttributes
(AccountRequestInternal request, AccountCommonServices accountCommonService) Validate Required Account Properties are available in the requeststatic void
validateRequiredContractAttributes
(ContractRequestInternal request, AccountCommonServices accountCommonService) Validate Required Contract Properties are available in the request
-
Constructor Details
-
ContractsUtil
public ContractsUtil()
-
-
Method Details
-
getDocumentsForLoadedContracts
public static void getDocumentsForLoadedContracts(DocumentRepository documentRepository, org.springframework.data.domain.Page<ContractsEntity> contractsEntity, List<ContractsDO> contractssDO) getDocumentsForLoadedContracts- Parameters:
documentRepository
- The documentRepositorycontractsEntity
- the contractsEntitycontractssDO
- the list of contractsDO of typeContractsDO
-
isContractExpired
- Parameters:
contractEntity
- the ContractsEntity- Returns:
- true if contract expired
-
validateContractAttribute
public static ContractRequestInternal validateContractAttribute(ContractRequestInternal request, AccountCommonServices accountCommonService) Validate ContractProperties attribute- Parameters:
request
- the ContractRequestInternalaccountCommonService
- the accountCommonService- Returns:
- It returns ContractRequestInternal.
-
validateAccountAttribute
public static AccountRequestInternal validateAccountAttribute(AccountRequestInternal request, AccountCommonServices accountCommonService) Validate AccountProperties attribute- Parameters:
request
- the AccountRequestInternalaccountCommonService
- the accountCommonService- Returns:
- It returns AccountRequestInternal.
-
validateRequiredAccountAttributes
public static void validateRequiredAccountAttributes(AccountRequestInternal request, AccountCommonServices accountCommonService) Validate Required Account Properties are available in the request- Parameters:
request
- the AccountRequestInternalaccountCommonService
- the accountCommonService
-
validateRequiredContractAttributes
public static void validateRequiredContractAttributes(ContractRequestInternal request, AccountCommonServices accountCommonService) Validate Required Contract Properties are available in the request- Parameters:
request
- the ContractRequestInternalaccountCommonService
- the accountCommonService
-
validateAndGetAttributeEntity
public static AttributeEntity validateAndGetAttributeEntity(long collectionId, String locale, AccountCommonServices accountCommonService, String attributeId, List<String> attrList) Validate attribute entity is present for attributeId and return it- Parameters:
collectionId
- the collectionId from requestlocale
- the locale to get the corresponding response message from resource bundleaccountCommonService
- the accountCommonServiceattributeId
- attributeId from requestattrList
- Valid attributeList added- Returns:
- AttributeEntity
-
validateAttributeValue
public static Object validateAttributeValue(String value, String validationData, AttributeFieldType dataType, AccountCommonServices accountCommonService, String locale) Validate Attribute Value- Parameters:
value
- the value to validatevalidationData
- the validationDatadataType
- the AttributeFieldTypeaccountCommonService
- the accountCommonServicelocale
- API Response and error messages will be responded in the locale mentioned in this parameter.- Returns:
- It returns Object
-