74 lines
2.1 KiB
C#
74 lines
2.1 KiB
C#
using Microsoft.EntityFrameworkCore;
|
||
using PARR.DAL.Models.Base;
|
||
using System.ComponentModel.DataAnnotations;
|
||
using System.ComponentModel.DataAnnotations.Schema;
|
||
|
||
namespace PARR.DAL.Models
|
||
{
|
||
[Table("Templates")]
|
||
[Index(nameof(Name), IsUnique = true)]
|
||
public class Template : IBase
|
||
{
|
||
[Key]
|
||
public Guid Id { get; set; }
|
||
|
||
public DateTimeOffset DateCreated { get; set; }
|
||
|
||
public DateTimeOffset? DateModified { get; set; }
|
||
|
||
public required string Name { get; set; }
|
||
|
||
public bool IsActiveTemplate { get; set; }
|
||
|
||
public bool IsActiveSchedule { get; set; }
|
||
|
||
#region удалить эти поля
|
||
|
||
/// <summary>
|
||
/// Статус шаблона. Что нужно сделать роботу в ЕСПП
|
||
/// </summary>
|
||
public int? StatusCode { get; set; }
|
||
|
||
/// <summary>
|
||
/// Статус работы робота
|
||
/// </summary>
|
||
public int? RobotStatusCode { get; set; }
|
||
|
||
/// <summary>
|
||
/// Количество попыток выполнения задания роботом
|
||
/// </summary>
|
||
public int? RobotAttemptsNumber { get; set; }
|
||
|
||
/// <summary>
|
||
/// Последняя дата обновления статуса RobotStatusCode роботом
|
||
/// </summary>
|
||
public DateTimeOffset? RobotLastStatusUpdated { get; set; }
|
||
|
||
|
||
[ForeignKey(nameof(StatusCode))]
|
||
public TaskStatus? StatusTask { get; set; }
|
||
|
||
[ForeignKey(nameof(RobotStatusCode))]
|
||
public RobotStatus? RobotStatus { get; set; }
|
||
|
||
public ICollection<RobotTemplateHistory> RobotTemplateHistories { get; set; } = new HashSet<RobotTemplateHistory>();
|
||
|
||
#endregion
|
||
|
||
|
||
public Guid ApplicationInWorkId { get; set; }
|
||
|
||
[ForeignKey(nameof(ApplicationInWorkId))]
|
||
public ApplicationsInWork? ApplicationsInWork { get; set; }
|
||
|
||
|
||
public Guid HostId { get; set; }
|
||
|
||
[ForeignKey(nameof(HostId))]
|
||
public Host? Host { get; set; }
|
||
|
||
public ICollection<RobotConfiguration> RobotConfigurations { get; set; } = new HashSet<RobotConfiguration>();
|
||
|
||
}
|
||
}
|