FlexitimeTracker/FlexitimeUI/Flexitime.DataAccess/Objects/UserDb.cs
2023-04-11 20:17:20 +01:00

62 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Flexitime.DataAccess.Objects
{
public class UserDb
{
public UserDb()
{
AssociatedIdentifiers = new List<IdentifierDb>();
Groups = new List<GroupDb>();
DirectReports = new List<UserDb>();
Permissions = new List<PermissionDb>();
}
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public double HoursPerWeek { get; set; }
public bool IsContractor { get; set; }
public int AssociatedIdentifierCount => AssociatedIdentifiers.Count;
public DateTime LastEventDateTime { get; set; }
public List<IdentifierDb> AssociatedIdentifiers { get; set; }
//TODO: Is this that the user is in the group or this is their groups?
public List<GroupDb> Groups { get; set; }
public int State { get; set; }
public Guid? TeamId { get; set; }
/// <summary>
/// user that belongs to team
/// </summary>
/// <remarks>differs from Groups in that a group is a symbolic collection where a team is a publicly identifiable entity</remarks>
public TeamDb Team { get; set; }
/// <summary>
/// Id of the Users Line Manager
/// </summary>
public UserDb LineManager { get; set; }
/// <summary>
/// Ids of the users direct reports
/// </summary>
public List<UserDb> DirectReports { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public List<PermissionDb> Permissions { get; set; }
}
}