thoth_api/imprint/
model.rs

1use uuid::Uuid;
2
3#[cfg(feature = "backend")]
4use crate::schema::imprint;
5
6#[cfg_attr(feature = "backend", derive(Queryable))]
7pub struct Imprint {
8    pub imprint_id: Uuid,
9    pub publisher_id: Uuid,
10    pub imprint_name: String,
11    pub imprint_url: Option<String>,
12}
13
14#[cfg_attr(
15    feature = "backend",
16    derive(juniper::GraphQLInputObject, Insertable),
17    table_name = "imprint"
18)]
19pub struct NewImprint {
20    pub publisher_id: Uuid,
21    pub imprint_name: String,
22    pub imprint_url: Option<String>,
23}
24
25#[cfg_attr(
26    feature = "backend",
27    derive(juniper::GraphQLInputObject, AsChangeset),
28    changeset_options(treat_none_as_null = "true"),
29    table_name = "imprint"
30)]
31pub struct PatchImprint {
32    pub imprint_id: Uuid,
33    pub publisher_id: Uuid,
34    pub imprint_name: String,
35    pub imprint_url: Option<String>,
36}