use chrono::{DateTime, NaiveDate, Utc}; use serde::{Deserialize, Serialize}; use sqlx::FromRow; use uuid::Uuid; #[derive(Debug, Clone, Serialize, Deserialize, FromRow)] pub struct User { pub id: Uuid, pub username: String, // NOT NULL pub email: Option, // nullable pub name: Option, // nullable pub avatar_url: Option, // nullable pub role: Option, // nullable (has default) pub verified: Option, // nullable (has default) pub created_at: Option>, // nullable (has default) pub updated_at: Option>, // nullable (has default) } #[derive(Debug, Clone, Serialize, Deserialize, FromRow)] pub struct Bulletin { pub id: Uuid, pub title: String, pub date: NaiveDate, pub url: Option, pub pdf_url: Option, pub is_active: Option, pub pdf_file: Option, pub sabbath_school: Option, pub divine_worship: Option, pub scripture_reading: Option, pub sunset: Option, pub cover_image: Option, pub pdf_path: Option, pub cover_image_path: Option, pub created_at: Option>, pub updated_at: Option>, } #[derive(Debug, Clone, Serialize, Deserialize, FromRow)] pub struct Event { pub id: Uuid, pub title: String, pub description: String, pub start_time: DateTime, pub end_time: DateTime, pub location: String, pub location_url: Option, pub image: Option, pub thumbnail: Option, pub category: String, pub is_featured: Option, pub recurring_type: Option, pub approved_from: Option, pub image_path: Option, pub created_at: Option>, pub updated_at: Option>, } #[derive(Debug, Clone, Serialize, Deserialize, FromRow)] pub struct PendingEvent { pub id: Uuid, pub title: String, // NOT NULL pub description: String, // NOT NULL pub start_time: DateTime, // NOT NULL pub end_time: DateTime, // NOT NULL pub location: String, // NOT NULL pub location_url: Option, // nullable pub image: Option, // nullable pub thumbnail: Option, // nullable pub category: String, // NOT NULL pub is_featured: Option, // nullable (has default) pub recurring_type: Option, // nullable pub approval_status: Option, // nullable (has default) pub submitted_at: Option>, // nullable (has default) pub bulletin_week: String, // NOT NULL pub admin_notes: Option, // nullable pub submitter_email: Option, // nullable pub email_sent: Option, // nullable (has default) pub pending_email_sent: Option, // nullable (has default) pub rejection_email_sent: Option, // nullable (has default) pub approval_email_sent: Option, // nullable (has default) pub image_path: Option, pub created_at: Option>, // nullable (has default) pub updated_at: Option>, // nullable (has default) } #[derive(Debug, Clone, Serialize, Deserialize, FromRow)] pub struct ChurchConfig { pub id: Uuid, pub church_name: String, pub contact_email: String, pub contact_phone: Option, pub church_address: String, pub po_box: Option, pub google_maps_url: Option, pub about_text: String, pub api_keys: Option, pub created_at: Option>, pub updated_at: Option>, } #[derive(Debug, Serialize)] pub struct ApiResponse { pub success: bool, pub data: Option, pub message: Option, } #[derive(Debug, Deserialize)] pub struct LoginRequest { pub username: String, pub password: String, } #[derive(Debug, Serialize)] pub struct LoginResponse { pub token: String, pub user: User, } #[derive(Debug, Deserialize)] pub struct CreateBulletinRequest { pub title: String, pub date: NaiveDate, pub url: Option, pub sabbath_school: Option, pub divine_worship: Option, pub scripture_reading: Option, pub sunset: Option, pub is_active: Option, } #[derive(Debug, Deserialize)] pub struct CreateEventRequest { pub title: String, pub description: String, pub start_time: DateTime, pub end_time: DateTime, pub location: String, pub location_url: Option, pub category: String, pub is_featured: Option, pub recurring_type: Option, } #[derive(Debug, Deserialize)] pub struct SubmitEventRequest { pub title: String, pub description: String, pub start_time: DateTime, pub end_time: DateTime, pub location: String, pub location_url: Option, pub category: String, pub is_featured: Option, pub recurring_type: Option, pub bulletin_week: String, pub submitter_email: Option, } #[derive(Debug, Serialize)] pub struct PaginatedResponse { pub items: Vec, pub total: i64, pub page: i32, pub per_page: i32, pub has_more: bool, } #[derive(Debug, Deserialize)] pub struct PaginationParams { pub page: Option, pub per_page: Option, }