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.Schedule
{
    /// <summary>
    /// Расписание ЕСПП: Конфигурация типов
    /// </summary>
    [Table("EsppSchTypeConfigs", Schema = DatabaseSchemas.Schedule)]
    [Index(nameof(TypeScheduleId), nameof(TypeId), IsUnique = true)]
    public class EsppSchTypeConfig : IBaseEntity
    {
        [Key]
        public Guid Id { get; set; }

        public DateTimeOffset DateCreated { get; set; }

        public DateTimeOffset? DateModified { get; set; }

        public int TypeScheduleId { get; set; }

        public int TypeId { get; set; }

        public int Order { get; set; }

        [ForeignKey(nameof(TypeId))]
        public EsppSchType? EsppSchType { get; set; }

        [ForeignKey(nameof(TypeScheduleId))]
        public EsppSchTypeSchedule? EsppSchTypeSchedule { get; set; }

        public ICollection<EsppSchValue> EsppSchValues { get; set; } = new HashSet<EsppSchValue>();

    }
}
