private List <ScheduleSettings> MapMarketSchedule(MarketSettings marketSettings, List <DayOfWeek> platformWeekends)
        {
            var result = MarketScheduleExtensions.MapHolidays(marketSettings.Id,
                                                              marketSettings.Name,
                                                              marketSettings.Holidays,
                                                              null);

            result.AddRange(MarketScheduleExtensions.MapWeekends(
                                marketSettings.Id,
                                marketSettings.Name,
                                platformWeekends,
                                null));

            var marketScheduleUtcRespectful = marketSettings.MarketSchedule.ShiftToUtc();

            result.AddRange(
                marketScheduleUtcRespectful.GetMarketHoursScheduleSettings(marketSettings.Id,
                                                                           marketSettings.Name,
                                                                           null));

            result.AddRange(
                marketScheduleUtcRespectful.HalfWorkingDays.GetScheduleSettings(marketSettings.Id,
                                                                                marketSettings.Name,
                                                                                null));

            return(result);
        }
        private IReadOnlyList <ScheduleSettings> MapPlatformSchedule(BrokerSettingsScheduleContract brokerSchedule)
        {
            var assetPairRegex = ".*";
            var platformId     = _platformSettings.PlatformMarketId;
            var marketName     = platformId;

            var result = MarketScheduleExtensions.MapHolidays(platformId,
                                                              marketName,
                                                              brokerSchedule.Holidays,
                                                              assetPairRegex);

            result.AddRange(MarketScheduleExtensions.MapWeekends(platformId,
                                                                 marketName,
                                                                 brokerSchedule.Weekends,
                                                                 assetPairRegex));

            result.Add(
                MarketScheduleExtensions.GetSingleSessionScheduleSettings(platformId,
                                                                          marketName,
                                                                          assetPairRegex,
                                                                          brokerSchedule.Open,
                                                                          brokerSchedule.Close));

            result.AddRange(
                brokerSchedule.PlatformSchedule.HalfWorkingDays.GetScheduleSettings(platformId,
                                                                                    marketName,
                                                                                    assetPairRegex));

            return(result);
        }