feat(core,dal,domain,snapshotWorker): Воркер по управлению снапшотами. Создание сгапшотов для таблицы RobotConfigurations
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -17,5 +18,7 @@ namespace PARR.Domain.Entities
|
||||
|
||||
|
||||
public ICollection<RobotConfiguration> RobotConfigurations { get; set; } = new HashSet<RobotConfiguration>();
|
||||
|
||||
public ICollection<RobotConfigurationSnapshot> ConfigurationSnapshots { get; set; } = new HashSet<RobotConfigurationSnapshot>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using PARR.Domain.Entities.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.RobotEntities
|
||||
{
|
||||
/// <summary>
|
||||
/// Снимки заданий роботам
|
||||
/// </summary>
|
||||
[Table("ConfigurationSnapshots", Schema = DatabaseSchemas.Robot)]
|
||||
[Index(nameof(RobotCode), nameof(DateCreated))]
|
||||
[Comment("Снимки заданий роботам")]
|
||||
public class RobotConfigurationSnapshot : IBaseEntity
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
|
||||
public int RobotCode { get; set; }
|
||||
|
||||
public int RobotStatusCode { get; set; }
|
||||
|
||||
public int TaskStatusCode { get; set; }
|
||||
|
||||
[Comment("Количество заданий в этой комбинации статусов")]
|
||||
public int Count { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(RobotCode))]
|
||||
public Robot? Robot { get; set; }
|
||||
|
||||
[ForeignKey(nameof(RobotStatusCode))]
|
||||
public RobotStatus? RobotStatus { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TaskStatusCode))]
|
||||
public TaskStatus? TaskStatus { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities
|
||||
@@ -19,5 +20,7 @@ namespace PARR.Domain.Entities
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public ICollection<RobotConfiguration> RobotConfigurations { get; set; } = new HashSet<RobotConfiguration>();
|
||||
|
||||
public ICollection<RobotConfigurationSnapshot> ConfigurationSnapshots { get; set; } = new HashSet<RobotConfigurationSnapshot>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using PARR.Domain.Entities.RobotEntities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities
|
||||
@@ -21,5 +22,7 @@ namespace PARR.Domain.Entities
|
||||
public ICollection<RobotConfiguration> RobotConfigurations { get; set; } = new HashSet<RobotConfiguration>();
|
||||
|
||||
public ICollection<RobotHistory> RobotHistories { get; set; } = new HashSet<RobotHistory>();
|
||||
|
||||
public ICollection<RobotConfigurationSnapshot> ConfigurationSnapshots { get; set; } = new HashSet<RobotConfigurationSnapshot>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user