2022-05-03 17:44:13 +00:00
|
|
|
use crate::newtypes::{LocalUserId, PersonId};
|
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use crate::schema::registration_application;
|
2022-11-02 19:18:22 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2023-04-26 04:26:10 +00:00
|
|
|
use serde_with::skip_serializing_none;
|
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use ts_rs::TS;
|
2022-05-03 17:44:13 +00:00
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = registration_application))]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2021-12-15 19:49:59 +00:00
|
|
|
pub struct RegistrationApplication {
|
|
|
|
pub id: i32,
|
|
|
|
pub local_user_id: LocalUserId,
|
|
|
|
pub answer: String,
|
|
|
|
pub admin_id: Option<PersonId>,
|
|
|
|
pub deny_reason: Option<String>,
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
}
|
|
|
|
|
2022-10-27 09:24:07 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(Insertable))]
|
2022-09-26 14:09:32 +00:00
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = registration_application))]
|
2022-10-27 09:24:07 +00:00
|
|
|
pub struct RegistrationApplicationInsertForm {
|
|
|
|
pub local_user_id: LocalUserId,
|
|
|
|
pub answer: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "full", derive(AsChangeset))]
|
|
|
|
#[cfg_attr(feature = "full", diesel(table_name = registration_application))]
|
|
|
|
pub struct RegistrationApplicationUpdateForm {
|
|
|
|
pub admin_id: Option<Option<PersonId>>,
|
2021-12-15 19:49:59 +00:00
|
|
|
pub deny_reason: Option<Option<String>>,
|
|
|
|
}
|