37 lines
686 B
Rust
37 lines
686 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::db::model_utils::Period;
|
|
use crate::types::EmgauwaUid;
|
|
|
|
#[derive(Debug, Serialize)]
|
|
pub struct Relay {
|
|
#[serde(skip)]
|
|
pub id: i64,
|
|
// TODO
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Clone)]
|
|
pub struct Schedule {
|
|
#[serde(skip)]
|
|
pub id: i64,
|
|
#[serde(rename(serialize = "id"))]
|
|
pub uid: EmgauwaUid,
|
|
pub name: String,
|
|
pub periods: Periods,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
|
|
pub struct Periods(pub Vec<Period>);
|
|
|
|
#[derive(Debug, Serialize, Clone)]
|
|
pub struct Tag {
|
|
pub id: i64,
|
|
pub tag: String,
|
|
}
|
|
|
|
pub struct JunctionTag {
|
|
pub id: i64,
|
|
pub tag_id: i64,
|
|
pub relay_id: Option<i64>,
|
|
pub schedule_id: Option<i64>,
|
|
}
|