Skip to main content

Approval workflow

Who can approve

Only roles holding the orders.approve permission can approve orders:

Approval flow

  1. Order is placed with items and sizes. If the matched rule set requires approval, the order is stored with status PENDING_APPROVAL; otherwise it submits directly as SUBMITTED.
  2. HR or an admin reviews the order (in-app notification and email, with the Sales Order PDF attached) and either:
    • Approves, moving it to APPROVED, or
    • Rejects with a required reason, moving it to REJECTED.
  3. Pending orders can be edited before approval: items, quantities, and sizes can be modified, and the entitlement split is recalculated on save.

Rejection handling

  • The status moves to REJECTED (terminal).
  • The reason is stored on the order (rejectedReason) and recorded in OrderStatusHistory.
  • No entitlement is consumed by a rejected order; the submitter can view the reason and place a corrected order.

Entitlement impact

Entitlement consumption is recorded per order item against the employee’s active entitlement period (see Entitlement engine):

Email notifications

Email delivery is best-effort and never blocks the order transition: notifications (in-app and email, including Sales Order PDF generation) are dispatched in the background after the transaction commits. See Notifications.

Scoping

The ScopeGuard ensures:
  • A Store Manager can only place orders for their own store
  • An HR user can only approve orders within their client
  • Admins can approve across all clients