Skip to content

OnTicketBeforeCreated

Back to Index

This hook runs before any command have been applied to a Ticket Actor from the create message. Commands returned will be applied to the ticket before the create message’s commands.

The ticket field in the input will contain only basic information, such as ticketId and createdAt. Note that ticketNumber is not yet set, and generateTicketNumberByPrefix command can be used to set a different the order number serie than the default.

Type

{
hook: 'OnTicketCommands'
ticket: Ticket
}

Effects

effects.common.sendMessage Sends a message to another actor after the ticket has been saved. Responses from the target actor is ignored.

effects.common.validationError Aborts the creation of the ticket and returns the error to the caller.

effects.ticket.command.* Applies a command to the actor. Replace * with the type of command you want to apply.

Examples

Custom Order Number Prefix

param input: OnTicketBeforeCreated
from effects.ticket.command.generateTicketNumberByPrefix {
prefix = 'CUSTOM'
}
Back to Index