- Add gitignore and prettier configuration files for project scaffolding - Implement room access control service with project member verification - Create user access key management with CRUD operations and activity logging - Add accordion UI component for frontend expandable sections - Implement room AI configuration with list, upsert, and delete operations - Add AI event types for agent join/leave/status change tracking - Create streaming AI processing services for mode and react patterns - Build room AI service with model detection and idempotency handling - Integrate chat service orchestration for AI message processing - Add typing indicators and stream cancellation for AI interactions - Implement mention parsing and context extraction for AI agents
40 lines
1.3 KiB
Rust
40 lines
1.3 KiB
Rust
use crate::{DateTimeUtc, RoomId, Seq, UserId};
|
|
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
/// Per-user per-room state: read position, notification preferences, etc.
|
|
/// Not membership — any user who interacts with a room gets a state row (lazy init).
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "room_user_state")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
pub room: RoomId,
|
|
#[sea_orm(primary_key)]
|
|
pub user: UserId,
|
|
pub last_read_seq: Option<Seq>,
|
|
/// Do Not Disturb: if true, suppress notifications for this room
|
|
pub do_not_disturb: bool,
|
|
/// DND start hour (0-23, local time). None means no scheduled DND.
|
|
pub dnd_start_hour: Option<i16>,
|
|
/// DND end hour (0-23, local time). None means no scheduled DND.
|
|
pub dnd_end_hour: Option<i16>,
|
|
pub joined_at: Option<DateTimeUtc>,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(
|
|
belongs_to = "super::room::Entity",
|
|
from = "Column::Room",
|
|
to = "super::room::Column::Id"
|
|
)]
|
|
Room,
|
|
}
|
|
|
|
impl Related<super::room::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
Relation::Room.def()
|
|
}
|
|
}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {} |