using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models.Base;
using PARR.DAL.Models.Unit;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace PARR.DAL.Models.Job
{
    [Table("FieldFilters", Schema = DataContextSettings.Job)]
    [Comment("Таблица описания критериев выборки аттрибутов ЭК")]
    public class JobFieldFilter : IBase
    {
        [Key]
        public Guid Id { get; set; }

        public DateTimeOffset DateCreated { get; set; }

        public DateTimeOffset? DateModified { get; set; }

        public Guid UnitFilterId { get; set; }

        public Guid FieldId { get; set; }

        public required string ValueMask { get; set; }

        /// <summary>
        /// Отсутствует
        /// </summary>
        public bool IsInverse { get; set; } = false;


        [ForeignKey(nameof(FieldId))]
        public UnitField? UnitField { get; set; }

        [ForeignKey(nameof(UnitFilterId))]
        public JobUnitFilter? UnitFilter { get; set; }
    }
}
