using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;

namespace Elwig.Models.Entities {
    [Table("delivery_schedule_wine_variety"), PrimaryKey("Year", "DsNr", "SortId")]
    public class DeliveryScheduleWineVar {

        [Column("year")]
        public int Year { get; set; }

        [Column("dsnr")]
        public int DsNr { get; set; }

        [Column("sortid")]
        public required string SortId { get; set; }

        [Column("priority")]
        public int Priority { get; set; }

        [ForeignKey("Year, DsNr")]
        public virtual DeliverySchedule Schedule { get; private set; } = null!;

        [ForeignKey("SortId")]
        public virtual WineVar Variety { get; private set; } = null!;
    }
}
