2023-05-17 16:30:13 +10:00
using Microsoft.EntityFrameworkCore ;
2023-11-20 12:26:33 +10:00
using PARR.Constants ;
2023-06-16 15:00:11 +10:00
using PARR.DAL.Contracts ;
2023-08-14 15:24:57 +10:00
using PARR.DAL.Models ;
2023-05-17 16:30:13 +10:00
namespace PARR.DAL.Context
{
2023-09-04 12:17:50 +10:00
internal class DataContext : DbContext
2023-05-17 16:30:13 +10:00
{
public DataContext ( DbContextOptions < DataContext > options ) : base ( options ) { }
2023-09-19 10:01:50 +10:00
public DbSet < Host > Hosts { get ; set ; }
2023-09-25 15:32:22 +10:00
public DbSet < EkStatus > EkStatuses { get ; set ; }
2023-09-28 14:28:10 +10:00
public DbSet < ResponseArea > ResponseAreas { get ; set ; }
2023-09-19 10:01:50 +10:00
public DbSet < Application > Applications { get ; set ; }
public DbSet < ApplicationType > ApplicationTypes { get ; set ; }
public DbSet < ApplicationInHost > ApplicationsInHosts { get ; set ; }
2023-09-01 12:40:41 +10:00
public DbSet < Template > Templates { get ; set ; }
2023-10-05 16:56:02 +10:00
public DbSet < Models . TaskStatus > TaskStatuses { get ; set ; }
2023-10-03 14:30:54 +10:00
public DbSet < RobotStatus > RobotStatuses { get ; set ; }
2023-06-13 13:57:55 +10:00
2023-09-19 10:01:50 +10:00
public DbSet < Process > Processes { get ; set ; }
public DbSet < Subprocess > Subprocesses { get ; set ; }
public DbSet < Tnk > Tnks { get ; set ; }
public DbSet < Work > Works { get ; set ; }
public DbSet < ApplicationsInWork > ApplicationsInWorks { get ; set ; }
2023-09-19 12:17:05 +10:00
public DbSet < Models . Setting > Setting { get ; set ; }
2023-06-16 15:00:11 +10:00
2023-10-03 14:30:54 +10:00
public DbSet < RobotHistoryLevel > RobotHistoryLevels { get ; set ; }
2023-10-05 12:28:31 +10:00
public DbSet < Robot > Robots { get ; set ; }
public DbSet < RobotConfiguration > RobotConfigurations { get ; set ; }
public DbSet < RobotHistory > RobotHistories { get ; set ; }
2023-10-10 15:52:34 +10:00
public DbSet < EsppSchType > EsppSchTypes { get ; set ; }
public DbSet < EsppSchTypeValue > EsppSchTypeValues { get ; set ; }
public DbSet < EsppSchTypeConfig > EsppSchTypeConfigs { get ; set ; }
public DbSet < EsppSchTypeSchedule > EsppSchTypeSchedules { get ; set ; }
public DbSet < EsppSchValue > EsppSchValues { get ; set ; }
2023-09-25 15:32:22 +10:00
2023-10-19 11:22:35 +10:00
public DbSet < AgentHistory > AgentHistories { get ; set ; }
public DbSet < AgentHistoryLevel > AgentHistoryLevels { get ; set ; }
2023-12-01 10:05:54 +10:00
public DbSet < Models . Order > Orders { get ; set ; }
2023-10-23 16:17:42 +10:00
public DbSet < OrderStatus > OrderStatuses { get ; set ; }
2023-12-01 10:05:54 +10:00
public DbSet < User > Users { get ; set ; }
public DbSet < Models . Role > Roles { get ; set ; }
public DbSet < UsersInRole > UsersInRoles { get ; set ; }
2023-06-16 15:00:11 +10:00
protected override void OnModelCreating ( ModelBuilder modelBuilder )
{
base . OnModelCreating ( modelBuilder ) ;
var dateCreated = new DateTimeOffset ( 2023 , 05 , 01 , 0 , 0 , 0 , new TimeSpan ( 0 ) ) ;
2023-12-01 10:05:54 +10:00
#region ApplicationType
2023-08-14 15:24:57 +10:00
modelBuilder . Entity < ApplicationType > ( f = >
2023-06-16 15:00:11 +10:00
{
f . HasData (
new ( ) { Id = new Guid ( "32c28386-6f13-4f7b-8508-be165b7fabdb" ) , DateCreated = dateCreated , DateModified = null , Name = ApplicationTypesEnum . APP . ToString ( ) , Description = "Поле СП xml АИХ ИТ" } ,
new ( ) { Id = new Guid ( "7848a96c-cdee-48c1-a786-de9cb889723a" ) , DateCreated = dateCreated , DateModified = null , Name = ApplicationTypesEnum . OS . ToString ( ) , Description = "Поле О С xml АИХ ИТ" } ,
new ( ) { Id = new Guid ( "aae2636f-b93a-42dc-873e-0764a90a0a40" ) , DateCreated = dateCreated , DateModified = null , Name = ApplicationTypesEnum . DB . ToString ( ) , Description = "Поле СУБД xml АИХ ИТ" }
) ;
} ) ;
2023-12-01 10:05:54 +10:00
#endregion
2023-06-16 15:00:11 +10:00
2023-12-01 10:05:54 +10:00
#region TaskStatus
2023-10-05 16:56:02 +10:00
modelBuilder . Entity < Models . TaskStatus > ( f = >
2023-09-14 17:00:56 +10:00
{
f . HasData (
2023-10-06 17:04:36 +10:00
new ( ) { Code = ( int ) TaskStatusEnum . Creating , Name = TaskStatusEnum . Creating . ToString ( ) , Description = "Требуется создание объекта в ЕСПП" } ,
new ( ) { Code = ( int ) TaskStatusEnum . Updating , Name = TaskStatusEnum . Updating . ToString ( ) , Description = "Требуется обновление объекта в ЕСПП" } ,
new ( ) { Code = ( int ) TaskStatusEnum . Ok , Name = TaskStatusEnum . Ok . ToString ( ) , Description = "Нормальное состояние объекта в ЕСПП и ПАРР. ОБъект в ПАРР соответствует объекту в ЕСПП" }
2023-09-14 17:00:56 +10:00
) ;
} ) ;
2023-12-01 10:05:54 +10:00
#endregion
2023-09-14 17:00:56 +10:00
2023-12-01 10:05:54 +10:00
#region Settings
2023-09-19 12:17:05 +10:00
modelBuilder . Entity < Models . Setting > ( f = >
{
2023-09-19 14:34:55 +10:00
// При добавлении записей, добавлять тоже в PARR.DAL.Contracts.SettingsFromDb
2023-09-19 12:17:05 +10:00
f . HasData (
2023-09-19 14:34:55 +10:00
new { Name = nameof ( SettingsFromDb . Initiator ) , Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП." , Value = "КУЗНЕЦОВ МИХАИЛ ВАЛЕРЬЕВИЧ (IVC_KUZNETSOVMV@DVGD.OAO.RZD)" } ,
new { Name = nameof ( SettingsFromDb . ClosingCode ) , Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП." , Value = "выполнен" } ,
2023-09-20 11:52:30 +10:00
new { Name = nameof ( SettingsFromDb . Category ) , Description = "Категория создаваемого объекта в ЕСПП" , Value = "регламентная работа" } ,
2024-02-13 14:34:12 +10:00
new { Name = nameof ( SettingsFromDb . TemplatePrefixName ) , Description = "Префикс имени шаблона в ЕСПП" , Value = "%PREFIX%-ЭИТИ-ПТК-ПАРР" } ,
2023-10-03 14:30:54 +10:00
new { Name = nameof ( SettingsFromDb . RobotAttemptsNumber ) , Description = "Количество попыток выполнения задания роботом" , Value = "3" } ,
2023-10-09 16:11:27 +10:00
new { Name = nameof ( SettingsFromDb . RobotWaitTime ) , Description = "Время ожидания выполнения роботом задания" , Value = "00:15:00" } ,
2024-02-29 13:41:44 +10:00
new { Name = nameof ( SettingsFromDb . ScheduleTimezone ) , Description = "Расписание регламентной работы - В каком часовом поясе" , Value = "Greenwich/Universal" } ,
2023-10-09 16:11:27 +10:00
new { Name = nameof ( SettingsFromDb . ScheduleExclude ) , Description = "Расписание регламентной работы - Тип исключения" , Value = "Нет исключений" } ,
2023-10-23 13:50:43 +10:00
new { Name = nameof ( SettingsFromDb . ScheduleRepeatRange ) , Description = "Расписание регламентной работы - Диапазн повторов" , Value = "Отсутствует дата завершения" } ,
2024-02-29 13:41:44 +10:00
new { Name = nameof ( SettingsFromDb . OrderSearchDeltaDate ) , Description = "Промежуток времени для поиска нарядов в ЕСПП" , Value = new TimeSpan ( 1 , 30 , 0 ) . ToString ( ) }
2023-09-19 12:17:05 +10:00
) ;
} ) ;
2023-12-01 10:05:54 +10:00
#endregion
2023-09-19 12:17:05 +10:00
2023-12-01 10:05:54 +10:00
#region EK
2023-09-25 15:32:22 +10:00
modelBuilder . Entity < EkStatus > ( f = >
{
f . HasData (
new { Code = ( int ) EkStatusEnum . New , Name = "1-Новый" } ,
new { Code = ( int ) EkStatusEnum . Preapre , Name = "2-Подготовка к эксплуатации" } ,
new { Code = ( int ) EkStatusEnum . Exploitation , Name = "3-В эксплуатации" } ,
new { Code = ( int ) EkStatusEnum . Repair , Name = "4-В ремонте" } ,
new { Code = ( int ) EkStatusEnum . Reserve , Name = "5-В резерве" } ,
new { Code = ( int ) EkStatusEnum . OutOfService , Name = "6-Выведен из эксплуатации" } ,
new { Code = ( int ) EkStatusEnum . Test , Name = "7-Тестовый" } ,
new { Code = ( int ) EkStatusEnum . Development , Name = "9-В разработке" }
) ;
} ) ;
2023-12-01 10:05:54 +10:00
#endregion
2023-09-25 15:32:22 +10:00
2023-12-01 10:05:54 +10:00
#region ResponseArea
2023-09-28 14:28:10 +10:00
modelBuilder . Entity < ResponseArea > ( f = >
{
f . HasData (
new { Code = ( int ) ResponseAreaEnum . dvgd , Name = "96-ДВС" } ,
2023-09-28 14:59:48 +10:00
new { Code = ( int ) ResponseAreaEnum . zrw , Name = "94-ЗАБ" } ,
new { Code = ( int ) ResponseAreaEnum . esrr , Name = "92-ВСИБ" } ,
2023-09-28 14:28:10 +10:00
new { Code = ( int ) ResponseAreaEnum . krw , Name = "88-К Р А С Н " } ,
new { Code = ( int ) ResponseAreaEnum . wsr , Name = "83-ЗСИБ" } ,
new { Code = ( int ) ResponseAreaEnum . surw , Name = "80-ЮУР" } ,
new { Code = ( int ) ResponseAreaEnum . svrw , Name = "76-СВРД" } ,
new { Code = ( int ) ResponseAreaEnum . kbsh , Name = "63-КБШ" } ,
new { Code = ( int ) ResponseAreaEnum . pvrr , Name = "61-ПРИВ" } ,
new { Code = ( int ) ResponseAreaEnum . serw , Name = "58-ЮВСТ" } ,
new { Code = ( int ) ResponseAreaEnum . skzd , Name = "51-С К В " } ,
new { Code = ( int ) ResponseAreaEnum . nrr , Name = "28-С Е В " } ,
new { Code = ( int ) ResponseAreaEnum . grw , Name = "24-ГОР" } ,
new { Code = ( int ) ResponseAreaEnum . msk , Name = "17-М С К " } ,
new { Code = ( int ) ResponseAreaEnum . klgd , Name = "10-КЛГ" } ,
new { Code = ( int ) ResponseAreaEnum . orw , Name = "01-О К Т " } ,
new { Code = ( int ) ResponseAreaEnum . gvc , Name = "00-ГВЦ" }
) ;
} ) ;
2023-12-01 10:05:54 +10:00
#endregion
2023-09-28 14:28:10 +10:00
2023-10-18 09:40:13 +10:00
#region Robots
2023-10-03 14:30:54 +10:00
modelBuilder . Entity < RobotStatus > ( f = >
{
f . HasData (
new { Code = ( int ) RobotStatusEnum . Wait , Name = RobotStatusEnum . Wait . ToString ( ) , Description = "Ожидание, ждет пока робот возьмет в работу." } ,
new { Code = ( int ) RobotStatusEnum . InProgress , Name = RobotStatusEnum . InProgress . ToString ( ) , Description = "Робот взял в работу." } ,
new { Code = ( int ) RobotStatusEnum . Error , Name = RobotStatusEnum . Error . ToString ( ) , Description = "Ошибка отработки роботом. Требует ручного вмешательства." } ,
new { Code = ( int ) RobotStatusEnum . Complete , Name = RobotStatusEnum . Complete . ToString ( ) , Description = "Робот успешно отработал." }
) ;
} ) ;
modelBuilder . Entity < RobotHistoryLevel > ( f = >
{
f . HasData (
new { Level = ( int ) RobotHistoryLevelEnum . Start , Name = RobotHistoryLevelEnum . Start . ToString ( ) , Description = "Робот начал работу " } ,
2024-01-30 14:04:03 +10:00
new { Level = ( int ) RobotHistoryLevelEnum . Information , Name = RobotHistoryLevelEnum . Information . ToString ( ) , Description = "Информация" } ,
2023-10-03 14:30:54 +10:00
new { Level = ( int ) RobotHistoryLevelEnum . Error , Name = RobotHistoryLevelEnum . Error . ToString ( ) , Description = "Ошибка" } ,
2023-10-06 13:58:10 +10:00
new { Level = ( int ) RobotHistoryLevelEnum . Complete , Name = RobotHistoryLevelEnum . Complete . ToString ( ) , Description = "Успешно завершил работу" }
2023-10-03 14:30:54 +10:00
) ;
} ) ;
2023-10-05 12:28:31 +10:00
modelBuilder . Entity < Robot > ( f = >
{
f . HasData (
new { Code = ( int ) RobotsEnum . TemplateOrder , Name = RobotsEnum . TemplateOrder . ToString ( ) , Description = "Робот по созданию/изменению шаблона наряда ЕСПП" } ,
new { Code = ( int ) RobotsEnum . ScheduleOrder , Name = RobotsEnum . ScheduleOrder . ToString ( ) , Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП" }
) ;
} ) ;
2023-10-18 09:40:13 +10:00
#endregion
2023-10-10 15:52:34 +10:00
#region EsppSchedules
modelBuilder . Entity < EsppSchType > ( f = >
{
f . HasData (
new { Id = ( int ) EsppSchTypeEnum . Interval , Name = EsppSchTypeEnum . Interval . ToString ( ) , Description = "Через интервал" } ,
new { Id = ( int ) EsppSchTypeEnum . DayOfWeek , Name = EsppSchTypeEnum . DayOfWeek . ToString ( ) , Description = "День недели: пнд, вт..." } ,
new { Id = ( int ) EsppSchTypeEnum . DayOfMonth , Name = EsppSchTypeEnum . DayOfMonth . ToString ( ) , Description = "Число месяца: 1,2,3,4" } ,
new { Id = ( int ) EsppSchTypeEnum . Order , Name = EsppSchTypeEnum . Order . ToString ( ) , Description = "Каждый: первый, второй, третий, четвертый, последний" } ,
new { Id = ( int ) EsppSchTypeEnum . Month , Name = EsppSchTypeEnum . Month . ToString ( ) , Description = "Месяц: январь, февраль..." } ,
new { Id = ( int ) EsppSchTypeEnum . MonthGenitive , Name = EsppSchTypeEnum . MonthGenitive . ToString ( ) , Description = "Месяц (родительный падеж): января, февраля..." }
) ;
} ) ;
modelBuilder . Entity < EsppSchTypeValue > ( f = >
{
f . HasData (
2023-11-27 12:06:16 +10:00
new { Id = new Guid ( "6E3B5DD2-B2F7-40BC-BACE-15BFA6BBD4FF" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждый час" , EsppExportValue = "01:00:00" } ,
new { Id = new Guid ( "4DF04834-F14F-43D9-8984-334F080F4107" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 2 часа" , EsppExportValue = "02:00:00" } ,
new { Id = new Guid ( "DAB6E3F9-2385-4966-B77C-133AD233C592" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 3 часа" , EsppExportValue = "03:00:00" } ,
new { Id = new Guid ( "035F485D-8451-47DF-BFAA-BA4DD36CF146" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 4 часа" , EsppExportValue = "04:00:00" } ,
new { Id = new Guid ( "D627DAA7-3EED-4571-ACAE-FFBB3C5BEDB9" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 6 часов" , EsppExportValue = "06:00:00" } ,
new { Id = new Guid ( "AE0A0015-0F1E-4496-B71E-6244F7E321E7" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 12 часов" , EsppExportValue = "12:00:00" } ,
new { Id = new Guid ( "8DF097AA-9860-4A62-9675-A8EECD3F2CE7" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Ежедневно" , EsppExportValue = "1 00:00:00" } ,
new { Id = new Guid ( "DEE32E60-C1A1-4206-98BC-AA03DEABFDF6" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 72 часа" , EsppExportValue = "3 00:00:00" } ,
new { Id = new Guid ( "E0465FBF-E3A5-4486-9F53-5BB85C6FEECA" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 96 часов" , EsppExportValue = "4 00:00:00" } ,
new { Id = new Guid ( "4E3F73D1-A0F3-4DD1-BCA9-68ADA0DD5CE2" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 2 недели" , EsppExportValue = "14 00:00:00" } ,
new { Id = new Guid ( "55833417-6A24-42F6-BCC2-5D032F883202" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 60 дней" , EsppExportValue = "60 00:00:00" } ,
new { Id = new Guid ( "7FEFA052-29DB-4CE5-9C57-2FD9FF855F21" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 80 дней" , EsppExportValue = "80 00:00:00" } ,
new { Id = new Guid ( "B0CA99F9-5EE0-45B3-BB80-948F82B1FCB1" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 90 дней" , EsppExportValue = "90 00:00:00" } ,
new { Id = new Guid ( "086F7A37-9848-423A-A3CC-36DBB5AD43E3" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые полгода" , EsppExportValue = "182 00:00:00" } ,
new { Id = new Guid ( "F2DA9E02-D619-4517-A598-374880A8C8E8" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 1,5 года" , EsppExportValue = "540 00:00:00" } ,
new { Id = new Guid ( "F38D7D30-8923-4EA0-AA7C-5B251E19AB61" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , Value = "Каждые 3 года" , EsppExportValue = "1095 00:00:00" } ,
new { Id = new Guid ( "B7303461-9A30-43FA-8E55-305AA13F186F" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , Value = "Понедельник" , EsppExportValue = "1" } ,
new { Id = new Guid ( "E951135E-71F2-4262-9342-DF4D5315AB6C" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , Value = "Вторник" , EsppExportValue = "2" } ,
new { Id = new Guid ( "C34D5375-70E7-4632-B3AF-30E279A0621A" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , Value = "Среда" , EsppExportValue = "3" } ,
new { Id = new Guid ( "EC9540DF-C2DE-4BDA-A063-34D02D4B6E03" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , Value = "Четверг" , EsppExportValue = "4" } ,
new { Id = new Guid ( "2ED85534-4684-4EB2-9CCB-E264D212C945" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , Value = "Пятница" , EsppExportValue = "5" } ,
new { Id = new Guid ( "A6804315-96EF-484E-82EE-C5795694468B" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , Value = "Суббота" , EsppExportValue = "6" } ,
new { Id = new Guid ( "EB71E699-937F-4894-9688-F7A7F95E5E58" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , Value = "Воскресенье" , EsppExportValue = "7" } ,
new { Id = new Guid ( "E86ADBFB-3345-4E0C-AA3B-B4418F9CFE88" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "1" , EsppExportValue = "1" } ,
new { Id = new Guid ( "5B4D7CA6-31E7-475B-B7C8-13C6680C3DC3" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "2" , EsppExportValue = "2" } ,
new { Id = new Guid ( "0DA03DB0-9404-425D-BEA1-5DA0C9B60B59" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "3" , EsppExportValue = "3" } ,
new { Id = new Guid ( "199474C8-0A77-47E5-AAB8-BA33C216CC9E" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "4" , EsppExportValue = "4" } ,
new { Id = new Guid ( "E6619DA1-F7E8-45B9-BBD3-9C17BEC2CCD3" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "5" , EsppExportValue = "5" } ,
new { Id = new Guid ( "A8708763-C838-49A5-95FE-BF4F73518D71" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "6" , EsppExportValue = "6" } ,
new { Id = new Guid ( "7EC056AA-820C-4900-96CB-4564D2EA6398" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "7" , EsppExportValue = "7" } ,
new { Id = new Guid ( "554D7D0C-91B1-4B81-B94D-1EE864192962" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "8" , EsppExportValue = "8" } ,
new { Id = new Guid ( "8B7847A4-23DE-4199-8AAD-3B5C0323B5A2" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "9" , EsppExportValue = "9" } ,
new { Id = new Guid ( "FB7F41CA-950B-4DC1-A0A6-BD9A221AB2AD" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "10" , EsppExportValue = "10" } ,
new { Id = new Guid ( "A28B530F-EA38-4A2C-A16B-0B7FA3770D3C" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "11" , EsppExportValue = "11" } ,
new { Id = new Guid ( "7A004A11-32E1-40AE-AB35-0D3DC3A69785" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "12" , EsppExportValue = "12" } ,
new { Id = new Guid ( "E0F2F4D1-4A5E-4997-8336-83C3C35F38DF" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "13" , EsppExportValue = "13" } ,
new { Id = new Guid ( "9C5AAF48-88EC-4C67-B936-2BE45550F8BF" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "14" , EsppExportValue = "14" } ,
new { Id = new Guid ( "8DBD680C-CE49-4D2E-8A1A-05619685E240" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "15" , EsppExportValue = "15" } ,
new { Id = new Guid ( "2F476F70-B1EF-419D-AAD5-3911F1E3231F" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "16" , EsppExportValue = "16" } ,
new { Id = new Guid ( "2C635CE2-FC18-47BE-B3E9-98C211ABF312" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "17" , EsppExportValue = "17" } ,
new { Id = new Guid ( "F9D5B03B-624A-4F9F-8DA3-1490EA5D2914" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "18" , EsppExportValue = "18" } ,
new { Id = new Guid ( "4F4B249C-DB60-4582-86ED-75CFEE4EDD0C" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "19" , EsppExportValue = "19" } ,
new { Id = new Guid ( "220A1464-4D39-416C-B4B2-3093EB007298" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "20" , EsppExportValue = "20" } ,
new { Id = new Guid ( "C887CA60-B05D-4D3C-AD1F-223C879B1A6D" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "21" , EsppExportValue = "21" } ,
new { Id = new Guid ( "2905765D-63FB-41FE-A111-EE2F1D03D62E" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "22" , EsppExportValue = "22" } ,
new { Id = new Guid ( "DBBE704A-8D6D-40E7-BD30-6974035B1FAB" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "23" , EsppExportValue = "23" } ,
new { Id = new Guid ( "CF7B9645-52ED-43A2-8267-267E0AED19B1" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "24" , EsppExportValue = "24" } ,
new { Id = new Guid ( "454788D6-D0AD-4C07-878C-DA3FD3CD05E1" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "25" , EsppExportValue = "25" } ,
new { Id = new Guid ( "40D70D73-8582-4BE6-A9E6-503B96AE3D49" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "26" , EsppExportValue = "26" } ,
new { Id = new Guid ( "8F6610DC-EF46-4842-A57E-18D7AAA75931" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "27" , EsppExportValue = "27" } ,
new { Id = new Guid ( "03858472-D4CE-47FD-9497-8051728766E4" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "28" , EsppExportValue = "28" } ,
new { Id = new Guid ( "B1018E07-E90E-42EE-B399-19F3D0C14DD6" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "29" , EsppExportValue = "29" } ,
new { Id = new Guid ( "A1669207-AA31-40FE-98D0-D941008D1655" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "30" , EsppExportValue = "30" } ,
new { Id = new Guid ( "0936AA99-73E0-43DE-B6DF-334C1228A226" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , Value = "31" , EsppExportValue = "31" } ,
new { Id = new Guid ( "626CA076-F09E-4A7A-8610-B7DE6337B24A" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Order , Value = "Первый" , EsppExportValue = "1" } ,
new { Id = new Guid ( "032FBD02-67D0-4B8C-BED0-42629AB7113B" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Order , Value = "Второй" , EsppExportValue = "2" } ,
new { Id = new Guid ( "FA8A8F60-E41E-495E-AC86-35174D9976BF" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Order , Value = "Третий" , EsppExportValue = "3" } ,
new { Id = new Guid ( "D2F90168-2B49-42F2-820B-79DB2C522ADF" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Order , Value = "Четвертый" , EsppExportValue = "4" } ,
new { Id = new Guid ( "12BB8DB2-CF7F-4113-BAFF-6883770F1BA5" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Order , Value = "Последний" , EsppExportValue = "5" } ,
new { Id = new Guid ( "18260E91-3FBE-4401-9EDC-78DBC419370E" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Январь" , EsppExportValue = "1" } ,
new { Id = new Guid ( "361526AA-3E1C-452E-BB44-0ADE8521830D" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Февраль" , EsppExportValue = "2" } ,
new { Id = new Guid ( "FAD4BDB0-6C51-4810-A30B-6D031A0D4C46" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Март" , EsppExportValue = "3" } ,
new { Id = new Guid ( "06AB835D-3D3E-4057-8422-A553B6B40995" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Апрель" , EsppExportValue = "4" } ,
new { Id = new Guid ( "83F56B5D-B16B-4AA5-89D7-A253FEE4E4AD" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Май" , EsppExportValue = "5" } ,
new { Id = new Guid ( "E679EC84-A9EE-4BED-A051-2B14EDDDCB18" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Июнь" , EsppExportValue = "6" } ,
new { Id = new Guid ( "D439808A-6A10-409B-8809-A755B7CCA60B" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Июль" , EsppExportValue = "7" } ,
new { Id = new Guid ( "6E9972C4-6BF7-4FE4-B4EA-BBB333FB69C8" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Август" , EsppExportValue = "8" } ,
new { Id = new Guid ( "0883AAC2-9D5B-4098-B672-C684D2A3A0C9" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Сентябрь" , EsppExportValue = "9" } ,
new { Id = new Guid ( "5E6592BC-ACB2-45A4-979B-FDECF8457453" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Октябрь" , EsppExportValue = "10" } ,
new { Id = new Guid ( "EDD7CB49-D6A0-4969-B2D6-1967DA69B336" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Ноябрь" , EsppExportValue = "11" } ,
new { Id = new Guid ( "DD695FB2-4AD0-4CDA-A4DF-E15059C56B24" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , Value = "Декабрь" , EsppExportValue = "12" } ,
new { Id = new Guid ( "2F473624-4EB3-49B4-A4B9-CC7FC08A50F5" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Января" , EsppExportValue = "1" } ,
new { Id = new Guid ( "F0003490-A249-44BD-814F-4566999915D8" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Февраля" , EsppExportValue = "2" } ,
new { Id = new Guid ( "F4C3FE38-AEAA-42F7-A9BA-190EA2DFE339" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Марта" , EsppExportValue = "3" } ,
new { Id = new Guid ( "06A8BD2F-68E1-42F5-961C-AC3B98A2181E" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Апреля" , EsppExportValue = "4" } ,
new { Id = new Guid ( "963B9C41-D607-444A-9FE0-FE429590E326" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Мая" , EsppExportValue = "5" } ,
new { Id = new Guid ( "EC8554C8-DEE4-49A1-B1B7-474AD8EC1473" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Июня" , EsppExportValue = "6" } ,
new { Id = new Guid ( "E15C7C63-E29F-41A3-9C82-F70EB6C24FDE" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Июля" , EsppExportValue = "7" } ,
new { Id = new Guid ( "0B1F3CEA-301A-4D74-9CE1-2CD93B41897D" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Августа" , EsppExportValue = "8" } ,
new { Id = new Guid ( "E2FA3769-F66F-4753-A161-35ADAD7717A5" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Сентября" , EsppExportValue = "9" } ,
new { Id = new Guid ( "C1DE4ACA-9F49-48AE-9279-CF9EC4092112" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Октября" , EsppExportValue = "10" } ,
new { Id = new Guid ( "A74B9EBD-BCD8-4537-B371-194DE2FE0A4D" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Ноября" , EsppExportValue = "11" } ,
new { Id = new Guid ( "852A5EBD-4545-494B-BC69-C27409A41ADC" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , Value = "Декабря" , EsppExportValue = "12" }
2023-10-10 15:52:34 +10:00
) ;
} ) ;
modelBuilder . Entity < EsppSchTypeSchedule > ( f = >
{
f . HasData (
new { Id = ( int ) EsppSchTypeScheduleEnum . Regularly , Name = EsppSchTypeScheduleEnum . Regularly . ToString ( ) , Description = "Регулярно" } ,
2023-11-27 09:27:20 +10:00
new { Id = ( int ) EsppSchTypeScheduleEnum . Weekly , Name = EsppSchTypeScheduleEnum . Weekly . ToString ( ) , Description = "Еженедельно" } ,
2023-10-10 15:52:34 +10:00
new { Id = ( int ) EsppSchTypeScheduleEnum . Monthly , Name = EsppSchTypeScheduleEnum . Monthly . ToString ( ) , Description = "Ежемесячно" } ,
new { Id = ( int ) EsppSchTypeScheduleEnum . Monthly2 , Name = EsppSchTypeScheduleEnum . Monthly2 . ToString ( ) , Description = "Ежемесячно-2" } ,
new { Id = ( int ) EsppSchTypeScheduleEnum . Annually , Name = EsppSchTypeScheduleEnum . Annually . ToString ( ) , Description = "Ежегодно" } ,
new { Id = ( int ) EsppSchTypeScheduleEnum . Annually2 , Name = EsppSchTypeScheduleEnum . Annually2 . ToString ( ) , Description = "Ежегодно-2" }
) ;
} ) ;
modelBuilder . Entity < EsppSchTypeConfig > ( f = >
{
f . HasData (
// регулярно через интервал
new { Id = new Guid ( "D2693562-B3EB-41E9-97DB-C6B5D2EF1BEA" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Interval , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Regularly , Order = 0 } ,
// еженедельно
new { Id = new Guid ( "06B2E7AA-6927-4FBF-99FB-67C92A4FCE8A" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Weekly , Order = 0 } ,
// ежемесячно, число месяца
new { Id = new Guid ( "78079071-FF80-417E-9BB0-D928CEC853E7" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Monthly , Order = 0 } ,
// ежемесячно: первый вторник
new { Id = new Guid ( "ACCB1D46-E1C1-4396-9182-4C0766155921" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Order , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Monthly2 , Order = 0 } ,
new { Id = new Guid ( "162FFE73-2428-4ABE-8F83-235C2593664C" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Monthly2 , Order = 1 } ,
// ежегодно: январь, число
new { Id = new Guid ( "8470D1EF-165D-42FC-AB05-8203E4D263CF" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Month , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Annually , Order = 0 } ,
new { Id = new Guid ( "006900B5-F65C-413E-BC67-09E6DAE60B7C" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfMonth , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Annually , Order = 1 } ,
// ежегодно: первый понедельник января
new { Id = new Guid ( "85635BC8-F17A-46B8-9C15-8615761BE3D9" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . Order , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Annually2 , Order = 0 } ,
new { Id = new Guid ( "439460C2-DECA-4B54-80E7-2F20806696EC" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . DayOfWeek , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Annually2 , Order = 1 } ,
new { Id = new Guid ( "5C63AD8C-E9B4-43FD-9D24-5C2EED80DADD" ) , DateCreated = dateCreated , TypeId = ( int ) EsppSchTypeEnum . MonthGenitive , TypeScheduleId = ( int ) EsppSchTypeScheduleEnum . Annually2 , Order = 2 }
) ;
} ) ;
#endregion
2023-12-01 10:05:54 +10:00
#region AgentHistoryLevel
2023-10-19 11:22:35 +10:00
modelBuilder . Entity < AgentHistoryLevel > ( f = >
{
f . HasData (
2023-10-23 13:50:43 +10:00
new { Id = ( int ) AgentHistoryLevelEnum . Start , Name = AgentHistoryLevelEnum . Start . ToString ( ) , Description = "Агент начал выполнять задание" } ,
2023-10-19 11:22:35 +10:00
new { Id = ( int ) AgentHistoryLevelEnum . End , Name = AgentHistoryLevelEnum . End . ToString ( ) , Description = "Агент завершил выполнение задания" }
) ;
} ) ;
2023-12-01 10:05:54 +10:00
#endregion
2023-10-19 11:22:35 +10:00
2023-12-01 10:05:54 +10:00
#region OrderStatus
2023-10-23 16:17:42 +10:00
modelBuilder . Entity < OrderStatus > ( f = >
{
f . HasData (
new { Code = ( int ) OrderStatusEnum . New , Name = OrderStatusEnum . New . ToString ( ) , Description = "1-Направлен в группу" } ,
new { Code = ( int ) OrderStatusEnum . InWork , Name = OrderStatusEnum . InWork . ToString ( ) , Description = "2-В работе" } ,
new { Code = ( int ) OrderStatusEnum . Stop , Name = OrderStatusEnum . Stop . ToString ( ) , Description = "3-Приостановлен" } ,
new { Code = ( int ) OrderStatusEnum . Complete , Name = OrderStatusEnum . Complete . ToString ( ) , Description = "4-Выполнен" } ,
new { Code = ( int ) OrderStatusEnum . Closed , Name = OrderStatusEnum . Closed . ToString ( ) , Description = "5-Закрыт" }
) ;
} ) ;
2023-12-01 10:05:54 +10:00
#endregion
#region Roles
modelBuilder . Entity < Models . Role > ( f = >
{
f . HasData (
new ( ) { Id = new Guid ( "C8F2F144-E6C2-45D7-BA66-5E9BBD376376" ) , DateCreated = dateCreated , Name = ParrRoles . Administrator . Role , Description = ParrRoles . Administrator . Description } ,
new ( ) { Id = new Guid ( "13BCA225-7FA4-42FA-9D80-D2D46DE261FE" ) , DateCreated = dateCreated , Name = ParrRoles . EsppRobot . Role , Description = ParrRoles . EsppRobot . Description }
) ;
} ) ;
#endregion
2023-10-23 16:17:42 +10:00
2023-06-16 15:00:11 +10:00
}
2023-05-17 16:30:13 +10:00
}
}