pub async fn create_ticket(
__arg0: Extension<FilteredUser>,
__arg1: State<Arc<AppState>>,
__arg2: Json<TicketCreateScheme>,
) -> Result<impl IntoResponse, (StatusCode, Json<Value>)>Expand description
Creates a new support ticket.
Associates the ticket with the authenticated FilteredUser and sets the current timestamp.
Converts the TicketCreateScheme request into a database record.
Tickets are automatically created with “open” status.
§Arguments
Extension(user): AuthenticatedFilteredUser(extracted from JWT token via middleware)State(data): Application state containingAppStatefor database accessJson(body):TicketCreateSchemecontaining ticket details (category, subject, description, room)
§Returns
200 OKon successful creation500 Internal Server Errorif database insertion fails
§Database Fields Set Automatically
user_id: From authenticated userstatus: Defaults to “open”date: Current UTC timestamp