Class ContractsUtil

java.lang.Object
com.skava.accounts.util.ContractsUtil
All Implemented Interfaces:
Serializable

public class ContractsUtil extends Object implements Serializable
The utility class AccountsUtil consists of helper and validator methods for contract entity.
Author:
Infosys Equinox
See Also:
  • 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 documentRepository
      contractsEntity - the contractsEntity
      contractssDO - the list of contractsDO of type ContractsDO
    • isContractExpired

      public static boolean isContractExpired(ContractsEntity contractEntity)
      Parameters:
      contractEntity - the ContractsEntity
      Returns:
      true if contract expired
    • validateContractAttribute

      public static ContractRequestInternal validateContractAttribute(ContractRequestInternal request, AccountCommonServices accountCommonService)
      Validate ContractProperties attribute
      Parameters:
      request - the ContractRequestInternal
      accountCommonService - the accountCommonService
      Returns:
      It returns ContractRequestInternal.
    • validateAccountAttribute

      public static AccountRequestInternal validateAccountAttribute(AccountRequestInternal request, AccountCommonServices accountCommonService)
      Validate AccountProperties attribute
      Parameters:
      request - the AccountRequestInternal
      accountCommonService - 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 AccountRequestInternal
      accountCommonService - the accountCommonService
    • validateRequiredContractAttributes

      public static void validateRequiredContractAttributes(ContractRequestInternal request, AccountCommonServices accountCommonService)
      Validate Required Contract Properties are available in the request
      Parameters:
      request - the ContractRequestInternal
      accountCommonService - 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 request
      locale - the locale to get the corresponding response message from resource bundle
      accountCommonService - the accountCommonService
      attributeId - attributeId from request
      attrList - 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 validate
      validationData - the validationData
      dataType - the AttributeFieldType
      accountCommonService - the accountCommonService
      locale - API Response and error messages will be responded in the locale mentioned in this parameter.
      Returns:
      It returns Object