backend/model/entity/
drawings.rs1use chrono::NaiveDate;
2use diesel::{AsChangeset, Identifiable, Insertable, Queryable};
3use serde_json;
4use uuid::Uuid;
5
6use crate::model::r#enum::drawing_shape_type::DrawingShapeType;
7use crate::schema::drawings;
8
9#[derive(Debug, Clone, Identifiable, Queryable, Insertable)]
10#[diesel(table_name = drawings)]
11pub struct Drawing {
12 pub id: Uuid,
13 pub shape_type: DrawingShapeType,
14 pub add_date: Option<NaiveDate>,
15 pub remove_date: Option<NaiveDate>,
16 pub rotation: f32,
17 pub scale_x: f32,
18 pub scale_y: f32,
19 pub x: i32,
20 pub y: i32,
21 pub properties: serde_json::Value,
22 pub layer_id: Uuid,
23 pub notes: String,
24}
25
26#[derive(Debug, Clone, Default, AsChangeset)]
27#[diesel(table_name = drawings)]
28pub struct UpdateDrawing {
29 pub id: Uuid,
30 pub shape_type: Option<DrawingShapeType>,
31 pub add_date: Option<Option<NaiveDate>>,
32 pub remove_date: Option<Option<NaiveDate>>,
33 pub rotation: Option<f32>,
34 pub scale_x: Option<f32>,
35 pub scale_y: Option<f32>,
36 pub x: Option<i32>,
37 pub y: Option<i32>,
38 pub properties: Option<serde_json::Value>,
39 pub layer_id: Option<Uuid>,
40 pub notes: Option<String>,
41}