using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static Managing.Common.Enums;

namespace Managing.Infrastructure.Databases.PostgreSql.Entities;

[Table("Workers")]
public class WorkerEntity
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Id { get; set; }

    [Required]
    public WorkerType WorkerType { get; set; }

    [Required]
    public DateTime StartTime { get; set; }

    public DateTime? LastRunTime { get; set; }

    [Required]
    public int ExecutionCount { get; set; }

    [Required]
    public long DelayTicks { get; set; } // TimeSpan is not supported, store as ticks

    [Required]
    public bool IsActive { get; set; }
} 