feat: Implement full-stack cohort management with dedicated API, database schema, and admin UI, alongside updates to the database reset script and documentation.

This commit is contained in:
2026-02-16 04:03:19 -03:00
parent fbac6b4405
commit 172b4fa2d5
10 changed files with 550 additions and 3 deletions
+30
View File
@@ -451,6 +451,36 @@ pub struct SaveNotePayload {
pub content: String,
}
// Cohorts & Groups
#[derive(Debug, Serialize, Deserialize, sqlx::FromRow, Clone)]
pub struct Cohort {
pub id: Uuid,
pub organization_id: Uuid,
pub name: String,
pub description: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
#[derive(Debug, Serialize, Deserialize, sqlx::FromRow, Clone)]
pub struct UserCohort {
pub id: Uuid,
pub cohort_id: Uuid,
pub user_id: Uuid,
pub assigned_at: DateTime<Utc>,
}
#[derive(Debug, Deserialize)]
pub struct CreateCohortPayload {
pub name: String,
pub description: Option<String>,
}
#[derive(Debug, Deserialize)]
pub struct AddMemberPayload {
pub user_id: Uuid,
}
#[cfg(test)]
mod tests {
use super::*;