darkwing/database/user/
model.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![allow(
  non_snake_case,
  reason = "sqlx query_as macro does not support FromRow trait, so we cant use renamed fields. see https://github.com/launchbadge/sqlx/issues/1372 and https://github.com/launchbadge/sqlx/issues/514"
)]

//! User model module containing database entity representations for users.
//!
//! This module provides the database model for user entities, including their
//! relationships and data structures used for database operations.

use sqlx::FromRow;

/// Represents a user entity in the database.
///
/// This struct maps directly to the users table and contains all relevant
/// user information including their team association and role.
#[derive(FromRow, Debug, Default)]
#[allow(unused)]
pub struct User {
  /// Unique identifier for the user
  pub id: u64,
  /// ID of the team this user belongs to
  pub teamId: i64,
  /// Username of the user
  pub username: String,
  /// Role of the user in the system
  pub role: String,
}