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

        [ForeignKey(nameof(JobGroupId))]
        public JobGroup? JobGroup { get; set; }

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

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