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

namespace PARR.DAL.Models.Unit
{
    [Table("FieldValues", Schema = DataContextSettings.Unit)]
    [Comment("Значения полей ЭК")]
    [Index(nameof(Value), IsUnique = true)]
    public class UnitFieldValue : IBase
    {
        [Key]
        public Guid Id { get; set; }

        public DateTimeOffset DateCreated { get; set; }

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

        public string? Value { get; set; }


        public ICollection<UnitInValue> UnitInValues { get; set; } = new HashSet<UnitInValue>();

        public ICollection<UnitFieldInUnitFieldValue> FieldValues { get; set; } = new HashSet<UnitFieldInUnitFieldValue>();

        public UnitRegionalEkPtkGroup? RegionalEkPtkGroup { get; set; }
    }
}
