namespace MMail.Client.Models;
public class Account
{
public int Id { get; set; }
public string Name { get; set; } = "";
public string EmailAddress { get; set; } = "";
public string ImapHost { get; set; } = "";
public int ImapPort { get; set; } = 993;
public bool ImapUseSsl { get; set; } = true;
public string SmtpHost { get; set; } = "";
public int SmtpPort { get; set; } = 465;
public bool SmtpUseSsl { get; set; } = true;
public AuthType AuthType { get; set; } = AuthType.Password;
public string Username { get; set; } = "";
public string EncryptedSecret { get; set; } = "";
public string OAuth2Issuer { get; set; } = "";
public bool IsEnabled { get; set; } = true;
public DateTime? LastSyncAt { get; set; }
public ICollection<Folder> Folders { get; set; } = new List<Folder>();
}
public class Folder
{
public int Id { get; set; }
public int AccountId { get; set; }
public Account? Account { get; set; }
public string ImapName { get; set; } = "";
public FolderType Type { get; set; } = FolderType.Other;
public long LastUid { get; set; }
public long UidValidity { get; set; }
public DateTime? LastSyncAt { get; set; }
}
public class Message
{
public int Id { get; set; }
public int AccountId { get; set; }
public int FolderId { get; set; }
public Folder? Folder { get; set; }
public long Uid { get; set; }
public string MessageId { get; set; } = "";
public string Subject { get; set; } = "";
public string FromName { get; set; } = "";
public string FromAddress { get; set; } = "";
public string ToAddresses { get; set; } = "[]";
public DateTime? DateSent { get; set; }
public DateTime? DateReceived { get; set; }
public bool IsRead { get; set; }
public bool HasAttachments { get; set; }
public string Preview { get; set; } = "";
public long Size { get; set; }
public string RawPath { get; set; } = "";
public string AuthResults { get; set; } = "";
public AuthVerdict AuthVerdict { get; set; } = AuthVerdict.Unverified;
public string AuthSummary { get; set; } = "";
public ICollection<Attachment> Attachments { get; set; } = new List<Attachment>();
}
public class Attachment
{
public int Id { get; set; }
public int MessageId { get; set; }
public Message? Message { get; set; }
public string FileName { get; set; } = "";
public string ContentType { get; set; } = "";
public long Size { get; set; }
public string LocalPath { get; set; } = "";
}
public class Setting
{
public int Id { get; set; }
public string Category { get; set; } = "";
public string Key { get; set; } = "";
public string Value { get; set; } = "";
public bool IsEncrypted { get; set; }
public DateTime UpdatedAt { get; set; }
}
public class User
{
public int Id { get; set; }
public string Username { get; set; } = "";
public string PasswordHash { get; set; } = "";
public bool MustChangePassword { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? LastLoginAt { get; set; }
}
public class Contact
{
public int Id { get; set; }
public string Name { get; set; } = "";
public string EmailAddress { get; set; } = "";
public string Note { get; set; } = "";
public DateTime LastSeenAt { get; set; }
public bool IsFavorite { get; set; }
}