| | | 1 | | using System; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | using System.Xml.Serialization; |
| | | 4 | | using Jellyfin.Database.Implementations.Enums; |
| | | 5 | | |
| | | 6 | | namespace Jellyfin.Database.Implementations.Entities |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// An entity representing a user's access schedule. |
| | | 10 | | /// </summary> |
| | | 11 | | public class AccessSchedule |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Initializes a new instance of the <see cref="AccessSchedule"/> class. |
| | | 15 | | /// </summary> |
| | | 16 | | /// <param name="dayOfWeek">The day of the week.</param> |
| | | 17 | | /// <param name="startHour">The start hour.</param> |
| | | 18 | | /// <param name="endHour">The end hour.</param> |
| | | 19 | | /// <param name="userId">The associated user's id.</param> |
| | | 20 | | public AccessSchedule(DynamicDayOfWeek dayOfWeek, double startHour, double endHour, Guid userId) |
| | | 21 | | { |
| | 10 | 22 | | UserId = userId; |
| | 10 | 23 | | DayOfWeek = dayOfWeek; |
| | 10 | 24 | | StartHour = startHour; |
| | 10 | 25 | | EndHour = endHour; |
| | 10 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Gets the id of this instance. |
| | | 30 | | /// </summary> |
| | | 31 | | /// <remarks> |
| | | 32 | | /// Identity, Indexed, Required. |
| | | 33 | | /// </remarks> |
| | | 34 | | [XmlIgnore] |
| | | 35 | | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
| | | 36 | | public int Id { get; private set; } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// Gets the id of the associated user. |
| | | 40 | | /// </summary> |
| | | 41 | | [XmlIgnore] |
| | | 42 | | public Guid UserId { get; private set; } |
| | | 43 | | |
| | | 44 | | /// <summary> |
| | | 45 | | /// Gets or sets the day of week. |
| | | 46 | | /// </summary> |
| | | 47 | | /// <value>The day of week.</value> |
| | | 48 | | public DynamicDayOfWeek DayOfWeek { get; set; } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// Gets or sets the start hour. |
| | | 52 | | /// </summary> |
| | | 53 | | /// <value>The start hour.</value> |
| | | 54 | | public double StartHour { get; set; } |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// Gets or sets the end hour. |
| | | 58 | | /// </summary> |
| | | 59 | | /// <value>The end hour.</value> |
| | | 60 | | public double EndHour { get; set; } |
| | | 61 | | } |
| | | 62 | | } |