using System; using System.ComponentModel.DataAnnotations.Schema; using System.Xml.Serialization; using Jellyfin.Data.Enums; namespace Jellyfin.Data.Entities { /// /// An entity representing a user's access schedule. /// public class AccessSchedule { /// /// Initializes a new instance of the class. /// /// The day of the week. /// The start hour. /// The end hour. /// The associated user's id. public AccessSchedule(DynamicDayOfWeek dayOfWeek, double startHour, double endHour, Guid userId) { UserId = userId; DayOfWeek = dayOfWeek; StartHour = startHour; EndHour = endHour; } /// /// Gets the id of this instance. /// /// /// Identity, Indexed, Required. /// [XmlIgnore] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; private set; } /// /// Gets the id of the associated user. /// [XmlIgnore] public Guid UserId { get; private set; } /// /// Gets or sets the day of week. /// /// The day of week. public DynamicDayOfWeek DayOfWeek { get; set; } /// /// Gets or sets the start hour. /// /// The start hour. public double StartHour { get; set; } /// /// Gets or sets the end hour. /// /// The end hour. public double EndHour { get; set; } } }