Enum Class RebateRecordStatus

Object
Enum<RebateRecordStatus>
RebateRecordStatus
All Implemented Interfaces:
Serializable, Comparable<RebateRecordStatus>, Constable

public enum RebateRecordStatus extends Enum<RebateRecordStatus>
Lists the statuses of a Rebate Record and of a Rebate Record Group.

The status is in the status field. The platform sets it when the record goes through its approval workflow, when a user revokes it, and when its Rebate Agreement is revoked or replaced by a revision. A new record is DRAFT. Submitting it makes it SUBMITTED, and approval makes it APPROVED. Only a record in DRAFT can be edited.

The agreementStatus field of the record holds the status of its Rebate Agreement (RebateAgreementStatus). A change of the agreement updates agreementStatus on every linked record, but it does not change the status of an approved Rebate Record. This does not apply to Rebate Record Groups: revoking the agreement makes every group REVOKED, approved ones included, and undoing the revocation makes every group APPROVED, whatever its status was before. The Rebate Record logic decides which combinations of the two statuses are valid.

Example, select the approved Rebate Records of a Rebate Record Set:


 import net.pricefx.common.api.RebateRecordStatus

 def q = api.queryApi()
 def t = q.tables().rebateRecords(17)

 return q.source(t, [t.uniqueName(), t.status(), t.agreementStatus()],
         t.status().equal(RebateRecordStatus.APPROVED))
         .stream { it.collect { it } }
 
See Also:
  • Enum Constant Details

    • DRAFT

      public static final RebateRecordStatus DRAFT
      The record is new, or its approval was withdrawn or denied. Only a record in this status can be edited.
    • SUBMITTED

      public static final RebateRecordStatus SUBMITTED
      The record was submitted and is in its approval workflow.
    • APPROVED

      public static final RebateRecordStatus APPROVED
      The approval workflow approved the record, or the workflow had no approval steps. Undoing the revocation of a Rebate Record or a Rebate Record Group returns it to this status. Undoing the revocation of the Rebate Agreement returns its revoked Rebate Records to DRAFT instead, and its Rebate Record Groups to this status. Only an approved record can be revoked on its own.
    • REVOKED

      public static final RebateRecordStatus REVOKED
      A user revoked the record or its Rebate Record Group, or its Rebate Agreement was revoked. When the agreement is revoked, every Rebate Record Group changes to this status, but a Rebate Record changes only if it is not approved. In that case a pending approval workflow of the record or group is cancelled. Revoking a Rebate Record Group changes all its Rebate Records to this status, whatever their status, and does not cancel their workflows.
    • INVALIDATED

      public static final RebateRecordStatus INVALIDATED
      A revision of the Rebate Agreement was approved while the record was not approved. A pending approval workflow of the record is cancelled.
  • Method Details

    • values

      public static RebateRecordStatus[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RebateRecordStatus valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • voidsPendingApproval

      public boolean voidsPendingApproval()
      Whether a record reaching this status is no longer open for approval, so that a pending approval of it has to be invalidated and its approve/deny refused.
      Returns:
      true for REVOKED and INVALIDATED, false for the other statuses