Skip to main content

max / goingson

841 B · 26 lines History Blame Raw
1 //! Sync account model for external calendar/contact provider connections.
2
3 use chrono::{DateTime, Utc};
4 use serde::{Deserialize, Serialize};
5 use crate::id_types::{SyncAccountId, UserId};
6
7 /// A configured sync account for an external provider (Google, Apple, Microsoft).
8 #[derive(Debug, Clone, Serialize, Deserialize)]
9 #[serde(rename_all = "camelCase")]
10 pub struct SyncAccount {
11 pub id: SyncAccountId,
12 #[serde(skip_serializing)]
13 pub user_id: UserId,
14 pub provider: String,
15 pub account_name: String,
16 pub email: Option<String>,
17 pub sync_calendars: bool,
18 pub sync_contacts: bool,
19 pub calendar_ids: Vec<String>,
20 pub last_calendar_sync: Option<DateTime<Utc>>,
21 pub last_contact_sync: Option<DateTime<Utc>>,
22 pub sync_interval_minutes: i32,
23 pub enabled: bool,
24 pub created_at: DateTime<Utc>,
25 }
26