1 use crate::newtypes::{CommunityBlockId, CommunityId, PersonId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::community_block;
7 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", belongs_to(crate::source::community::Community))]
10 #[cfg_attr(feature = "full", table_name = "community_block")]
11 pub struct CommunityBlock {
12 pub id: CommunityBlockId,
13 pub person_id: PersonId,
14 pub community_id: CommunityId,
15 pub published: chrono::NaiveDateTime,
18 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
19 #[cfg_attr(feature = "full", table_name = "community_block")]
20 pub struct CommunityBlockForm {
21 pub person_id: PersonId,
22 pub community_id: CommunityId,