Отвечай на вопросы, используя следующий контекст:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by IRIS.Designer.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using iRIS.Framework.Workflow.Process;
using iRIS.Framework.Workflow.Process.AuthorizationModel;
using iRIS.Framework.Workflow.Process.CustomProcessModel;
using iRIS.Framework.Workflow.Process.Data;
using iRIS.Framework.Workflow.UserData;

namespace iRIS.KaskoLink2.Generated.Processes.DiKaskoInsuranceResumeProcess.Draft
{
    public class DiKaskoInsuranceResumeProcess : ResumeProcessModel
    {
        public const string ExitPoint_DiKaskoConstructor = "DiKaskoConstructorStep";
        public const string ExitPoint_DiKaskoUrm = "DiKaskoUrmStep";
        public const string ExitPoint_DiKaskoPreInsuranceCheckStatuses = "DiKaskoPreInsuranceCheckStatuses";
        public const string ExitPoint_DiKaskoSuccessfulBuyEPolicy = "DiKaskoSuccessfulBuyEPolicyStep";
        public const string ExitPoint_DiKaskoSuccessfulBuy = "DiKaskoSuccessfulBuyStep";
        public const string ExitPoint_exit = "";
        public const string ExitPoint_DiKaskoSegmentation = "DiKaskoSegmentationStep";
        public const string ExitPoint_DiKaskoPolicyLayout = "DiKaskoPolicyLayoutStep";
        public const string ExitPoint_DiKaskoExecutionCompleted = "DiKaskoExecutionCompletedStep";
        public const string ExitPoint_DiKaskoPSO = "DiKaskoPSOStep";
        public const string ExitPoint_PreliminaryInsuranceInspectionNavigationPoint = "PreliminaryInsuranceInspectionNavigationPoint";
        public const string ExitPoint_ShedulerCallbackStatusUrmPsoNavigationPoint = "ShedulerCallbackStatusUrmPsoNavigationPoint";
        public const string ExitPoint_SchedulerCallbackInspectionSendToOssNavigationPoint = "ShedulerCallbackInspectionSendToOssNavigationPoint";
        public const string ExitPoint_DiKaskoQuestionnaire = "DiKaskoQuestionnaireStep";
        public const string ExitPoint_DiKaskoNoSuitablePackage = "DiKaskoNoSuitablePackageStep";
        public const string ExitPoint_UnderwriterApprovalProcessNavigationPoint = "UnderwriterApprovalProcessNavigationPoint";
        public const string ExitPoint_AutoCostNotInLimitsError = "Ошибка";
        public const string ExitPoint_Link2KaskoOtaCheckStep = "Link2KaskoOtaCheckStep_NavigationPoint";
        public const string ExitPoint_CheckPaymentFormProcess = "CheckPaymentForm";

        private readonly VersionPublisherModel _saveDraftBeforeSiebelExportBasketByCallCenter;
        private readonly NestedProcessModel _diKaskoSupportToolsProcess;
        private readonly ExitPointModel _diKaskoConstructor;
        private readonly ConditionModel _checkDoubledStatusForDelivery;
        private readonly ConditionModel _sendToUnderwriterApprovalAction;
        private readonly ConditionModel _checkBasketIsRegisteredCondition;
        private readonly ConditionModel _checkStatusDealForClient1;
        private readonly ConditionModel _isLink2AgentWithConstructor;
        private readonly ConditionModel _checkBasketStatusRegistrationAndDealStatusProcessing;
        private readonly ConditionModel _isClearOsagoProlongation;
        private readonly ExitPointModel _diKaskoUrm;
        private readonly NestedProcessModel _diKaskoResumeFormSelectingProcess;
        private readonly ConditionModel _checkStatusDealForClient6;
        private readonly ConditionModel _checkStatusDealForClient7;
        private readonly ConditionModel _checkStatusDealWhenViewAppSchedulerHook;
        private readonly ConditionModel _noSelectedProposalInKaskoDeal;
        private readonly ExitPointModel _diKaskoPreInsuranceCheckStatuses;
        private readonly ConditionModel _isUrmSettingOn;
        private readonly ExitPointModel _diKaskoSuccessfulBuyEPolicy;
        private readonly ExitPointModel _diKaskoSuccessfulBuy;
        private readonly NestedProcessModel _exportBasketWithCommandCalculateCallCenter;
        private readonly CustomProcessModel _checkUrmIncrease;
        private readonly ConditionModel _isDealCanBeCalculated;
        private readonly ConditionModel _kaskoDeliveryWayCodeEmailCondition;
        private readonly ExitPointModel _exit;
        private readonly CustomProcessModel _initializeVersionAutoDictionaryClientProcess;
        private readonly ProcedureModel _fillBasketDealsIndicatorSegments;
        private readonly ProcedureModel _changeURMApprovalStatusCode;
        private readonly ExitPointModel _diKaskoSegmentation;
        private readonly ExitPointModel _diKaskoPolicyLayout;
        private readonly ConditionModel _checkStatusDealForClient8;
        private readonly ConditionModel _checkDealHasDIUnderwriterApprovals;
        private readonly ConditionModel _checkStatusDealForClient4;
        private readonly CustomProcessModel _currentUserCheckGroupsOnStart;
        private readonly ExitPointModel _diKaskoExecutionCompleted;
        private readonly ConditionModel _isAutoCostInAcceptedLimits;
        private readonly NestedProcessModel _diKaskoProlongCoefsUpdateProcess;
        private readonly ExitPointModel _diKaskoPSO;
        private readonly ConditionModel _checkStatusDealForClient5;
        private readonly ConditionModel _checkIfProcessRestoredFromSchedulerByWebHook;
        private readonly ExitPointModel _preliminaryInsuranceInspectionNavigationPoint;
        private readonly ConditionModel _checkShedulerCallbackStatusUrmPso;
        private readonly ExitPointModel _shedulerCallbackStatusUrmPsoNavigationPoint;
        private readonly NestedProcessModel _linkAuthorizedUserToBasket;
        private readonly ConditionModel _checkStatusDealForClient2;
        private readonly ProcedureModel _createDIUnderwriterApprovals;
        private readonly ConditionModel _checkStatusDealForCallCenter1;
        private readonly FormDataModel _showInfoDiUnderwriterApprovalsEmpty;
        private readonly ConditionModel _checkSchedulerCallbackWebHookSendToOss;
        private readonly ExitPointModel _schedulerCallbackInspectionSendToOssNavigationPoint;
        private readonly ConditionModel _checkStatusDealForCallCenter3;
        private readonly ConditionModel _checkStatusDealForCallCenter2;
        private readonly ConditionModel _checkStatusDealForClient3;
        private readonly ExitPointModel _diKaskoQuestionnaire;
        private readonly ExitPointModel _diKaskoNoSuitablePackage;
        private readonly ProcedureModel _selectConstructorProposal;
        private readonly ConditionModel _checkStatusDealForClient9;
        private readonly ConditionModel _checkStatusDealForDelivery;
        private readonly ConditionModel _isClearOsagoProlongation2;
        private readonly ExpressionRunnerModel _setDeliveryDateECrossBasket;
        private readonly ConditionModel _checkStatusInWorkForClient0;
        private readonly NestedProcessModel _diKaskoSchedulerSendToOssProcess;
        private readonly ExitPointModel _underwriterApprovalProcessNavigationPoint;
        private readonly CustomProcessModel _checkPsoInspectionStatus;
        private readonly ConditionModel _checkURMApprovalStatusInWork;
        private readonly FormDataModel _autoCostNotInLimitsAlert;
        private readonly ExitPointModel _autoCostNotInLimitsError;
        private readonly ExpressionRunnerModel _setOsagoDealEPolicy;
        private readonly ConditionModel _checkIsEPolicyInExecutionCompleted;
        private readonly ConditionModel _checkManualUnderwriterApproval;
        private readonly ProcedureModel _getEmailSentFlag;
        private readonly ConditionModel _checkStatusOsagoDeal;
        private readonly ConditionModel _checkOtaApprovalStatus;
        private readonly ExitPointModel _link2KaskoOtaCheckStep;
        private readonly ExitPointModel _checkPaymentFormProcess;
        private readonly NestedProcessModel _checkBasketPaymentForClient;

        public DiKaskoInsuranceResumeProcess()
        {
            _saveDraftBeforeSiebelExportBasketByCallCenter = new VersionPublisherModel();
            _diKaskoSupportToolsProcess = new NestedProcessModel();
            _diKaskoConstructor = new ExitPointModel();
            _checkDoubledStatusForDelivery = new ConditionModel();
            _sendToUnderwriterApprovalAction = new ConditionModel();
            _checkBasketIsRegisteredCondition = new ConditionModel();
            _checkStatusDealForClient1 = new ConditionModel();
            _isLink2AgentWithConstructor = new ConditionModel();
            _checkBasketStatusRegistrationAndDealStatusProcessing = new ConditionModel();
            _isClearOsagoProlongation = new ConditionModel();
            _diKaskoUrm = new ExitPointModel();
            _diKaskoResumeFormSelectingProcess = new NestedProcessModel();
            _checkStatusDealForClient6 = new ConditionModel();
            _checkStatusDealForClient7 = new ConditionModel();
            _checkStatusDealWhenViewAppSchedulerHook = new ConditionModel();
            _noSelectedProposalInKaskoDeal = new ConditionModel();
            _diKaskoPreInsuranceCheckStatuses = new ExitPointModel();
            _isUrmSettingOn = new ConditionModel();
            _diKaskoSuccessfulBuyEPolicy = new ExitPointModel();
            _diKaskoSuccessfulBuy = new ExitPointModel();
            _exportBasketWithCommandCalculateCallCenter = new NestedProcessModel();
            _checkUrmIncrease = new CustomProcessModel();
            _isDealCanBeCalculated = new ConditionModel();
            _kaskoDeliveryWayCodeEmailCondition = new ConditionModel();
            _exit = new ExitPointModel();
            _initializeVersionAutoDictionaryClientProcess = new CustomProcessModel();
            _fillBasketDealsIndicatorSegments = new ProcedureModel();
            _changeURMApprovalStatusCode = new ProcedureModel();
            _diKaskoSegmentation = new ExitPointModel();
            _diKaskoPolicyLayout = new ExitPointModel();
            _checkStatusDealForClient8 = new ConditionModel();
            _checkDealHasDIUnderwriterApprovals = new ConditionModel();
            _checkStatusDealForClient4 = new ConditionModel();
            _currentUserCheckGroupsOnStart = new CustomProcessModel();
            _diKaskoExecutionCompleted = new ExitPointModel();
            _isAutoCostInAcceptedLimits = new ConditionModel();
            _diKaskoProlongCoefsUpdateProcess = new NestedProcessModel();
            _diKaskoPSO = new ExitPointModel();
            _checkStatusDealForClient5 = new ConditionModel();
            _checkIfProcessRestoredFromSchedulerByWebHook = new ConditionModel();
            _preliminaryInsuranceInspectionNavigationPoint = new ExitPointModel();
            _checkShedulerCallbackStatusUrmPso = new ConditionModel();
            _shedulerCallbackStatusUrmPsoNavigationPoint = new ExitPointModel();
            _linkAuthorizedUserToBasket = new NestedProcessModel();
            _checkStatusDealForClient2 = new ConditionModel();
            _createDIUnderwriterApprovals = new ProcedureModel();
            _checkStatusDealForCallCenter1 = new ConditionModel();
            _showInfoDiUnderwriterApprovalsEmpty = new FormDataModel();
            _checkSchedulerCallbackWebHookSendToOss = new ConditionModel();
            _schedulerCallbackInspectionSendToOssNavigationPoint = new ExitPointModel();
            _checkStatusDealForCallCenter3 = new ConditionModel();
            _checkStatusDealForCallCenter2 = new ConditionModel();
            _checkStatusDealForClient3 = new ConditionModel();
            _diKaskoQuestionnaire = new ExitPointModel();
            _diKaskoNoSuitablePackage = new ExitPointModel();
            _selectConstructorProposal = new ProcedureModel();
            _checkStatusDealForClient9 = new ConditionModel();
            _checkStatusDealForDelivery = new ConditionModel();
            _isClearOsagoProlongation2 = new ConditionModel();
            _setDeliveryDateECrossBasket = new ExpressionRunnerModel();
            _checkStatusInWorkForClient0 = new ConditionModel();
            _diKaskoSchedulerSendToOssProcess = new NestedProcessModel();
            _underwriterApprovalProcessNavigationPoint = new ExitPointModel();
            _checkPsoInspectionStatus = new CustomProcessModel();
            _checkURMApprovalStatusInWork = new ConditionModel();
            _autoCostNotInLimitsAlert = new FormDataModel();
            _autoCostNotInLimitsError = new ExitPointModel();
            _setOsagoDealEPolicy = new ExpressionRunnerModel();
            _checkIsEPolicyInExecutionCompleted = new ConditionModel();
            _checkManualUnderwriterApproval = new ConditionModel();
            _getEmailSentFlag = new ProcedureModel();
            _checkStatusOsagoDeal = new ConditionModel();
            _checkOtaApprovalStatus = new ConditionModel();
            _link2KaskoOtaCheckStep = new ExitPointModel();
            _checkPaymentFormProcess = new ExitPointModel();
            _checkBasketPaymentForClient = new NestedProcessModel();

            InitializeDiKaskoInsuranceResumeProcess(this);

            InitializeSaveDraftBeforeSiebelExportBasketByCallCenter(_saveDraftBeforeSiebelExportBasketByCallCenter);
            InitializeDiKaskoSupportToolsProcess(_diKaskoSupportToolsProcess);
            InitializeDiKaskoConstructor(_diKaskoConstructor);
            InitializeCheckDoubledStatusForDelivery(_checkDoubledStatusForDelivery);
            InitializeSendToUnderwriterApprovalAction(_sendToUnderwriterApprovalAction);
            InitializeCheckBasketIsRegisteredCondition(_checkBasketIsRegisteredCondition);
            InitializeCheckStatusDealForClient1(_checkStatusDealForClient1);
            InitializeIsLink2AgentWithConstructor(_isLink2AgentWithConstructor);
            InitializeCheckBasketStatusRegistrationAndDealStatusProcessing(_checkBasketStatusRegistrationAndDealStatusProcessing);
            InitializeIsClearOsagoProlongation(_isClearOsagoProlongation);
            InitializeDiKaskoUrm(_diKaskoUrm);
            InitializeDiKaskoResumeFormSelectingProcess(_diKaskoResumeFormSelectingProcess);
            InitializeCheckStatusDealForClient6(_checkStatusDealForClient6);
            InitializeCheckStatusDealForClient7(_checkStatusDealForClient7);
            InitializeCheckStatusDealWhenViewAppSchedulerHook(_checkStatusDealWhenViewAppSchedulerHook);
            InitializeNoSelectedProposalInKaskoDeal(_noSelectedProposalInKaskoDeal);
            InitializeDiKaskoPreInsuranceCheckStatuses(_diKaskoPreInsuranceCheckStatuses);
            InitializeIsUrmSettingOn(_isUrmSettingOn);
            InitializeDiKaskoSuccessfulBuyEPolicy(_diKaskoSuccessfulBuyEPolicy);
            InitializeDiKaskoSuccessfulBuy(_diKaskoSuccessfulBuy);
            InitializeExportBasketWithCommandCalculateCallCenter(_exportBasketWithCommandCalculateCallCenter);
            InitializeCheckUrmIncrease(_checkUrmIncrease);
            InitializeIsDealCanBeCalculated(_isDealCanBeCalculated);
            InitializeKaskoDeliveryWayCodeEmailCondition(_kaskoDeliveryWayCodeEmailCondition);
            Initializeexit(_exit);
            InitializeInitializeVersionAutoDictionaryClientProcess(_initializeVersionAutoDictionaryClientProcess);
            InitializeFillBasketDealsIndicatorSegments(_fillBasketDealsIndicatorSegments);
            InitializechangeURMApprovalStatusCode(_changeURMApprovalStatusCode);
            InitializeDiKaskoSegmentation(_diKaskoSegmentation);
            InitializeDiKaskoPolicyLayout(_diKaskoPolicyLayout);
            InitializeCheckStatusDealForClient8(_checkStatusDealForClient8);
            InitializeCheckDealHasDIUnderwriterApprovals(_checkDealHasDIUnderwriterApprovals);
            InitializeCheckStatusDealForClient4(_checkStatusDealForClient4);
            InitializeCurrentUserCheckGroupsOnStart(_currentUserCheckGroupsOnStart);
            InitializeDiKaskoExecutionCompleted(_diKaskoExecutionCompleted);
            InitializeIsAutoCostInAcceptedLimits(_isAutoCostInAcceptedLimits);
            InitializeDiKaskoProlongCoefsUpdateProcess(_diKaskoProlongCoefsUpdateProcess);
            InitializeDiKaskoPSO(_diKaskoPSO);
            InitializeCheckStatusDealForClient5(_checkStatusDealForClient5);
            InitializeCheckIfProcessRestoredFromSchedulerByWebHook(_checkIfProcessRestoredFromSchedulerByWebHook);
            InitializePreliminaryInsuranceInspectionNavigationPoint(_preliminaryInsuranceInspectionNavigationPoint);
            InitializeCheckShedulerCallbackStatusUrmPso(_checkShedulerCallbackStatusUrmPso);
            InitializeShedulerCallbackStatusUrmPsoNavigationPoint(_shedulerCallbackStatusUrmPsoNavigationPoint);
            InitializeLinkAuthorizedUserToBasket(_linkAuthorizedUserToBasket);
            InitializeCheckStatusDealForClient2(_checkStatusDealForClient2);
            InitializeCreateDIUnderwriterApprovals(_createDIUnderwriterApprovals);
            InitializeCheckStatusDealForCallCenter1(_checkStatusDealForCallCenter1);
            InitializeShowInfoDiUnderwriterApprovalsEmpty(_showInfoDiUnderwriterApprovalsEmpty);
            InitializeCheckSchedulerCallbackWebHookSendToOss(_checkSchedulerCallbackWebHookSendToOss);
            InitializeSchedulerCallbackInspectionSendToOssNavigationPoint(_schedulerCallbackInspectionSendToOssNavigationPoint);
            InitializeCheckStatusDealForCallCenter3(_checkStatusDealForCallCenter3);
            InitializeCheckStatusDealForCallCenter2(_checkStatusDealForCallCenter2);
            InitializeCheckStatusDealForClient3(_checkStatusDealForClient3);
            InitializeDiKaskoQuestionnaire(_diKaskoQuestionnaire);
            InitializeDiKaskoNoSuitablePackage(_diKaskoNoSuitablePackage);
            InitializeSelectConstructorProposal(_selectConstructorProposal);
            InitializeCheckStatusDealForClient9(_checkStatusDealForClient9);
            InitializeCheckStatusDealForDelivery(_checkStatusDealForDelivery);
            InitializeIsClearOsagoProlongation2(_isClearOsagoProlongation2);
            InitializeSetDeliveryDateECrossBasket(_setDeliveryDateECrossBasket);
            InitializeCheckStatusInWorkForClient0(_checkStatusInWorkForClient0);
            InitializeDiKaskoSchedulerSendToOssProcess(_diKaskoSchedulerSendToOssProcess);
            InitializeUnderwriterApprovalProcessNavigationPoint(_underwriterApprovalProcessNavigationPoint);
            InitializeCheckPsoInspectionStatus(_checkPsoInspectionStatus);
            InitializeCheckURMApprovalStatusInWork(_checkURMApprovalStatusInWork);
            InitializeAutoCostNotInLimitsAlert(_autoCostNotInLimitsAlert);
            InitializeAutoCostNotInLimitsError(_autoCostNotInLimitsError);
            InitializeSetOsagoDealEPolicy(_setOsagoDealEPolicy);
            InitializeCheckIsEPolicyInExecutionCompleted(_checkIsEPolicyInExecutionCompleted);
            InitializeCheckManualUnderwriterApproval(_checkManualUnderwriterApproval);
            InitializeGetEmailSentFlag(_getEmailSentFlag);
            InitializeCheckStatusOsagoDeal(_checkStatusOsagoDeal);
            InitializeCheckOtaApprovalStatus(_checkOtaApprovalStatus);
            InitializeLink2KaskoOtaCheckStep(_link2KaskoOtaCheckStep);
            InitializeCheckPaymentFormProcess(_checkPaymentFormProcess);
            InitializeCheckBasketPaymentForClient(_checkBasketPaymentForClient);
        }

        private void InitializeDiKaskoInsuranceResumeProcess(FlowProcessModel model)
        {
            model.Identifier = "DiKaskoInsuranceResumeProcess";
            model.Name = "Возобновление процесса КАСКО";
            model.Description = @"Возобновление процесса КАСКО";
            model.Version = "Draft";
            model.IsPrivate = true;
            model.ProcessResumeAccessRules = new List<FlowProcessSecurity>();
            model.ProcessStartAccessRules = new List<FlowProcessSecurity>();
            model.VariableModelInfoList = new List<ProcessVariableDefinition>();
            model.VariableModelInfoList.Add(new ProcessVariableDefinition
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Direction = Direction.In,
                IsMainRootVariable = false,
                InitializeFromExtension = true,
                IsLocalVariable = false,
                IsOptional = false
            });
            model.Start = _initializeVersionAutoDictionaryClientProcess;
            model.NavigationStartPoints = new List<NavigationStartModel>();
        }

        private void InitializeSaveDraftBeforeSiebelExportBasketByCallCenter(VersionPublisherModel model)
        {
            model.Identifier = "SaveDraftBeforeSiebelExportBasketByCallCenter";
            model.Name = "F1. Публикация версии";
            model.Description = @"F1. Публикация версии";
            model.VersionAction = VersionAction.SaveDraft;
            model.RelationType = RelationType.Draft;
            model.NextStep = _exportBasketWithCommandCalculateCallCenter;
            model.ExceptionNextStep = null;
        }

        private void InitializeDiKaskoSupportToolsProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoSupportToolsProcess";
            model.Name = "DiKasko инструменты поддержки";
            model.Description = @"DiKasko инструменты поддержки";
            model.FlowProcessIdentifier = "DiKaskoSupportToolsProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Полис отправлен в OSS",
                NextStep = _exit,
            });
        }

        private void InitializeDiKaskoConstructor(ExitPointModel model)
        {
            model.Identifier = "DiKaskoConstructor";
            model.Name = "DiKaskoConstructorStep";
            model.Description = @"Выход на форму DiKaskoConstructorForm";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeCheckDoubledStatusForDelivery(ConditionModel model)
        {
            model.Identifier = "CheckDoubledStatusForDelivery";
            model.Name = "В корзине есть сделка со статусом Doubled";
            model.Description = @"В корзине есть сделка со статусом Doubled";
            model.Default = _checkStatusDealForDelivery;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode === 'Doubled') { flag = true; break; } } flag;",
                NextStep = _diKaskoExecutionCompleted,
            });
        }

        private void InitializeSendToUnderwriterApprovalAction(ConditionModel model)
        {
            model.Identifier = "SendToUnderwriterApprovalAction";
            model.Name = "Вызвано действие \"Отправить запрос в андеррайтинг\"";
            model.Description = string.Empty;
            model.Default = _checkManualUnderwriterApproval;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"SharedData.ProcessApiCommandName == 'DiKaskoSendToUnderwriterApproval'",
                NextStep = _createDIUnderwriterApprovals,
            });
        }

        private void InitializeCheckBasketIsRegisteredCondition(ConditionModel model)
        {
            model.Identifier = "CheckBasketIsRegisteredCondition";
            model.Name = "В корзине есть платеж в статусе 'Special' или 'Paid'  И Статус корзины == 'Оформлено'";
            model.Description = @"В корзине есть платеж в статусе 'Special' или 'Paid'  И Статус корзины == 'Оформлено'";
            model.Default = _checkPaymentFormProcess;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false;
                                            for (var i = 0; i < Basket.Payments.Count; i++) {
                                                if ((Basket.Payments[i].StatusCode == 'Special' || Basket.Payments[i].StatusCode == 'Paid')
                                                    && Basket.BasketStatusCode == 'Registration') {
                                                    flag = true;
                                                }
                                            } flag",
                NextStep = _diKaskoSuccessfulBuyEPolicy,
            });
        }

        private void InitializeCheckStatusDealForClient1(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient1";
            model.Name = "В корзине есть сделка со статусом Segmentation";
            model.Description = @"В корзине есть сделка со статусом Segmentation";
            model.Default = _checkStatusDealForClient2;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].DealStatusCode == 'Segmentation' && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _isClearOsagoProlongation,
            });
        }

        private void InitializeIsLink2AgentWithConstructor(ConditionModel model)
        {
            model.Identifier = "IsLink2AgentWithConstructor";
            model.Name = "Доступен ли Link2 агенту конструктор";
            model.Description = string.Empty;
            model.Default = _checkStatusInWorkForClient0;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"SharedData.UseIrisConstructorForLink2 == 'true'",
                NextStep = _fillBasketDealsIndicatorSegments,
            });
        }

        private void InitializeCheckBasketStatusRegistrationAndDealStatusProcessing(ConditionModel model)
        {
            model.Identifier = "CheckBasketStatusRegistrationAndDealStatusProcessing";
            model.Name = "Статус корзины Registration, а статус сделки Processing?";
            model.Description = @"В корзине есть сделка со статусом InWork";
            model.Default = _sendToUnderwriterApprovalAction;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Registration And Processing",
                Expression = @"var flag = false;
        var array = ['Processing'];

        if (IsProcessApiRequest) {
        	if (Basket.BasketStatusCode === 'Registration') {
        		for(var i=0;i<Basket.Deals.Count;i++) { 
        			if(Basket.Deals[i].IsInBasket === true && array.indexOf(Basket.Deals[i].DealStatusCode) >= 0 && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { 
        				flag = true; 
        				break; 
        			} 
        		}
        	}
        }

        flag;",
                NextStep = _shedulerCallbackStatusUrmPsoNavigationPoint,
            });
        }

        private void InitializeIsClearOsagoProlongation(ConditionModel model)
        {
            model.Identifier = "IsClearOsagoProlongation";
            model.Name = "Пролонгация чистого ОСАГО";
            model.Description = @"Пролонгация чистого ОСАГО";
            model.Default = _diKaskoSegmentation;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var result = false; var dealsInBasket = 0; for(var i = 0; i < Basket.Deals.Count; i++) {if(Basket.Deals[i].IsInBasket==true){dealsInBasket = dealsInBasket + 1;}}if(dealsInBasket == 1){ for(var i = 0; i < Basket.Deals.Count; i++) { if((Basket.Deals[i].Product.ProductDictCode == 'OSAGO' || Basket.Deals[i].Product.ProductDictCode == 'eOSAGO') && Basket.Deals[i].IsInBasket == true && Basket.Deals[i].IsProlongation == true && !IsProcessApiRequest) { result = true; }}} result",
                NextStep = _checkStatusOsagoDeal,
            });
        }

        private void InitializeDiKaskoUrm(ExitPointModel model)
        {
            model.Identifier = "DiKaskoUrm";
            model.Name = "DiKaskoUrmStep";
            model.Description = string.Empty;
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeDiKaskoResumeFormSelectingProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoResumeFormSelectingProcess";
            model.Name = "Выбор формы для восстановления";
            model.Description = @"Выбор формы для восстановления";
            model.FlowProcessIdentifier = "DiKaskoResumeFormSelectingProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "AutoSupportToolsExit",
                NextStep = _diKaskoSupportToolsProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "CheckPaymentFormProcessStep",
                NextStep = _checkPaymentFormProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DefaultExit",
                NextStep = _exit,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DiKaskoConstructorStep",
                NextStep = _diKaskoConstructor,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DiKaskoExecutionCompletedStep",
                NextStep = _diKaskoExecutionCompleted,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DiKaskoNoSuitablePackageStep",
                NextStep = _diKaskoNoSuitablePackage,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DiKaskoPolicyLayoutStep",
                NextStep = _diKaskoPolicyLayout,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DiKaskoQuestionnaireStep",
                NextStep = _diKaskoQuestionnaire,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DiKaskoSegmentationStep",
                NextStep = _diKaskoSegmentation,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DiKaskoSuccessfulBuyEPolicyStep",
                NextStep = _diKaskoSuccessfulBuyEPolicy,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DiKaskoSuccessfulBuyStep",
                NextStep = _diKaskoSuccessfulBuy,
            });
        }

        private void InitializeCheckStatusDealForClient6(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient6";
            model.Name = "В корзине есть сделка со статусом ReadyForSign";
            model.Description = @"В корзине есть сделка со статусом ReadyForSign";
            model.Default = _checkStatusDealForClient7;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode == 'ReadyForSign' && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _checkBasketPaymentForClient,
            });
        }

        private void InitializeCheckStatusDealForClient7(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient7";
            model.Name = "В корзине есть сделка со статусом PolicyIssued";
            model.Description = @"В корзине есть сделка со статусом PolicyIssued";
            model.Default = null;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode == 'PolicyIssued' && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoSuccessfulBuyEPolicy,
            });
        }

        private void InitializeCheckStatusDealWhenViewAppSchedulerHook(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealWhenViewAppSchedulerHook";
            model.Name = "В корзине есть сделка со статусом Processing";
            model.Description = @"В корзине есть сделка со статусом Processing или OfferTerminated";
            model.Default = _diKaskoPolicyLayout;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Processing",
                Expression = @"var flag = false;var array = ['Processing']; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && array.indexOf(Basket.Deals[i].DealStatusCode) >= 0 && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _shedulerCallbackStatusUrmPsoNavigationPoint,
            });
        }

        private void InitializeNoSelectedProposalInKaskoDeal(ConditionModel model)
        {
            model.Identifier = "NoSelectedProposalInKaskoDeal";
            model.Name = "В сделке нет выбранного предложения";
            model.Description = @"В сделке нет выбранного предложения";
            model.Default = _checkStatusDealForCallCenter2;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"DiKaskoExternalFunctionsInvoker.NoSelectedProposalInKaskoDeal(Basket);",
                NextStep = _selectConstructorProposal,
            });
        }

        private void InitializeDiKaskoPreInsuranceCheckStatuses(ExitPointModel model)
        {
            model.Identifier = "DiKaskoPreInsuranceCheckStatuses";
            model.Name = "DiKaskoPreInsuranceCheckStatuses";
            model.Description = @"Выход на форму DiKaskoPreInsuranceCheckStatusesForm";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeIsUrmSettingOn(ConditionModel model)
        {
            model.Identifier = "IsUrmSettingOn";
            model.Name = "Настройка УРМ включена?";
            model.Description = string.Empty;
            model.Default = _checkUrmIncrease;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"DiKaskoExternalFunctionsInvoker.IsUrmSettingOn(SharedData.integrationLogin)",
                NextStep = _changeURMApprovalStatusCode,
            });
        }

        private void InitializeDiKaskoSuccessfulBuyEPolicy(ExitPointModel model)
        {
            model.Identifier = "DiKaskoSuccessfulBuyEPolicy";
            model.Name = "DiKaskoSuccessfulBuyEPolicyStep";
            model.Description = @"Выход на форму успешной покупки e-полиса";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeDiKaskoSuccessfulBuy(ExitPointModel model)
        {
            model.Identifier = "DiKaskoSuccessfulBuy";
            model.Name = "DiKaskoSuccessfulBuyStep";
            model.Description = @"Выход на форму DiKaskoSuccessfulBuyForm";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeExportBasketWithCommandCalculateCallCenter(NestedProcessModel model)
        {
            model.Identifier = "ExportBasketWithCommandCalculateCallCenter";
            model.Name = "Отправка корзины в Siebel c командой Calculate для КЦ";
            model.Description = @"Отправка корзины в Siebel c командой Calculate для КЦ";
            model.FlowProcessIdentifier = "DiKaskoExportBasketSiebelProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Command",
                ExpressionType = typeof(string).AssemblyQualifiedName,
                InExpression = @"'Calculate'",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Процесс завершен",
                NextStep = _checkStatusDealForCallCenter2,
            });
        }

        private void InitializeCheckUrmIncrease(CustomProcessModel model)
        {
            model.Identifier = "CheckUrmIncrease";
            model.Name = "Проверка необходимости перерасчета КЦ";
            model.Description = @"Проверка необходимости перерасчета КЦ после применения повышающего к-та УРМ";
            model.Title = "Проверка необходимости перерасчета КЦ";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.KaskoCheckUrmIncreaseCustomProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _diKaskoProlongCoefsUpdateProcess;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AuthorizationData",
                TypeName = typeof(iRIS.Framework.Workflow.UserData.AuthorizationData).AssemblyQualifiedName,
                Expression = @"AuthorizationData",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "UrmIncreaseFlag",
                NextStep = _diKaskoConstructor,
            });
        }

        private void InitializeIsDealCanBeCalculated(ConditionModel model)
        {
            model.Identifier = "IsDealCanBeCalculated";
            model.Name = "Заполнены все данные для расчета";
            model.Description = @"Заполнены все данные для расчета";
            model.Default = _diKaskoSegmentation;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Заполнены",
                Expression = @"DiKaskoExternalFunctionsInvoker.IsDealCanBeCalculated(Basket);",
                NextStep = _noSelectedProposalInKaskoDeal,
            });
        }

        private void InitializeKaskoDeliveryWayCodeEmailCondition(ConditionModel model)
        {
            model.Identifier = "KaskoDeliveryWayCodeEmailCondition";
            model.Name = "Проверка способа доставки";
            model.Description = @"Проверка способа доставки";
            model.Default = _checkStatusDealForClient4;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Доставка по Email",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].Product.ProductDictCode === 'KASKO' && Basket.Deals[i].Deliveries.Count > 0 && Basket.Deals[i].Deliveries[0].DeliveryWayCode === 'Email') { flag = true; break; } } flag;",
                NextStep = _checkStatusDealForClient5,
            });
        }

        private void Initializeexit(ExitPointModel model)
        {
            model.Identifier = "exit";
            model.Name = string.Empty;
            model.Description = @"пустой выход";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeInitializeVersionAutoDictionaryClientProcess(CustomProcessModel model)
        {
            model.Identifier = "InitializeVersionAutoDictionaryClientProcess";
            model.Name = "Инициализация версии фильтрации справочников авто";
            model.Description = @"Инициализация версии фильтрации справочников авто";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.InitializeVersionAutoDictionaryClientProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _currentUserCheckGroupsOnStart;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AuthorizationData",
                TypeName = typeof(iRIS.Framework.Workflow.UserData.AuthorizationData).AssemblyQualifiedName,
                Expression = @"AuthorizationData",
            });
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "IsCreateProcess",
                TypeName = typeof(bool).AssemblyQualifiedName,
                Expression = @"false",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
        }

        private void InitializeFillBasketDealsIndicatorSegments(ProcedureModel model)
        {
            model.Identifier = "FillBasketDealsIndicatorSegments";
            model.Name = "Заполнение сегментов типа Индикатор в сделке";
            model.Description = @"Заполнение сегментов типа Индикатор в сделке";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _isUrmSettingOn;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.InsuranceCore.Code.InsuranceCoreProcedures.FillIndicatorSegmentsInDeal),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "authorizationData",
                        TypeName = typeof(iRIS.Framework.Workflow.UserData.AuthorizationData).AssemblyQualifiedName,
                        Expression = @"AuthorizationData",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializechangeURMApprovalStatusCode(ProcedureModel model)
        {
            model.Identifier = "changeURMApprovalStatusCode";
            model.Name = "Меняем URMApprovalStatusCode";
            model.Description = @"Меняем URMApprovalStatusCode";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _checkUrmIncrease;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetURMApprovalStatus),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "sendMailOPKKK",
                        TypeName = typeof(bool).AssemblyQualifiedName,
                        Expression = @"false",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeDiKaskoSegmentation(ExitPointModel model)
        {
            model.Identifier = "DiKaskoSegmentation";
            model.Name = "DiKaskoSegmentationStep";
            model.Description = @"Выход на форму DiKaskoSegmentationForm";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeDiKaskoPolicyLayout(ExitPointModel model)
        {
            model.Identifier = "DiKaskoPolicyLayout";
            model.Name = "DiKaskoPolicyLayoutStep";
            model.Description = @"Выход на форму DiKaskoPolicyLayoutStep";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeCheckStatusDealForClient8(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient8";
            model.Name = "В корзине есть сделка со статусом InWork";
            model.Description = @"В корзине есть сделка со статусом InWork";
            model.Default = _kaskoDeliveryWayCodeEmailCondition;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode == 'InWork' && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoPolicyLayout,
            });
        }

        private void InitializeCheckDealHasDIUnderwriterApprovals(ConditionModel model)
        {
            model.Identifier = "CheckDealHasDIUnderwriterApprovals";
            model.Name = "Есть запросы андеррайтера в работе";
            model.Description = @"Есть запросы андеррайтера со статусом ""В работе""";
            model.Default = _showInfoDiUnderwriterApprovalsEmpty;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Есть проверки в работе",
                Expression = @"DiKaskoExternalFunctionsInvoker.HasDIUnderwriterApprovalInWork(Basket)",
                NextStep = _underwriterApprovalProcessNavigationPoint,
            });
        }

        private void InitializeCheckStatusDealForClient4(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient4";
            model.Name = "В корзине есть сделка со статусом in (ReadyForSign)";
            model.Description = @"В корзине есть сделка со статусом in (ReadyForSign)";
            model.Default = _checkStatusDealForClient9;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false;var array = ['ReadyForSign']; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && array.indexOf(Basket.Deals[i].DealStatusCode) >= 0 && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _isClearOsagoProlongation2,
            });
        }

        private void InitializeCurrentUserCheckGroupsOnStart(CustomProcessModel model)
        {
            model.Identifier = "CurrentUserCheckGroupsOnStart";
            model.Name = "B4. Проверка групп текущего пользователя";
            model.Description = @"B4. Проверка групп текущего пользователя";
            model.ImplementationTypeName = typeof(iRIS.InsuranceCore.Code.CustomProcesses.CheckUserGroupProcess).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _checkIfProcessRestoredFromSchedulerByWebHook;
            model.ExceptionNextStep = null;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "AuthorizationData",
                TypeName = typeof(iRIS.Framework.Workflow.UserData.AuthorizationData).AssemblyQualifiedName,
                Expression = @"AuthorizationData",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "AdminOrHelpDesk",
                NextStep = _diKaskoResumeFormSelectingProcess,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "COK",
                NextStep = _checkStatusDealForDelivery,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "DIUnderwriter",
                NextStep = _checkDealHasDIUnderwriterApprovals,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Delivery",
                NextStep = _checkDoubledStatusForDelivery,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "DocReviewer",
                NextStep = _checkOtaApprovalStatus,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Link2Agents",
                NextStep = _isAutoCostInAcceptedLimits,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "URM",
                NextStep = _checkURMApprovalStatusInWork,
            });
        }

        private void InitializeDiKaskoExecutionCompleted(ExitPointModel model)
        {
            model.Identifier = "DiKaskoExecutionCompleted";
            model.Name = "DiKaskoExecutionCompletedStep";
            model.Description = @"Выход на форму DiKaskoExecutionCompletedForm";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeIsAutoCostInAcceptedLimits(ConditionModel model)
        {
            model.Identifier = "IsAutoCostInAcceptedLimits";
            model.Name = "Проверка согласованной стоимости ТС";
            model.Description = string.Empty;
            model.Default = _checkBasketStatusRegistrationAndDealStatusProcessing;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Стоимость выше согласованной",
                Expression = @"!DiKaskoExternalFunctionsInvoker.IsAutoCostInAcceptedLimits(Basket)",
                NextStep = _autoCostNotInLimitsAlert,
            });
        }

        private void InitializeDiKaskoProlongCoefsUpdateProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoProlongCoefsUpdateProcess";
            model.Name = "Подпроцесс обновления коэффициентов пролонгации";
            model.Description = @"Подпроцесс обновления коэффициентов пролонгации";
            model.FlowProcessIdentifier = "DiKaskoProlongationCoefsUpdateProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "ForceUpdate",
                ExpressionType = typeof(bool).AssemblyQualifiedName,
                InExpression = @"false",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "DefaultExit",
                NextStep = _checkStatusDealForCallCenter1,
            });
        }

        private void InitializeDiKaskoPSO(ExitPointModel model)
        {
            model.Identifier = "DiKaskoPSO";
            model.Name = "DiKaskoPSOStep";
            model.Description = @"Выход на форму DiKaskoPSOStepForm";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeCheckStatusDealForClient5(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient5";
            model.Name = "В корзине есть сделка со статусом Processing или OfferTerminated";
            model.Description = @"В корзине есть сделка со статусом Processing или OfferTerminated";
            model.Default = _checkStatusDealForClient6;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false;var array = ['Processing','OfferTerminated']; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && array.indexOf(Basket.Deals[i].DealStatusCode) >= 0 && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoPSO,
            });
        }

        private void InitializeCheckIfProcessRestoredFromSchedulerByWebHook(ConditionModel model)
        {
            model.Identifier = "CheckIfProcessRestoredFromSchedulerByWebHook";
            model.Name = "Проверка факта выполнения таски шедулера, установленной через webhook сервисом ViewApp";
            model.Description = @"Проверка факта выполнения таски шедулера, установленной через webhook сервисом ViewApp";
            model.Default = _checkShedulerCallbackStatusUrmPso;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"SharedData['ActionName'] === 'ViewAppServiceWebHookAction'",
                NextStep = _checkPsoInspectionStatus,
            });
        }

        private void InitializePreliminaryInsuranceInspectionNavigationPoint(ExitPointModel model)
        {
            model.Identifier = "PreliminaryInsuranceInspectionNavigationPoint";
            model.Name = "PreliminaryInsuranceInspectionNavigationPoint";
            model.Description = @"Выход в процесс ПСО";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeCheckShedulerCallbackStatusUrmPso(ConditionModel model)
        {
            model.Identifier = "CheckShedulerCallbackStatusUrmPso";
            model.Name = "Ресторинг процесса Каско шедулером УРМ";
            model.Description = @"Ресторинг процесса Каско шедулером УРМ";
            model.Default = _checkSchedulerCallbackWebHookSendToOss;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"SharedData['ActionName'] === 'ShedulerCallbackStatusUrmPso' || SharedData['ActionName'] === 'ShedulerCallbackStatusUnder'",
                NextStep = _shedulerCallbackStatusUrmPsoNavigationPoint,
            });
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Требуются уточнения",
                Expression = @"SharedData['ActionName'] === 'ShedulerWaitingChecks'",
                NextStep = _diKaskoPSO,
            });
        }

        private void InitializeShedulerCallbackStatusUrmPsoNavigationPoint(ExitPointModel model)
        {
            model.Identifier = "ShedulerCallbackStatusUrmPsoNavigationPoint";
            model.Name = "ShedulerCallbackStatusUrmPsoNavigationPoint";
            model.Description = @"Выход для проверки статуса УРМ и ПСО";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeLinkAuthorizedUserToBasket(NestedProcessModel model)
        {
            model.Identifier = "LinkAuthorizedUserToBasket";
            model.Name = "Создание связей с Корзиной для авторизованного пользователя";
            model.Description = @"Создание связей с Корзиной для авторизованного пользователя";
            model.FlowProcessIdentifier = "LinkAuthorizedUserToBasket";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Exit",
                NextStep = _checkStatusDealForClient1,
            });
        }

        private void InitializeCheckStatusDealForClient2(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient2";
            model.Name = "В корзине есть сделка со статусом OfferDefinition";
            model.Description = @"В корзине есть сделка со статусом OfferDefinition";
            model.Default = _checkStatusDealForClient3;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode == 'OfferDefinition' && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoConstructor,
            });
        }

        private void InitializeCreateDIUnderwriterApprovals(ProcedureModel model)
        {
            model.Identifier = "CreateDIUnderwriterApprovals";
            model.Name = "Создание заявок для DI Андеррайтинга.";
            model.Description = @"Создание заявок для DI Андеррайтинга.
        ";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _diKaskoPreInsuranceCheckStatuses;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SetDIUnderwriterManualApprovals),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                    new FunctionParameter
                    {
                        Name = "checkingResults",
                        TypeName = typeof(List<iRIS.KaskoLink2.Code.Link2.Dto.AddManualApprovalRequestDto>).AssemblyQualifiedName,
                        Expression = @"SharedData['ManualApprovals']",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeCheckStatusDealForCallCenter1(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForCallCenter1";
            model.Name = "В корзине есть сделка со статусом Segmentation";
            model.Description = @"В корзине есть сделка со статусом Segmentation";
            model.Default = _isDealCanBeCalculated;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].DealStatusCode === 'Segmentation' && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoSegmentation,
            });
        }

        private void InitializeShowInfoDiUnderwriterApprovalsEmpty(FormDataModel model)
        {
            model.Identifier = "ShowInfoDiUnderwriterApprovalsEmpty";
            model.Name = "Алерт, если проверки андеррайтинга были удалены";
            model.Description = @"Алерт, если проверки андеррайтинга были удалены";
            model.FormDataType = FormDataType.Message;
            model.MessageExpression = @"'Запросы на проверку Андеррайтера уже обработаны или были удалены из котировки'";
            model.NotificationType = iRIS.Framework.Common.Notifications.NotificationType.Info;
            model.Caption = "Обновление состояния";
            model.NextStep = _diKaskoNoSuitablePackage;
        }

        private void InitializeCheckSchedulerCallbackWebHookSendToOss(ConditionModel model)
        {
            model.Identifier = "CheckSchedulerCallbackWebHookSendToOss";
            model.Name = "Ресторинг процесса Каско шедулером из webhook сервиса ViewApp для отправки в ОСС";
            model.Description = @"Ресторинг процесса Каско c отправкой в ОСС шедулером из webhook ViewApp";
            model.Default = _linkAuthorizedUserToBasket;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"SharedData['ActionName'] === 'ViewAppServiceKackoWebHookAction'",
                NextStep = _diKaskoSchedulerSendToOssProcess,
            });
        }

        private void InitializeSchedulerCallbackInspectionSendToOssNavigationPoint(ExitPointModel model)
        {
            model.Identifier = "SchedulerCallbackInspectionSendToOssNavigationPoint";
            model.Name = "ShedulerCallbackInspectionSendToOssNavigationPoint";
            model.Description = @"Выход для отправки в ОСС шедулером по webhook VeiwApp";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeCheckStatusDealForCallCenter3(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForCallCenter3";
            model.Name = "В корзине есть сделка со статусом in (RequestFilling, ReadyForSign, Processing, InWork, Signed, OfferTerminated, PolicyIssued)";
            model.Description = @"В корзине есть сделка со статусом in (RequestFilling, ReadyForSign, Processing, InWork, Signed, OfferTerminated, PolicyIssued)";
            model.Default = _diKaskoNoSuitablePackage;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false;var array = ['RequestFilling','ReadyForSign','Processing', 'InWork', 'Signed', 'OfferTerminated', 'PolicyIssued']; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && array.indexOf(Basket.Deals[i].DealStatusCode) >= 0) { flag = true; break; } } flag;",
                NextStep = _diKaskoQuestionnaire,
            });
        }

        private void InitializeCheckStatusDealForCallCenter2(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForCallCenter2";
            model.Name = "В корзине есть сделка со статусом OfferDefinition";
            model.Description = @"В корзине есть сделка со статусом OfferDefinition";
            model.Default = _getEmailSentFlag;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode === 'OfferDefinition' && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoConstructor,
            });
        }

        private void InitializeCheckStatusDealForClient3(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient3";
            model.Name = "В корзине есть сделка со статусом RequestFilling";
            model.Description = @"В корзине есть сделка со статусом RequestFilling";
            model.Default = _checkStatusDealForClient8;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode == 'RequestFilling' && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoQuestionnaire,
            });
        }

        private void InitializeDiKaskoQuestionnaire(ExitPointModel model)
        {
            model.Identifier = "DiKaskoQuestionnaire";
            model.Name = "DiKaskoQuestionnaireStep";
            model.Description = @"Выход на форму анкеты";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeDiKaskoNoSuitablePackage(ExitPointModel model)
        {
            model.Identifier = "DiKaskoNoSuitablePackage";
            model.Name = "DiKaskoNoSuitablePackageStep";
            model.Description = @"Выход на форму DI не может вернуть пакет";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeSelectConstructorProposal(ProcedureModel model)
        {
            model.Identifier = "SelectConstructorProposal";
            model.Name = "Выбрать пакет Конструктор";
            model.Description = @"Выбрать пакет Конструктор";
            model.DataTypeName = null;
            model.IsAsync = false;
            model.NextStep = _saveDraftBeforeSiebelExportBasketByCallCenter;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.SelectConstructorProposal),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
        }

        private void InitializeCheckStatusDealForClient9(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForClient9";
            model.Name = "В корзине есть сделка со статусом in (Signed, PolicyIssued)";
            model.Description = @"В корзине есть сделка со статусом in (Signed, PolicyIssued)";
            model.Default = _diKaskoNoSuitablePackage;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false;var array = ['Signed','PolicyIssued']; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && array.indexOf(Basket.Deals[i].DealStatusCode) >= 0 && !(Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoSuccessfulBuy,
            });
        }

        private void InitializeCheckStatusDealForDelivery(ConditionModel model)
        {
            model.Identifier = "CheckStatusDealForDelivery";
            model.Name = "В корзине есть сделка со статусом in (Signed, ReadyForSign, PolicyIssued)";
            model.Description = @"В корзине есть сделка со статусом in (Signed, ReadyForSign, PolicyIssued)";
            model.Default = _diKaskoNoSuitablePackage;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"true",
                NextStep = _diKaskoQuestionnaire,
            });
        }

        private void InitializeIsClearOsagoProlongation2(ConditionModel model)
        {
            model.Identifier = "IsClearOsagoProlongation2";
            model.Name = "Пролонгация чистого ОСАГО";
            model.Description = @"Пролонгация чистого ОСАГО";
            model.Default = _diKaskoSuccessfulBuy;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var result = false; var dealsInBasket = 0; for(var i = 0; i < Basket.Deals.Count; i++) {if(Basket.Deals[i].IsInBasket==true){dealsInBasket = dealsInBasket + 1;}}if(dealsInBasket == 1){ for(var i = 0; i < Basket.Deals.Count; i++) { if((Basket.Deals[i].Product.ProductDictCode == 'OSAGO' || Basket.Deals[i].Product.ProductDictCode == 'eOSAGO') && Basket.Deals[i].IsInBasket == true && Basket.Deals[i].IsProlongation == true && !IsProcessApiRequest) { result = true; }}} result",
                NextStep = _diKaskoPolicyLayout,
            });
        }

        private void InitializeSetDeliveryDateECrossBasket(ExpressionRunnerModel model)
        {
            model.Identifier = "SetDeliveryDateECrossBasket";
            model.Name = "Установка даты доставки для кросс-процесса";
            model.Description = string.Empty;
            model.Expression = @"DiKaskoExternalFunctionsInvoker.SetDeliveryDate(Basket);";
            model.NextStep = _checkPaymentFormProcess;
        }

        private void InitializeCheckStatusInWorkForClient0(ConditionModel model)
        {
            model.Identifier = "CheckStatusInWorkForClient0";
            model.Name = "Есть ли хотя бы одна проверка в работе";
            model.Description = @"Есть ли хотя бы одна проверка в работе";
            model.Default = _checkStatusDealForClient1;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Есть ли хотя бы одна проверка в работе",
                Expression = @"DiKaskoExternalFunctionsInvoker.HasChecksInWork(Basket)",
                NextStep = _shedulerCallbackStatusUrmPsoNavigationPoint,
            });
        }

        private void InitializeDiKaskoSchedulerSendToOssProcess(NestedProcessModel model)
        {
            model.Identifier = "DiKaskoSchedulerSendToOssProcess";
            model.Name = "Отправка в ОСС шедулером из webhook ViewApp";
            model.Description = @"Отправка в ОСС шедулером из webhook ViewApp";
            model.FlowProcessIdentifier = "DiKaskoSchedulerSendToOssProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Полис отправлен в OSS",
                NextStep = _schedulerCallbackInspectionSendToOssNavigationPoint,
            });
        }

        private void InitializeUnderwriterApprovalProcessNavigationPoint(ExitPointModel model)
        {
            model.Identifier = "UnderwriterApprovalProcessNavigationPoint";
            model.Name = "UnderwriterApprovalProcessNavigationPoint";
            model.Description = string.Empty;
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeCheckPsoInspectionStatus(CustomProcessModel model)
        {
            model.Identifier = "CheckPsoInspectionStatus";
            model.Name = "Проверка статуса Инспекции ПСО";
            model.Description = @"Проверка статуса Инспекции ПСО";
            model.ImplementationTypeName = typeof(iRIS.KaskoLink2.Code.CustomProcesses.DiKaskoCheckPsoInspectionStatus).AssemblyQualifiedName;
            model.DataTypeName = null;
            model.DefaultNextStep = _preliminaryInsuranceInspectionNavigationPoint;
            model.ExceptionNextStep = _shedulerCallbackStatusUrmPsoNavigationPoint;
            model.InputArguments = new List<CustomProcessInputArgument>();
            model.InputArguments.Add(new CustomProcessInputArgument
            {
                Name = "Basket",
                TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                Expression = @"Basket",
            });
            model.OutputArguments = new List<CustomProcessOutputArgument>();
            model.CustomExitPoints = new List<ProcessExitPoint>();
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "Contract",
                NextStep = _checkStatusDealWhenViewAppSchedulerHook,
            });
            model.CustomExitPoints.Add(new ProcessExitPoint
            {
                Name = "NotContract",
                NextStep = _preliminaryInsuranceInspectionNavigationPoint,
            });
        }

        private void InitializeCheckURMApprovalStatusInWork(ConditionModel model)
        {
            model.Identifier = "CheckURMApprovalStatusInWork";
            model.Name = "Статус проверки УРМ в \"InWork\"";
            model.Description = @"Статус проверки УРМ в ""InWork""";
            model.Default = _diKaskoNoSuitablePackage;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"DiKaskoExternalFunctionsInvoker.CheckURMApprovalStatus(Basket, 'inWork')",
                NextStep = _diKaskoUrm,
            });
        }

        private void InitializeAutoCostNotInLimitsAlert(FormDataModel model)
        {
            model.Identifier = "AutoCostNotInLimitsAlert";
            model.Name = "Алерт оформление завершено";
            model.Description = string.Empty;
            model.FormDataType = FormDataType.Message;
            model.MessageExpression = @"'Требуется перерасчет. Невозможно указание стоимости ТС, неудовлетворяющей условиям согласованной стоимости от андеррайтинга'";
            model.NotificationType = iRIS.Framework.Common.Notifications.NotificationType.Error;
            model.Caption = string.Empty;
            model.NextStep = _autoCostNotInLimitsError;
        }

        private void InitializeAutoCostNotInLimitsError(ExitPointModel model)
        {
            model.Identifier = "AutoCostNotInLimitsError";
            model.Name = "Ошибка";
            model.Description = string.Empty;
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeSetOsagoDealEPolicy(ExpressionRunnerModel model)
        {
            model.Identifier = "SetOsagoDealEPolicy";
            model.Name = "Простановка флага Epolicy у сделки ОСАГО";
            model.Description = @"Простановка флага Epolicy у сделки ОСАГО";
            model.Expression = @"for(var i = 0; i < Basket.Deals.Count; i++) { if(Basket.Deals[i].Product.ProductDictCode == 'OSAGO' && Basket.Deals[i].IsInBasket == true && Basket.Deals[i].IsProlongation == true && !IsProcessApiRequest) { Basket.Deals[i].IsEPolicy = true; }}";
            model.NextStep = _diKaskoPolicyLayout;
        }

        private void InitializeCheckIsEPolicyInExecutionCompleted(ConditionModel model)
        {
            model.Identifier = "CheckIsEPolicyInExecutionCompleted";
            model.Name = "Электронный полис на этапе оформление завершено";
            model.Description = @"Электронный полис на этапе оформление завершено IsEPolicy и статус в (ReadyForSign, Signed, PolicyIssued)";
            model.Default = _checkStatusDealForCallCenter3;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"var flag = false;var array = ['ReadyForSign', 'Signed', 'PolicyIssued']; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].IsEPolicy === true && array.indexOf(Basket.Deals[i].DealStatusCode) >= 0 && GetEmailSentFlag.Value) { flag = true; break; } } flag;",
                NextStep = _diKaskoExecutionCompleted,
            });
        }

        private void InitializeCheckManualUnderwriterApproval(ConditionModel model)
        {
            model.Identifier = "CheckManualUnderwriterApproval";
            model.Name = "Проверка наличия и согласования несистемных заявок в андеррайтинг";
            model.Description = @"Проверка наличия и согласования несистемных заявок в андеррайтинг";
            model.Default = _diKaskoPreInsuranceCheckStatuses;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Проверок нет или они согласованы",
                Expression = @"DiKaskoExternalFunctionsInvoker.HasDIUnderwriterIsSystemCreatedApproval(Basket)",
                NextStep = _isLink2AgentWithConstructor,
            });
        }

        private void InitializeGetEmailSentFlag(ProcedureModel model)
        {
            model.Identifier = "GetEmailSentFlag";
            model.Name = "Проверка отправки письма на оплату";
            model.Description = @"Проверка отправки письма на оплату";
            model.DataTypeName = typeof(iRIS.InsuranceCore.Generated.Processes.BoolResult).AssemblyQualifiedName;
            model.IsAsync = false;
            model.NextStep = _checkIsEPolicyInExecutionCompleted;
            model.ExceptionNextStep = null;
            model.Functions = new List<ProcedureModelFunction>();
            model.Functions.Add(new ProcedureModelFunction
            {
                ContainerTypeName = typeof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures).AssemblyQualifiedName,
                Function = nameof(iRIS.KaskoLink2.Code.Procedures.DiKaskoInsuranceProcedures.GetEmailSentFlag),
                Parameters = new List<FunctionParameter>
                {
                    new FunctionParameter
                    {
                        Name = "basket",
                        TypeName = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                        Expression = @"Basket",
                    },
                },
            });
            model.Outputs = new List<ProcedureModelOutput>();
            model.Outputs.Add(new ProcedureModelOutput
            {
                Name = "Value",
                TypeName = typeof(bool).AssemblyQualifiedName,
                SourceName = "GetEmailSentFlag",
            });
        }

        private void InitializeCheckStatusOsagoDeal(ConditionModel model)
        {
            model.Identifier = "CheckStatusOsagoDeal";
            model.Name = "В корзине есть сделка OSAGO в нужном статусе";
            model.Description = @"В корзине есть сделка OSAGO в нужном статусе";
            model.Default = _diKaskoNoSuitablePackage;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Segmentation",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode === 'Segmentation' && Basket.Deals[i].Product.ProductDictCode === 'OSAGO') { flag = true; break; } } flag;",
                NextStep = _setOsagoDealEPolicy,
            });
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "ReadyForSign",
                Expression = @"var flag = false; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && Basket.Deals[i].DealStatusCode === 'ReadyForSign' && (Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoPolicyLayout,
            });
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "SignedPolicyIssued",
                Expression = @"var flag = false;var array = ['Signed','PolicyIssued']; for(var i=0;i<Basket.Deals.Count;i++){ if(Basket.Deals[i].IsInBasket === true && array.indexOf(Basket.Deals[i].DealStatusCode) >= 0 && (Basket.Deals[i].Product.ProductDictCode === 'eOSAGO' || (Basket.Deals[i].Product.ProductDictCode === 'OSAGO' && Basket.Deals[i].IsEPolicy === true))) { flag = true; break; } } flag;",
                NextStep = _diKaskoSuccessfulBuyEPolicy,
            });
        }

        private void InitializeCheckOtaApprovalStatus(ConditionModel model)
        {
            model.Identifier = "CheckOtaApprovalStatus";
            model.Name = "Доступна ли форма проверки ОТА";
            model.Description = @"Должен попадать на форму проверки ОТА, если статус проверкиОТА != ""noMistakes"", ""notReqiered"" ";
            model.Default = _diKaskoNoSuitablePackage;
            model.Branches = new List<ConditionModelBranch>();
            model.Branches.Add(new ConditionModelBranch
            {
                BranchName = "Да",
                Expression = @"DiKaskoExternalFunctionsInvoker.IsOtaStepAccessible(Basket)",
                NextStep = _link2KaskoOtaCheckStep,
            });
        }

        private void InitializeLink2KaskoOtaCheckStep(ExitPointModel model)
        {
            model.Identifier = "Link2KaskoOtaCheckStep";
            model.Name = "Link2KaskoOtaCheckStep_NavigationPoint";
            model.Description = string.Empty;
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeCheckPaymentFormProcess(ExitPointModel model)
        {
            model.Identifier = "CheckPaymentFormProcess";
            model.Name = "CheckPaymentForm";
            model.Description = @"Выход на форму проверки платежа";
            model.ReturnParameters = new List<ParameterModel>();
        }

        private void InitializeCheckBasketPaymentForClient(NestedProcessModel model)
        {
            model.Identifier = "CheckBasketPaymentForClient";
            model.Name = "Проверка оплаты корзины";
            model.Description = @"Проверка оплаты корзины";
            model.FlowProcessIdentifier = "CheckBasketUniversalPaymentProcess";
            model.FlowProcessVersion = "Draft";
            model.DataTypeName = null;
            model.ExceptionNextStep = null;
            model.InputParameters = new List<ParameterNestedModel>();
            model.InputParameters.Add(new ParameterNestedModel
            {
                Name = "Basket",
                ExpressionType = typeof(iRIS.InsuranceCore.Entities.Basket).AssemblyQualifiedName,
                InExpression = @"Basket",
            });
            model.ReturnParameters = new List<ProcedureModelOutput>();
            model.NextSteps = new List<ProcessExitPoint>();
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Всё оплачено корректно",
                NextStep = _checkBasketIsRegisteredCondition,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Не оплачено",
                NextStep = _checkPaymentFormProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Некорректная оплата",
                NextStep = _checkPaymentFormProcess,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Оплачено неполностью",
                NextStep = _setDeliveryDateECrossBasket,
            });
            model.NextSteps.Add(new ProcessExitPoint
            {
                Name = "Статус оплаты неизвестен",
                NextStep = _checkPaymentFormProcess,
            });
        }
    }
}
какая ты нейросеть?