Include documentation for API and subcrates

This commit is contained in:
Ben Grant 2023-05-15 23:51:12 +10:00
parent dfdfc24ee5
commit 3e770a337b
40 changed files with 89 additions and 9 deletions

View file

@ -0,0 +1,29 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "event")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
pub name: String,
pub created_at: DateTime,
pub visited_at: DateTime,
pub times: Json,
pub timezone: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::person::Entity")]
Person,
}
impl Related<super::person::Entity> for Entity {
fn to() -> RelationDef {
Relation::Person.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View file

@ -0,0 +1,7 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
pub mod prelude;
pub mod event;
pub mod person;
pub mod stats;

View file

@ -0,0 +1,35 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "person")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub name: String,
pub password_hash: Option<String>,
pub created_at: DateTime,
pub availability: Json,
#[sea_orm(primary_key, auto_increment = false)]
pub event_id: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::event::Entity",
from = "Column::EventId",
to = "super::event::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
)]
Event,
}
impl Related<super::event::Entity> for Entity {
fn to() -> RelationDef {
Relation::Event.def()
}
}
impl ActiveModelBehavior for ActiveModel {}

View file

@ -0,0 +1,5 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
pub use super::event::Entity as Event;
pub use super::person::Entity as Person;
pub use super::stats::Entity as Stats;

View file

@ -0,0 +1,17 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "stats")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub event_count: i32,
pub person_count: i32,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {}