Added database connection

Code now connects to database and prints out errors. Also the ticket
table now includes a timestamp field
This commit is contained in:
2026-04-22 15:50:08 +02:00
parent 9972863232
commit bc0d3cb589
5 changed files with 214 additions and 0 deletions

30
backend/src/models.rs Normal file
View File

@@ -0,0 +1,30 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Deserialize)]
pub enum category {
WhiteboardBeamer,
Internet,
IPadKoffer,
AppleTV,
DocuCam,
Sonstiges,
}
#[derive(Deserialize, Clone, PartialEq, Debug)]
pub struct ticket {
pub id: i32,
pub category: category,
pub betreff: String,
pub description: String,
pub room: i16,
pub date: chrono::NaiveDateTime,
pub user_id: i16,
}
#[derive(Deserialize, Clone, PartialEq, Debug)]
pub struct user {
pub id: i16,
pub first_name: String,
pub last_name: String,
pub is_admin: bool,
}