Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m30s
35 lines
654 B
Rust
35 lines
654 B
Rust
use sqlx::{
|
|
prelude::FromRow,
|
|
types::{
|
|
Uuid,
|
|
chrono::{DateTime, Utc},
|
|
},
|
|
};
|
|
|
|
#[derive(Debug, FromRow)]
|
|
pub struct Organization {
|
|
pub id: Uuid,
|
|
pub name: String,
|
|
pub slug: String,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(sqlx::Type, Debug, Clone, PartialEq)]
|
|
#[sqlx(type_name = "org_role", rename_all = "lowercase")]
|
|
pub enum OrgRole {
|
|
Owner,
|
|
Admin,
|
|
Member,
|
|
Viewer,
|
|
}
|
|
|
|
#[derive(Debug, FromRow)]
|
|
pub struct OrgMember {
|
|
pub user_id: Uuid,
|
|
pub org_id: Uuid,
|
|
pub role: OrgRole,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|