private ScheduleDay GetOrFillScheduleDay(GetRuleSettingsRequest request, TypiconEntity typicon,
                                                 ScheduleHandler handler, ScheduleDay scheduleDay = null)
        {
            //заполняем Правила и день Октоиха
            request.MenologyRule = typicon.GetMenologyRule(request.Date);

            int daysFromEaster = ruleSerializer.BookStorage.Easters.GetDaysFromCurrentEaster(request.Date);

            request.TriodionRule = typicon.GetTriodionRule(daysFromEaster);

            request.ModifiedRule = typicon.GetModifiedRuleHighestPriority(request.Date, ruleSerializer);
            request.OktoikhDay   = ruleSerializer.BookStorage.Oktoikh.Get(request.Date);

            //Формируем данные для обработки
            var settings = settingsFactory.Create(request);

            handler.Settings = settings;

            settings.Rule.GetRule(ruleSerializer).Interpret(handler);

            var container = handler.GetResult();

            if (scheduleDay == null)
            {
                //Sign sign = (settings.Rule is Sign s) ? s : GetTemplateSign(settings.Rule.Template);
                Sign sign = GetRootAdditionSign(settings);

                //Если settings.SignNumber определен в ModifiedRule, то назначаем его
                int signNumber = settings.SignNumber ?? (int)sign.Number;

                //if (request.Date.DayOfWeek == DayOfWeek.Sunday && sign.Priority > 3)
                //{
                //    //TODO: жесткая привязка к номеру знака воскресного дня
                //    signNumber = 8;// SignMigrator.GetOldId(k => k.Value.Name == "Воскресный день");
                //}

                scheduleDay = new ScheduleDay
                {
                    //задаем имя дню
                    Name       = nameComposer.Compose(settings, request.Date),
                    Date       = request.Date,
                    SignNumber = signNumber,
                    SignName   = sign.SignName[settings.Language.Name],
                };
            }

            //if (container != null)
            //{
            scheduleDay.Schedule.AddRange(container);
            //}

            return(scheduleDay);
        }
        private OutputDay GetOrFillScheduleDay(ScheduleDataCalculatorRequest request, ScheduleHandler handler, OutputDay scheduleDay = null)
        {
            //Формируем данные для обработки
            var response = dataCalculator.Calculate(request);

            var settings = response.Settings;

            handler.Settings = settings;

            settings.RuleContainer.Interpret(handler);

            var container = handler.GetResult();

            if (scheduleDay == null)
            {
                //Sign sign = (settings.Rule is Sign s) ? s : GetTemplateSign(settings.Rule.Template);
                var sign = GetPredefinedTemplate(response.Rule.Template);

                //Если settings.SignNumber определен в ModifiedRule, то назначаем его
                int signNumber = settings.SignNumber ?? sign.Number.Value;

                scheduleDay = new OutputDay
                {
                    //задаем имя дню
                    Name           = nameComposer.Compose(request.Date, response.Rule.Template.Priority, settings.AllWorships),
                    Date           = request.Date,
                    PredefinedSign = sign
                };
            }

            //if (container != null)
            //{
            scheduleDay.Worships.AddRange(container);
            //}

            return(scheduleDay);
        }