TicketResponse

Struct TicketResponse 

Source
pub struct TicketResponse {
    pub id: i32,
    pub category: String,
    pub betreff: String,
    pub description: String,
    pub room: i16,
    pub status: String,
    pub date: DateTime<Utc>,
    pub user_id: i16,
    pub user_first_name: String,
    pub user_last_name: String,
}
Expand description

API response for a ticket with user information.

Returned by ticket endpoints. Includes denormalized user data for easier frontend rendering. Created via TicketCreateScheme.

§Fields

  • id: Unique ticket identifier
  • category: Ticket category/type
  • betreff: Ticket subject line
  • description: Detailed ticket description
  • room: Room number associated with the issue
  • status: Current ticket status (e.g., “open”, “in_progress”, “resolved”)
  • date: When the ticket was created (UTC timestamp)
  • user_id: ID of the user who created the ticket (references User)
  • user_first_name, user_last_name: User’s name (denormalized for convenience)

§Example

{
  "id": 1,
  "category": "maintenance",
  "betreff": "Broken light in room 101",
  "description": "The ceiling light is not working",
  "room": 101,
  "status": "open",
  "date": "2024-01-15T10:30:00Z",
  "user_id": 5,
  "user_first_name": "John",
  "user_last_name": "Doe"
}

Fields§

§id: i32

Unique ticket identifier

§category: String

Ticket category/type (e.g., “maintenance”, “support”)

§betreff: String

Ticket subject line

§description: String

Detailed ticket description

§room: i16

Room number associated with the issue

§status: String

Current ticket status (e.g., “open”, “in_progress”, “resolved”, “archived”)

§date: DateTime<Utc>

When the ticket was created (UTC timestamp)

§user_id: i16

ID of the user who created the ticket

§user_first_name: String

First name of the ticket creator (denormalized from User)

§user_last_name: String

Last name of the ticket creator (denormalized from User)

Trait Implementations§

Source§

impl Debug for TicketResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TicketResponse

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TicketResponse

Source§

fn eq(&self, other: &TicketResponse) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TicketResponse

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TicketResponse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,