using InboxIntel.Domain.Enums;
namespace InboxIntel.Infrastructure.Configuration;
public class GoogleOAuthOptions
{
public const string SectionName = "GoogleOAuth";
public string ClientId { get; set; } = string.Empty;
public string ClientSecret { get; set; } = string.Empty;
/// Scopes requested. Gmail read + modify (no send).
public string[] Scopes { get; set; } =
{
"openid", "email", "profile",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.modify"
};
}
public class GmailSyncOptions
{
public const string SectionName = "GmailSync";
/// Message-id list page size (Gmail max is 500).
public int PageSize { get; set; } = 500;
/// Concurrent Gmail message fetches during sync (kept well under quota).
public int MaxParallelism { get; set; } = 8;
public int MaxRetries { get; set; } = 5;
/// Base delay in ms for exponential backoff.
public int BackoffBaseMs { get; set; } = 500;
/// Cron-like daily sync hour (UTC) for the scheduled worker.
public int DailySyncHourUtc { get; set; } = 3;
///
/// Cap on messages stored during a full sync. 0 = unlimited. In dev this is
/// set to 1000 so the initial load pulls only the most recent emails.
///
public int MaxMessages { get; set; } = 0;
}
public class AiOptions
{
public const string SectionName = "Ai";
public AiProviderMode Mode { get; set; } = AiProviderMode.Disabled;
// Ollama (local)
public string OllamaBaseUrl { get; set; } = "http://localhost:11434";
public string OllamaModel { get; set; } = "llama3.1";
// Embedding model for semantic search (per docs/discovery/06). Small, always-on when local.
public string EmbeddingModel { get; set; } = "nomic-embed-text";
// OpenAI (cloud, optional)
public string OpenAiApiKey { get; set; } = string.Empty;
public string OpenAiModel { get; set; } = "gpt-4o-mini";
}
public class SmtpOptions
{
public const string SectionName = "Smtp";
public bool Enabled { get; set; } = false;
public string Host { get; set; } = string.Empty;
public int Port { get; set; } = 587;
public bool UseSsl { get; set; } = true;
public string User { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string FromAddress { get; set; } = string.Empty;
public string FromName { get; set; } = "InboxIntel";
}
public class DigestOptions
{
public const string SectionName = "Digest";
/// How often a digest is sent to each opted-in user.
public int FrequencyDays { get; set; } = 7;
/// Hour (UTC) the background worker checks for due digests.
public int SendHourUtc { get; set; } = 8;
}
/// AUDIT H-3: opt-in local data retention. 0 = disabled (keep forever).
public class DataRetentionOptions
{
public const string SectionName = "DataRetention";
/// Purge locally stored emails flagged Trashed older than this many days.
public int PurgeTrashedAfterDays { get; set; } = 0;
/// Purge ALL locally stored emails older than this many days (local copy only).
public int PurgeAllAfterDays { get; set; } = 0;
}