namespace Marathon.Domain.ValueObjects; /// /// Single source of truth for the Moscow timezone offset. /// /// /// /// marathonbet.by serves all timestamps in Moscow time (UTC+3) and the domain /// invariant on /// rejects any other offset. Code that constructs /// values for events, results, snapshots, or test fixtures MUST use this /// constant rather than re-deriving TimeSpan.FromHours(3). /// /// public static class MoscowTime { /// The Moscow time offset (UTC+3). public static readonly TimeSpan Offset = TimeSpan.FromHours(3); /// Current Moscow time. public static DateTimeOffset Now => DateTimeOffset.UtcNow.ToOffset(Offset); /// /// Returns the inclusive end-of-day for the given Moscow date — i.e., /// the moment one second before the next day starts. Used by date-range /// filters where the user picks "to: 2026-05-09" meaning "through the /// rest of that day." /// public static DateTimeOffset EndOfMoscowDay(DateOnly date) => new DateTimeOffset(date.ToDateTime(TimeOnly.MinValue), Offset) .AddDays(1).AddSeconds(-1); }