Skip to content
← Back to Index

OnTicketValidate

This hook runs immediately after the OnTicketCommands hook and any commands it returned have been applied to the Ticket Actor.

It is the place to enforce invariants that can only be checked once all OnTicketCommands rules have settled, and to either reject the ticket with a validationError effect or auto-fix it by emitting more ticketCommand effects.

Commands returned from this hook are applied to the ticket, but do not re-trigger OnTicketCommands or OnTicketValidate. The hook runs once per message.

Type

filtrera
{
  hook: 'OnTicketValidate'
  before: Ticket // The ticket before the incoming message commands were applied
  ticket: Ticket // The ticket after OnTicketCommands has run
}

Effects

validationError Reverts the ticket state and returns the error to the caller.
messageActor Sends a message to another actor. Responses are ignored.
scheduleJob Schedules a job.
sendEmail Queues an email for delivery through the Sendings system.
ticketCommand Applies a corrective command to the ticket. Commands returned from OnTicketValidate do not re-trigger OnTicketCommands or OnTicketValidate.

© 2024 Hantera AB. All rights reserved.