using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace NotaryNet.Models
{
/// <summary>
/// Registration Database Structure.
/// </summary>
/// <remarks>
/// 1. Company name during registration must be unique. Not allow same company name to be registered.
/// 2. Initial registered user is automatically assigned to the Admin Role and they can register/create additional users as needed.
/// A. If any additional user accounts are created by the Admin, they will be added to the Users role.
/// 3. Each SystemUser has their own respective information about them in the SystemUsersInfo table.
///
/// 1. Company and SystemUsers share a PK (CompanyID) and FK (CompanyID) relationship.
/// 2. SystemUsers and SystemUsersInfo share a PK (UserID) and FK (UserID) relationship.
/// </remarks>
[Table("Companies")]
public class Register
{
[Key]
public int CompanyID { get; set; }
public string CompanyName { get; set; }
public bool IsActive { get; set; }
public virtual ICollection<SystemUsers> SystemUsers { get; set; }
}
[Table("SystemUsers")]
public class SystemUsers
{
[Key]
public int UserID { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public bool IsActive { get; set; }
[ForeignKey("CompanyID")]
public virtual ICollection<SystemUserInfo> SystemUserInfo { get; set; }
}
[Table("SystemUserInfo")]
public class SystemUserInfo
{
[Key]
public int SystemUserInfoID { get; set; }
public string NamePrefix { get; set; }
public string FirstName { get; set; }
public string? MiddleInitial { get; set; }
public string LastName { get; set; }
public string? NameSuffix { get; set; }
[ForeignKey("UseID")]
}
}