ref: project structure
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
namespace mws.backend.dotnet.domain.Documents;
|
||||
|
||||
public enum DocumentType
|
||||
{
|
||||
Folder = 1,
|
||||
Document = 2,
|
||||
}
|
||||
|
||||
public class Document
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProjectId { get; set; }
|
||||
public Guid? ParentId { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string? Content { get; set; }
|
||||
public DocumentType Type { get; set; } = DocumentType.Document;
|
||||
public Guid CreatedBy { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid? UpdatedBy { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
public Document? Parent { get; set; }
|
||||
public List<Document> Children { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace mws.backend.dotnet.domain.MasterData;
|
||||
|
||||
public class MasterDataEntry
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Group { get; set; } = string.Empty;
|
||||
public string Label { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public int SortOrder { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace mws.backend.dotnet.domain.Projects;
|
||||
|
||||
public enum ProjectStatus
|
||||
{
|
||||
Active = 1,
|
||||
Archived = 2,
|
||||
}
|
||||
|
||||
public class Project
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
public ProjectStatus Status { get; set; } = ProjectStatus.Active;
|
||||
public Guid CreatedBy { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid? UpdatedBy { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
public List<ProjectMember> Members { get; set; } = [];
|
||||
|
||||
public mws.backend.dotnet.domain.Users.User? CreatedByUser { get; set; }
|
||||
public mws.backend.dotnet.domain.Users.User? UpdatedByUser { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace mws.backend.dotnet.domain.Projects;
|
||||
|
||||
public enum MemberRole
|
||||
{
|
||||
Owner = 1,
|
||||
Member = 2,
|
||||
}
|
||||
|
||||
public class ProjectMember
|
||||
{
|
||||
public Guid ProjectId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public MemberRole Role { get; set; } = MemberRole.Member;
|
||||
|
||||
public Project Project { get; set; } = null!;
|
||||
public mws.backend.dotnet.domain.Users.User User { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace mws.backend.dotnet.domain.Projects;
|
||||
|
||||
public static class ProjectPermissionScreens
|
||||
{
|
||||
public const string Documents = "documents";
|
||||
}
|
||||
|
||||
public class ProjectMemberPermission
|
||||
{
|
||||
public Guid ProjectId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Screen { get; set; } = string.Empty;
|
||||
public bool CanView { get; set; }
|
||||
public bool CanCreate { get; set; }
|
||||
public bool CanEdit { get; set; }
|
||||
public bool CanDelete { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace mws.backend.dotnet.domain.Roles;
|
||||
|
||||
public class Role
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public bool IsSystem { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
public List<RolePermission> Permissions { get; set; } = [];
|
||||
public List<mws.backend.dotnet.domain.Users.UserRole> UserRoles { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace mws.backend.dotnet.domain.Roles;
|
||||
|
||||
public class RolePermission
|
||||
{
|
||||
public Guid RoleId { get; set; }
|
||||
public string Screen { get; set; } = string.Empty;
|
||||
public bool CanView { get; set; }
|
||||
public bool CanCreate { get; set; }
|
||||
public bool CanEdit { get; set; }
|
||||
public bool CanDelete { get; set; }
|
||||
|
||||
public Role Role { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
namespace mws.backend.dotnet.domain.Tasks;
|
||||
|
||||
public enum TaskStatus
|
||||
{
|
||||
Todo = 1,
|
||||
InProgress = 2,
|
||||
Done = 3,
|
||||
Cancelled = 4,
|
||||
}
|
||||
|
||||
public enum TaskPriority
|
||||
{
|
||||
Low = 1,
|
||||
Medium = 2,
|
||||
High = 3,
|
||||
}
|
||||
|
||||
public class TaskItem
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProjectId { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string? Description { get; set; }
|
||||
public TaskStatus Status { get; set; } = TaskStatus.Todo;
|
||||
public TaskPriority Priority { get; set; } = TaskPriority.Medium;
|
||||
public Guid? AssigneeId { get; set; }
|
||||
public DateTime? DueDate { get; set; }
|
||||
public Guid CreatedBy { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
public mws.backend.dotnet.domain.Users.User? Assignee { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using mws.backend.dotnet.domain.Roles;
|
||||
|
||||
namespace mws.backend.dotnet.domain.Users;
|
||||
|
||||
public class User
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Username { get; set; } = string.Empty;
|
||||
public string PasswordHash { get; set; } = string.Empty;
|
||||
public string DisplayName { get; set; } = string.Empty;
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public List<UserRole> UserRoles { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using mws.backend.dotnet.domain.Roles;
|
||||
|
||||
namespace mws.backend.dotnet.domain.Users;
|
||||
|
||||
public class UserRole
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public Guid RoleId { get; set; }
|
||||
|
||||
public User User { get; set; } = null!;
|
||||
public Role Role { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>mws.backend.dotnet.domain</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user