From 413708f2baa3987b4b8c7c727eeee8cfd8d59f73 Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Sat, 27 Sep 2025 13:48:50 +0300 Subject: Fix invite tokens models --- entity/src/invite_tokens.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'entity/src/invite_tokens.rs') diff --git a/entity/src/invite_tokens.rs b/entity/src/invite_tokens.rs index f239567..c0b59f7 100644 --- a/entity/src/invite_tokens.rs +++ b/entity/src/invite_tokens.rs @@ -9,10 +9,14 @@ pub struct Model { pub id: i64, pub token: Uuid, pub queue_id: i64, + pub name: String, + pub is_revoked: bool, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { + #[sea_orm(has_many = "super::access_to_queue::Entity")] + AccessToQueue, #[sea_orm( belongs_to = "super::queues::Entity", from = "Column::QueueId", @@ -23,6 +27,12 @@ pub enum Relation { Queues, } +impl Related for Entity { + fn to() -> RelationDef { + Relation::AccessToQueue.def() + } +} + impl Related for Entity { fn to() -> RelationDef { Relation::Queues.def() -- cgit v1.2.3