Added functions for adding, deleting and showing tickets
As said, functions got implemented. Also minor changes to migration layout and dependencies
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
use std::fmt::Display;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::{Decode, prelude::Type};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Decode, Type)]
|
||||
pub enum Category {
|
||||
WhiteboardBeamer,
|
||||
Internet,
|
||||
@@ -25,7 +26,7 @@ impl Display for Category {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Decode, Type)]
|
||||
pub enum Status {
|
||||
ToDo,
|
||||
InProgress,
|
||||
@@ -56,6 +57,18 @@ pub struct Ticket {
|
||||
pub user_id: i16,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug, PartialEq)]
|
||||
pub struct TicketResponse {
|
||||
pub id: i32,
|
||||
pub category: Category,
|
||||
pub betreff: String,
|
||||
pub description: String,
|
||||
pub room: i16,
|
||||
pub status: Status,
|
||||
pub date: chrono::NaiveDateTime,
|
||||
pub user_id: i16,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, PartialEq, Debug)]
|
||||
pub struct User {
|
||||
pub id: i16,
|
||||
|
||||
Reference in New Issue
Block a user