fix(options): relax EmailAccountsOptions properties from init-only to set

init-only properties cannot be mutated by Options configure delegates.
Switching to set allows the builder pattern to bind values post-construction.
Also narrows Accounts type from IEnumerable to List for index access.
This commit is contained in:
2026-11-02 15:01:56 +01:00
parent 51732fa9fc
commit 8e397d8119

View File

@@ -17,18 +17,18 @@ public class EmailAccountsOptions
/// <summary>
/// The list of configured email accounts.
/// </summary>
public required IEnumerable<EmailAccountModificationDto> Accounts { get; init; } = [];
public required List<EmailAccountModificationDto> Accounts { get; set; } = [];
/// <summary>
/// How often the IMAP sync worker polls for new emails, in seconds.
/// Defaults to 300 seconds (5 minutes).
/// </summary>
public int SyncIntervalSeconds { get; init; } = 300;
public int SyncIntervalSeconds { get; set; } = 300;
/// <summary>
/// The minimum interval, in seconds, between forced IMAP sync operations regardless of idle state.
/// Defaults to 30 seconds (0.5 minute).
/// </summary>
public int ForcedSyncIntervalSeconds { get; init; } = 30;
public int ForcedSyncIntervalSeconds { get; set; } = 30;
}
#endif