Skip to main content

authx_core/models/
invite.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use uuid::Uuid;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct Invite {
7    pub id: Uuid,
8    pub org_id: Uuid,
9    pub email: String,
10    pub role_id: Uuid,
11    /// SHA-256 hash of the raw token (raw is returned to caller once).
12    pub token_hash: String,
13    pub expires_at: DateTime<Utc>,
14    pub accepted_at: Option<DateTime<Utc>>,
15}
16
17#[derive(Debug, Clone)]
18pub struct CreateInvite {
19    pub org_id: Uuid,
20    pub email: String,
21    pub role_id: Uuid,
22    pub token_hash: String,
23    pub expires_at: DateTime<Utc>,
24}