2020-05-15 21:24:01 +00:00
|
|
|
|
using System;
|
2020-05-13 02:10:35 +00:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2020-05-27 01:20:55 +00:00
|
|
|
|
using System.Xml.Serialization;
|
2020-05-13 02:10:35 +00:00
|
|
|
|
using Jellyfin.Data.Enums;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Data.Entities
|
|
|
|
|
{
|
2020-05-23 00:20:18 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// An entity representing a user's access schedule.
|
|
|
|
|
/// </summary>
|
2020-05-13 02:10:35 +00:00
|
|
|
|
public class AccessSchedule
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="AccessSchedule"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dayOfWeek">The day of the week.</param>
|
|
|
|
|
/// <param name="startHour">The start hour.</param>
|
|
|
|
|
/// <param name="endHour">The end hour.</param>
|
2020-05-23 00:20:18 +00:00
|
|
|
|
/// <param name="userId">The associated user's id.</param>
|
2020-05-15 21:24:01 +00:00
|
|
|
|
public AccessSchedule(DynamicDayOfWeek dayOfWeek, double startHour, double endHour, Guid userId)
|
2020-05-13 02:10:35 +00:00
|
|
|
|
{
|
2020-05-15 21:24:01 +00:00
|
|
|
|
UserId = userId;
|
2020-05-13 02:10:35 +00:00
|
|
|
|
DayOfWeek = dayOfWeek;
|
|
|
|
|
StartHour = startHour;
|
|
|
|
|
EndHour = endHour;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-23 00:20:18 +00:00
|
|
|
|
/// <summary>
|
2021-03-17 23:08:11 +00:00
|
|
|
|
/// Gets the id of this instance.
|
2020-05-23 00:20:18 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Identity, Indexed, Required.
|
|
|
|
|
/// </remarks>
|
2020-05-27 01:20:55 +00:00
|
|
|
|
[XmlIgnore]
|
2020-05-13 02:10:35 +00:00
|
|
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
2021-03-17 23:08:11 +00:00
|
|
|
|
public int Id { get; private set; }
|
2020-05-15 21:24:01 +00:00
|
|
|
|
|
2020-05-23 00:20:18 +00:00
|
|
|
|
/// <summary>
|
2021-03-17 23:08:11 +00:00
|
|
|
|
/// Gets the id of the associated user.
|
2020-05-23 00:20:18 +00:00
|
|
|
|
/// </summary>
|
2020-05-27 01:20:55 +00:00
|
|
|
|
[XmlIgnore]
|
2021-03-17 23:08:11 +00:00
|
|
|
|
public Guid UserId { get; private set; }
|
2020-05-13 02:10:35 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the day of week.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The day of week.</value>
|
|
|
|
|
public DynamicDayOfWeek DayOfWeek { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the start hour.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The start hour.</value>
|
|
|
|
|
public double StartHour { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the end hour.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The end hour.</value>
|
|
|
|
|
public double EndHour { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|