Add user management domain and seed model
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Permission : Template
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Role : Template
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Level { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class RolePermission : Template
|
||||
{
|
||||
public Guid FK_RoleId { get; set; }
|
||||
[ForeignKey("FK_RoleId")]
|
||||
public Role Role { get; set; }
|
||||
|
||||
public Guid FK_PermissionId { get; set; }
|
||||
[ForeignKey("FK_PermissionId")]
|
||||
public Permission Permission { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Distribution.Models
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Route : Template
|
||||
{
|
||||
@@ -6,5 +8,9 @@
|
||||
public String StartPoint { get; set; }
|
||||
public String EndPoint { get; set; }
|
||||
public decimal Length { get; set; } = 0;
|
||||
|
||||
public Guid FK_RegionId { get; set; }
|
||||
[ForeignKey("FK_RegionId")]
|
||||
public Region Region { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Distribution.Models
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class Store : Template
|
||||
{
|
||||
@@ -9,5 +11,9 @@
|
||||
public decimal Longitude { get; set; } = 0;
|
||||
public decimal OneTimeAmount { get; set; } = 0;
|
||||
public decimal CreditAmount { get; set; } = 0;
|
||||
|
||||
public Guid FK_RouteId { get; set; }
|
||||
[ForeignKey("FK_RouteId")]
|
||||
public Route Route { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class User : Template
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string PasswordHash { get; set; }
|
||||
public string FullName { get; set; }
|
||||
|
||||
public Guid FK_RoleId { get; set; }
|
||||
[ForeignKey("FK_RoleId")]
|
||||
public Role Role { get; set; }
|
||||
|
||||
public Guid? FK_ReportsToUserId { get; set; }
|
||||
[ForeignKey("FK_ReportsToUserId")]
|
||||
public User ReportsTo { get; set; }
|
||||
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class UserRegionScope : Template
|
||||
{
|
||||
public Guid FK_UserId { get; set; }
|
||||
[ForeignKey("FK_UserId")]
|
||||
public User User { get; set; }
|
||||
|
||||
public Guid FK_RegionId { get; set; }
|
||||
[ForeignKey("FK_RegionId")]
|
||||
public Region Region { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class UserRouteScope : Template
|
||||
{
|
||||
public Guid FK_UserId { get; set; }
|
||||
[ForeignKey("FK_UserId")]
|
||||
public User User { get; set; }
|
||||
|
||||
public Guid FK_RouteId { get; set; }
|
||||
[ForeignKey("FK_RouteId")]
|
||||
public Route Route { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Distribution.Models
|
||||
{
|
||||
public class UserStoreScope : Template
|
||||
{
|
||||
public Guid FK_UserId { get; set; }
|
||||
[ForeignKey("FK_UserId")]
|
||||
public User User { get; set; }
|
||||
|
||||
public Guid FK_StoreId { get; set; }
|
||||
[ForeignKey("FK_StoreId")]
|
||||
public Store Store { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user