thoth_api/contributor/
model.rs

1use uuid::Uuid;
2
3#[cfg(feature = "backend")]
4use crate::schema::contributor;
5
6#[cfg_attr(feature = "backend", derive(Queryable))]
7pub struct Contributor {
8    pub contributor_id: Uuid,
9    pub first_name: Option<String>,
10    pub last_name: String,
11    pub full_name: String,
12    pub orcid: Option<String>,
13    pub website: Option<String>,
14}
15
16#[cfg_attr(
17    feature = "backend",
18    derive(juniper::GraphQLInputObject, Insertable),
19    table_name = "contributor"
20)]
21pub struct NewContributor {
22    pub first_name: Option<String>,
23    pub last_name: String,
24    pub full_name: String,
25    pub orcid: Option<String>,
26    pub website: Option<String>,
27}
28
29#[cfg_attr(
30    feature = "backend",
31    derive(juniper::GraphQLInputObject, AsChangeset),
32    changeset_options(treat_none_as_null = "true"),
33    table_name = "contributor"
34)]
35pub struct PatchContributor {
36    pub contributor_id: Uuid,
37    pub first_name: Option<String>,
38    pub last_name: String,
39    pub full_name: String,
40    pub orcid: Option<String>,
41    pub website: Option<String>,
42}