fix: serialize smtp settings using runtime type not base class

JsonSerializer.Serialize(p.Settings) uses the compile-time type
EmailChannelSettings, producing only {EmailChannelType:1} in the DB.
Use p.Settings.GetType() to force runtime type so all SmtpChannelSettings
properties (Host, Port, Username, Password, etc.) are actually persisted.

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Anatolii Grynchuk
2026-05-02 03:32:50 +03:00
parent c2ad3c7f3e
commit 349a5ac560
@@ -89,7 +89,7 @@ internal sealed class EmailChannelRepository : EfRepository<EmailChannelEntity>,
ServiceName = p.ServiceName,
Priority = p.Priority,
EmailChannelType = p.EmailChannelType,
SettingsJson = JsonSerializer.Serialize(p.Settings),
SettingsJson = JsonSerializer.Serialize(p.Settings, p.Settings.GetType()),
DailyLimit = p.DailyLimit,
MonthlyLimit = p.MonthlyLimit,
WarnThresholdPercent = p.WarnThresholdPercent,