PhoenixKit.Modules.CustomerService.TicketStatusHistory (phoenix_kit v1.7.71)
Copy Markdown View SourceSchema for ticket status change audit trail.
Records every status transition for a ticket, including who made the change and an optional reason. Used for auditing and tracking ticket lifecycle.
Fields
ticket_uuid- Reference to the ticketchanged_by_uuid- User who made the status changefrom_status- Previous status (nil for initial creation)to_status- New statusreason- Optional explanation for the change
Examples
# Ticket created
%TicketStatusHistory{
ticket_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
changed_by_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
from_status: nil,
to_status: "open",
reason: nil
}
# Ticket assigned and moved to in_progress
%TicketStatusHistory{
ticket_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
changed_by_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
from_status: "open",
to_status: "in_progress",
reason: "Assigned to support team"
}
# Ticket resolved
%TicketStatusHistory{
ticket_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
changed_by_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
from_status: "in_progress",
to_status: "resolved",
reason: "Issue fixed in version 2.0.1"
}
# Ticket reopened
%TicketStatusHistory{
ticket_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
changed_by_uuid: "018e3c4a-9f6b-7890-abcd-ef1234567890",
from_status: "resolved",
to_status: "open",
reason: "Issue still occurring after update"
}
Summary
Functions
Changeset for creating a status history entry.
Check if this is a close transition.
Check if this is the initial creation record.
Check if this is a reopen transition.
Check if this is a resolution transition.
Types
@type t() :: %PhoenixKit.Modules.CustomerService.TicketStatusHistory{ __meta__: term(), changed_by: PhoenixKit.Users.Auth.User.t() | Ecto.Association.NotLoaded.t(), changed_by_uuid: UUIDv7.t(), from_status: String.t() | nil, inserted_at: DateTime.t() | nil, reason: String.t() | nil, ticket: PhoenixKit.Modules.CustomerService.Ticket.t() | Ecto.Association.NotLoaded.t(), ticket_uuid: UUIDv7.t(), to_status: String.t(), uuid: UUIDv7.t() | nil }
Functions
Changeset for creating a status history entry.
Required Fields
ticket_uuid- Reference to ticketchanged_by_uuid- User who made the changeto_status- New status
Note: from_status is optional (nil for ticket creation).
Check if this is a close transition.
Check if this is the initial creation record.
Check if this is a reopen transition.
Check if this is a resolution transition.