92 lines
2.6 KiB
Rust
92 lines
2.6 KiB
Rust
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
/// User information for admin user management
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
pub struct User {
|
|
pub id: String,
|
|
pub username: String,
|
|
pub email: Option<String>,
|
|
pub role: AdminUserRole,
|
|
pub is_active: bool,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
pub last_login: Option<DateTime<Utc>>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
|
|
pub enum AdminUserRole {
|
|
#[serde(rename = "admin")]
|
|
Admin,
|
|
#[serde(rename = "moderator")]
|
|
Moderator,
|
|
#[serde(rename = "user")]
|
|
User,
|
|
}
|
|
|
|
/// Schedule data
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
pub struct Schedule {
|
|
pub date: String, // YYYY-MM-DD format
|
|
pub sabbath_school: Option<String>,
|
|
pub divine_worship: Option<String>,
|
|
pub scripture_reading: Option<String>,
|
|
pub sunset: Option<String>,
|
|
pub special_notes: Option<String>,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|
|
|
|
/// Conference data
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
pub struct ConferenceData {
|
|
pub id: String,
|
|
pub name: String,
|
|
pub website: Option<String>,
|
|
pub contact_info: Option<String>,
|
|
pub leadership: Option<Vec<ConferenceLeader>>,
|
|
pub announcements: Option<Vec<String>>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
pub struct ConferenceLeader {
|
|
pub name: String,
|
|
pub title: String,
|
|
pub email: Option<String>,
|
|
pub phone: Option<String>,
|
|
}
|
|
|
|
/// New schedule creation
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
pub struct NewSchedule {
|
|
pub date: String, // YYYY-MM-DD format
|
|
pub sabbath_school: Option<String>,
|
|
pub divine_worship: Option<String>,
|
|
pub scripture_reading: Option<String>,
|
|
pub sunset: Option<String>,
|
|
pub special_notes: Option<String>,
|
|
}
|
|
|
|
/// Schedule update
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
pub struct ScheduleUpdate {
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub sabbath_school: Option<String>,
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub divine_worship: Option<String>,
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub scripture_reading: Option<String>,
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub sunset: Option<String>,
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub special_notes: Option<String>,
|
|
}
|
|
|
|
/// File upload response
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
pub struct UploadResponse {
|
|
pub file_path: String,
|
|
pub pdf_path: Option<String>, // Full URL to the uploaded file
|
|
pub message: String,
|
|
} |