Class Pricelist

Object
DomainObject
PersistedObject
PartitionedObject
AbstractCalculable
CalculableObject
MatrixableCalculableObject
Pricelist
All Implemented Interfaces:
APIModifiable, Approvable, Calculable, HasCalculableObjectItems, JobNameProvider, JobSettingsProvider, NamedChangeTracker, Persistable, TreeStructuredObject, UserGroupRestrictedObject, WithLastUpdateByName

@Entity public class Pricelist extends MatrixableCalculableObject implements TreeStructuredObject, UserGroupRestrictedObject, Approvable, APIModifiable, NamedChangeTracker, JobSettingsProvider
  • Constructor Details

    • Pricelist

      public Pricelist()
    • Pricelist

      public Pricelist(Pricelist basePl)
  • Method Details

    • getConfiguration

      public String getConfiguration()
    • setConfiguration

      public void setConfiguration(String configuration)
    • getUniqueName

      public String getUniqueName()
      Specified by:
      getUniqueName in interface Approvable
    • getPricelistConfiguration

      public PricelistConfiguration getPricelistConfiguration()
    • setPricelistConfiguration

      public void setPricelistConfiguration(PricelistConfiguration config)
    • getProcessingMode

      public Pricelist.ProcessingMode getProcessingMode()
    • setProcessingMode

      public void setProcessingMode(Pricelist.ProcessingMode processingMode)
    • getErrorMode

      public Pricelist.PricelistErrorModeType getErrorMode()
    • setErrorMode

      public void setErrorMode(Pricelist.PricelistErrorModeType errorMode)
    • getPricelistType

      public MatrixableCalculableObject.ListType getPricelistType()
    • setPricelistType

      public void setPricelistType(MatrixableCalculableObject.ListType pricelistType)
    • getListType

      public MatrixableCalculableObject.ListType getListType()
      Overrides:
      getListType in class MatrixableCalculableObject
    • isMatrix

      public boolean isMatrix()
      Overrides:
      isMatrix in class MatrixableCalculableObject
    • getNodeId

      public Long getNodeId()
      Specified by:
      getNodeId in interface TreeStructuredObject
    • setNodeId

      public void setNodeId(Number nodeId)
      Specified by:
      setNodeId in interface TreeStructuredObject
    • getPreviousPricelistId

      public Long getPreviousPricelistId()
    • setPreviousPricelistId

      public void setPreviousPricelistId(Long previousPricelistId)
    • getExpiryDate

      public LocalDateTime getExpiryDate()
    • setExpiryDate

      public void setExpiryDate(LocalDateTime expiryDate)
    • getApprovalState

      public ApprovalState getApprovalState()
    • setApprovalState

      public void setApprovalState(ApprovalState approvalState)
    • getApprovalDate

      public LocalDateTime getApprovalDate()
    • approvalDate

      public String approvalDate()
    • setApprovalDate

      public void setApprovalDate(LocalDateTime approvalDate)
    • getExportDate

      public LocalDateTime getExportDate()
    • exportDate

      public String exportDate()
    • setExportDate

      public void setExportDate(LocalDateTime exportDate)
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • getUserGroupEdit

      public String getUserGroupEdit()
      Specified by:
      getUserGroupEdit in interface UserGroupRestrictedObject
    • setUserGroupEdit

      public void setUserGroupEdit(String userGroup)
      Specified by:
      setUserGroupEdit in interface UserGroupRestrictedObject
    • getUserGroupViewDetails

      public String getUserGroupViewDetails()
      Specified by:
      getUserGroupViewDetails in interface UserGroupRestrictedObject
    • setUserGroupViewDetails

      public void setUserGroupViewDetails(String userGroup)
      Specified by:
      setUserGroupViewDetails in interface UserGroupRestrictedObject
    • getPricelistPricegridTypeUniqueName

      public String getPricelistPricegridTypeUniqueName()
    • setPricelistPricegridTypeUniqueName

      public void setPricelistPricegridTypeUniqueName(String pricelistPricegridTypeUniqueName)
    • getPricelistPricegridType

      public PricelistPricegridType getPricelistPricegridType()
    • setHeaderType

      public void setHeaderType(PricelistPricegridType pricelistPricegridType)
    • getIntegrationStatus

      public String getIntegrationStatus()
    • setIntegrationStatus

      public void setIntegrationStatus(String integrationStatus)
    • getUpdatedBy

      public Long getUpdatedBy()
    • setUpdateDate

      public void setUpdateDate(LocalDateTime updateDate)
    • setUpdatedBy

      public void setUpdatedBy(Long updateBy)
    • getUpdateDate

      public LocalDateTime getUpdateDate()
    • getPricelistId

      public Long getPricelistId()
    • setPricelistId

      public void setPricelistId(Long id)
    • getJstId

      public Long getJstId()
    • setJstId

      public void setJstId(Long jstId)
    • validate

      public boolean validate(ValidationVisitor validationVisitor, PersistedObjectService objService)
      Description copied from class: net.pricefx.domain.PersistedObject
      Override to implement per-object validation rules
      Specified by:
      validate in interface Persistable
      Overrides:
      validate in class AbstractCalculable
      Parameters:
      validationVisitor - visitor object that receives validation error details
      objService - PersistedObjectService instance. May be null, so be cautios when requiring it
    • canEdit

      public boolean canEdit(User user, ValidationVisitor validationVisitor, PersistedObjectService objService, Map<String,Object> fieldsToEdit)
      Description copied from class: net.pricefx.domain.PersistedObject
      Override this method to do editability checks based on request details and object data (or related object data) and new data from request In case of a false return value a validation error should be added.
      Overrides:
      canEdit in class PersistedObject
      Parameters:
      user - that requests edit access
      validationVisitor - receives any "not allowed messages"
      objService - needed for cross object editability checks. Implemented as parameter to optimize performance (vs. new object creation)
      fieldsToEdit - fields and their values that are about to be modified. To implement more fine grained editability checks (like e.g. allow tree repositioning while the object is otherwise locked)
      Returns:
      true if edit is allowed, false otherwise
    • canDelete

      public boolean canDelete(User user, ValidationVisitor validationVisitor, PersistedObjectService objService)
      Description copied from class: net.pricefx.domain.PersistedObject
      Override this method to restrict the possibility to delete an object of this type. Default: true
      Overrides:
      canDelete in class PersistedObject
      Parameters:
      user - that requests delete access
      validationVisitor - receives any "not allowed messages"
      objService - needed for cross object editability checks. Implemented as parameter to optimize performance (vs. new object creation)
      Returns:
    • getItemClass

      public Class<? extends AbstractPricelistItem> getItemClass()
      Specified by:
      getItemClass in interface HasCalculableObjectItems
    • getItemClassS

      public static Class<? extends AbstractPricelistItem> getItemClassS(MatrixableCalculableObject.ListType type)
    • getItemListFilterField

      public String getItemListFilterField()
      Specified by:
      getItemListFilterField in interface HasCalculableObjectItems
    • getItemListFilterFieldS

      public static String getItemListFilterFieldS()
    • getItemAttributeMetaClass

      public Class<? extends ElementAttributeMeta> getItemAttributeMetaClass()
      Specified by:
      getItemAttributeMetaClass in interface HasCalculableObjectItems
    • onSubmit

      public String onSubmit(User submitter)
      Specified by:
      onSubmit in interface Approvable
    • onApprove

      public String onApprove(User approver)
      Description copied from interface: net.pricefx.domain.Approvable
      Called from the workflow engine.
      Specified by:
      onApprove in interface Approvable
      Returns:
      if non-null treated as error. WF engine does not approve this step
    • onWithdraw

      public String onWithdraw()
      Description copied from interface: net.pricefx.domain.Approvable
      Called from the workflow engine.
      Specified by:
      onWithdraw in interface Approvable
      Returns:
      if non-null treated as error. WF engine does not withdraw
    • onDeny

      public String onDeny(User denier)
      Description copied from interface: net.pricefx.domain.Approvable
      Called from the workflow engine.
      Specified by:
      onDeny in interface Approvable
      Returns:
      if non-null treated as error. WF engine does not withdraw
    • onApproved

      public void onApproved(User approver)
      Description copied from interface: net.pricefx.domain.Approvable
      Called from the workflow engine, one the workflow is completed
      Specified by:
      onApproved in interface Approvable
    • onApproved

      public void onApproved(User approver, PersistedObjectService objectService)
      Description copied from interface: net.pricefx.domain.Approvable
      Called from the workflow engine, one the workflow is completed
      Specified by:
      onApproved in interface Approvable
    • onNoApprovalRequired

      public void onNoApprovalRequired(User approver, WorkflowDTO workflowDTO)
      Description copied from interface: net.pricefx.domain.Approvable
      Called in case no approval is required (but the approvable was submitted
      Specified by:
      onNoApprovalRequired in interface Approvable
    • typeName

      public String typeName()
      Description copied from interface: net.pricefx.domain.Approvable
      Typically the lowercased class name of the approvable object (e.g. "quote") Used to set the uniqueName of the WorkflowFormula (to make the link) and for the groovy binding name
      Specified by:
      typeName in interface Approvable
      Returns:
    • processPostLoad

      public void processPostLoad()
      Description copied from interface: net.pricefx.domain.Approvable
      Inits the loaded Approvable.
      Specified by:
      processPostLoad in interface Approvable
    • getWorkflowStatus

      public Workflow.WorkflowStatus getWorkflowStatus()
      Specified by:
      getWorkflowStatus in interface Approvable
    • setWorkflowStatus

      public void setWorkflowStatus(Workflow.WorkflowStatus workflowStatus)
      Possible workflowStatus values: DRAFT, SUBMITTED, DENIED, APPROVED, NO_APPROVAL_REQUIRED, WITHDRAWN, INVALIDATED
      Specified by:
      setWorkflowStatus in interface Approvable
      Parameters:
      workflowStatus -
      See Also:
    • getUniqueNamePrefix

      public String getUniqueNamePrefix(PersistedObjectService objService)
      Specified by:
      getUniqueNamePrefix in interface Approvable
      Returns:
    • getParentTypedId

      public String getParentTypedId()
      Specified by:
      getParentTypedId in interface Approvable
      Returns:
      typedId of parent or null if approvable has no parent.
    • getSubmittedByName

      public String getSubmittedByName()
      Specified by:
      getSubmittedByName in interface Approvable
    • getHasCriticalAlert

      public boolean getHasCriticalAlert()
    • setHasCriticalAlert

      public void setHasCriticalAlert(Boolean hasCriticalAlert)
    • getWfLastExecutedByName

      public String getWfLastExecutedByName()
      Specified by:
      getWfLastExecutedByName in interface Approvable
    • getApprovedByName

      public String getApprovedByName()
      Specified by:
      getApprovedByName in interface Approvable
    • getDeniedByName

      public String getDeniedByName()
      Specified by:
      getDeniedByName in interface Approvable
    • setApprovedByName

      public void setApprovedByName(String approvedByName)
    • setDeniedByName

      public void setDeniedByName(String deniedByName)
    • getSubmitDate

      public LocalDateTime getSubmitDate()
    • submitDate

      public String submitDate()
    • setSubmitDate

      public void setSubmitDate(LocalDateTime submitDate)
    • setItemApprovalReason

      public void setItemApprovalReason(Map<String,String> reasons)
      Description copied from interface: net.pricefx.domain.Approvable
      Sets item level reason texts. Useful if the approval is on header level, but the reasons should be outlined on the individual items
      Specified by:
      setItemApprovalReason in interface Approvable
      Parameters:
      reasons - A map containing values in the form "itemTypedId : reason"
    • getApprovalRequiredEmailAttachments

      public List<?> getApprovalRequiredEmailAttachments()
      Description copied from interface: net.pricefx.domain.Approvable
      A list of attachments to attach into approval-required emails

      Note: at the moment, individual items must either be an instance of BinaryData, or its TypedId, or a Search upon the BinaryData entity

      Specified by:
      getApprovalRequiredEmailAttachments in interface Approvable
    • onSaveOrUpdate

      public void onSaveOrUpdate(PersistedObjectService objService)
      Description copied from class: net.pricefx.domain.PersistedObject
      Default does nothing. Method is called when object is about to be saved or updated Override point
      Overrides:
      onSaveOrUpdate in class PersistedObject
    • fillSubmitter

      protected void fillSubmitter(User submitter)
    • fillWfLastExecutedByName

      protected void fillWfLastExecutedByName(User executedByName)
    • updatePricelistHeader

      public void updatePricelistHeader(PersistedObjectService objService)
    • resetWorkflow

      public void resetWorkflow(PersistedObjectService objService)
    • getDefaultTrackerType

      public JobStatusTracker.TrackerType getDefaultTrackerType()
      Specified by:
      getDefaultTrackerType in class AbstractCalculable
    • itemsStateChanged

      public void itemsStateChanged(PersistedObjectService objService)
      Overrides:
      itemsStateChanged in class CalculableObject
    • doHardDelete

      public boolean doHardDelete()
      Description copied from class: net.pricefx.domain.PersistedObject
      Override to define if an object instance should be really deleted (vs just marked as deleted) Default: soft-delete
      Specified by:
      doHardDelete in interface Persistable
      Overrides:
      doHardDelete in class AbstractCalculable
    • getCreatedByName

      public String getCreatedByName()
      Specified by:
      getCreatedByName in interface NamedChangeTracker
    • setCreatedByName

      public void setCreatedByName(String createdByName)
      Specified by:
      setCreatedByName in interface NamedChangeTracker
    • getLastUpdateByName

      public String getLastUpdateByName()
    • setLastUpdateByName

      public void setLastUpdateByName(String lastUpdateByName)
      Specified by:
      setLastUpdateByName in interface NamedChangeTracker
      Specified by:
      setLastUpdateByName in interface WithLastUpdateByName
    • onPreProcessing

      public boolean onPreProcessing(Map<String,Object> values, LocalDateTime targetDate)
      Description copied from interface: net.pricefx.domain.APIModifiable
      Invoked before processing starts. Good point to normalize the structure. For instance lookup LookupTable and set it into the values.
      Specified by:
      onPreProcessing in interface APIModifiable
      Returns:
      false when processing should be stopped
    • getJobType

      public String getJobType()
      Specified by:
      getJobType in interface JobSettingsProvider
    • isShotgunEnabled

      public boolean isShotgunEnabled()
      Specified by:
      isShotgunEnabled in interface JobSettingsProvider
    • getShotgunThreshold

      public int getShotgunThreshold(PersistedObjectService objService, JobStatusTracker jst)
      Specified by:
      getShotgunThreshold in interface JobSettingsProvider
    • jobSize

      public int jobSize(PersistedObjectService objectService, JobStatusTracker jst, int runNumber)
      Specified by:
      jobSize in interface JobSettingsProvider
    • getAgentOption1

      public Object getAgentOption1(PersistedObjectService objService, JobStatusTracker jst, int runNumber)
      Specified by:
      getAgentOption1 in interface JobSettingsProvider