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.Job
{
    [Table("UnitFilters", Schema = DatabaseSchemas.Job)]
    [Comment("Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП")]
    public class JobUnitFilter : IBaseEntity
    {
        [Key]
        public Guid Id { get; set; }

        public DateTimeOffset DateCreated { get; set; }

        [NotMapped]
        public DateTimeOffset? DateModified { get; set; }

        public required string UnitFilter { get; set; }

        public Guid JobId { get; set; }


        [ForeignKey(nameof(JobId))]
        public Job? Job { get; set; }

        public ICollection<JobFieldFilter> FieldFilters { get; set; } = new HashSet<JobFieldFilter>();

        public ICollection<JobRelationshipFilter> RelationshipFilters { get; set; } = new HashSet<JobRelationshipFilter>();
    }
}
