diff options
| author | Tolmachev Igor <me@igorek.dev> | 2025-09-27 13:48:50 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2025-09-27 13:48:50 +0300 |
| commit | 413708f2baa3987b4b8c7c727eeee8cfd8d59f73 (patch) | |
| tree | b108339ad2b2c78b9b01c8c413ab54ab1e673168 /entity/src/invite_tokens.rs | |
| parent | 974c8c586e1182d502a2c30ba8b622c0b4033937 (diff) | |
| download | queue_server-413708f2baa3987b4b8c7c727eeee8cfd8d59f73.tar.gz queue_server-413708f2baa3987b4b8c7c727eeee8cfd8d59f73.zip | |
Fix invite tokens models
Diffstat (limited to 'entity/src/invite_tokens.rs')
| -rw-r--r-- | entity/src/invite_tokens.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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 { | |||
| 9 | pub id: i64, | 9 | pub id: i64, |
| 10 | pub token: Uuid, | 10 | pub token: Uuid, |
| 11 | pub queue_id: i64, | 11 | pub queue_id: i64, |
| 12 | pub name: String, | ||
| 13 | pub is_revoked: bool, | ||
| 12 | } | 14 | } |
| 13 | 15 | ||
| 14 | #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | 16 | #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] |
| 15 | pub enum Relation { | 17 | pub enum Relation { |
| 18 | #[sea_orm(has_many = "super::access_to_queue::Entity")] | ||
| 19 | AccessToQueue, | ||
| 16 | #[sea_orm( | 20 | #[sea_orm( |
| 17 | belongs_to = "super::queues::Entity", | 21 | belongs_to = "super::queues::Entity", |
| 18 | from = "Column::QueueId", | 22 | from = "Column::QueueId", |
| @@ -23,6 +27,12 @@ pub enum Relation { | |||
| 23 | Queues, | 27 | Queues, |
| 24 | } | 28 | } |
| 25 | 29 | ||
| 30 | impl Related<super::access_to_queue::Entity> for Entity { | ||
| 31 | fn to() -> RelationDef { | ||
| 32 | Relation::AccessToQueue.def() | ||
| 33 | } | ||
| 34 | } | ||
| 35 | |||
| 26 | impl Related<super::queues::Entity> for Entity { | 36 | impl Related<super::queues::Entity> for Entity { |
| 27 | fn to() -> RelationDef { | 37 | fn to() -> RelationDef { |
| 28 | Relation::Queues.def() | 38 | Relation::Queues.def() |
