Files
mws.backend.dotnet/application/Projects/Contracts.cs
T

87 lines
2.7 KiB
C#
Raw Normal View History

2026-09-20 16:21:15 +07:00
using mws.backend.dotnet.application.Audit;
2026-08-19 23:25:08 +07:00
using mws.backend.dotnet.domain.Projects;
2026-08-13 23:10:22 +07:00
2026-08-19 23:25:08 +07:00
namespace mws.backend.dotnet.application.Projects;
2026-08-13 23:10:22 +07:00
public class CreateProjectRequest
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
}
public class UpdateProjectRequest
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public ProjectStatus Status { get; set; } = ProjectStatus.Active;
}
public class AddMemberRequest
{
public Guid UserId { get; set; }
public MemberRole Role { get; set; } = MemberRole.Member;
}
public class ProjectMemberDto
{
public Guid UserId { get; set; }
public string Username { get; set; } = string.Empty;
public string DisplayName { get; set; } = string.Empty;
public MemberRole Role { get; set; }
public bool CanViewDocuments { get; set; }
public bool CanCreateDocuments { get; set; }
public bool CanEditDocuments { get; set; }
public bool CanDeleteDocuments { get; set; }
}
public class UpdateMemberDocumentPermissionsRequest
{
public bool CanViewDocuments { get; set; }
public bool CanCreateDocuments { get; set; }
public bool CanEditDocuments { get; set; }
public bool CanDeleteDocuments { get; set; }
}
2026-09-20 16:21:15 +07:00
public class ProjectDto : IHasEntityId
2026-08-13 23:10:22 +07:00
{
public Guid Id { get; set; }
2026-09-20 16:21:15 +07:00
public Guid EntityId => Id;
2026-08-13 23:10:22 +07:00
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public ProjectStatus Status { get; set; }
2026-08-19 23:25:08 +07:00
public Guid CreatedBy { get; set; }
public string CreatedByName { get; set; } = string.Empty;
2026-08-13 23:10:22 +07:00
public DateTime CreatedAt { get; set; }
2026-08-19 23:25:08 +07:00
public Guid? UpdatedBy { get; set; }
public string? UpdatedByName { get; set; }
2026-08-13 23:10:22 +07:00
public DateTime UpdatedAt { get; set; }
}
public class ProjectOverviewDto
{
public ProjectDto Project { get; set; } = null!;
public int MemberCount { get; set; }
public int DocumentCount { get; set; }
public Dictionary<string, int> TaskCountsByStatus { get; set; } = [];
public List<RecentTaskDto> RecentTasks { get; set; } = [];
public List<RecentDocumentDto> RecentDocuments { get; set; } = [];
}
public class RecentTaskDto
{
public Guid Id { get; set; }
public string Title { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public DateTime UpdatedAt { get; set; }
}
public class RecentDocumentDto
{
public Guid Id { get; set; }
public string Title { get; set; } = string.Empty;
public DateTime UpdatedAt { get; set; }
2026-09-13 18:02:09 +07:00
}
public record ProjectListFilter(Guid UserId, string? Term, ProjectStatus? Status, string? CreatedBy, string? UpdatedBy);
public record MemberListFilter(string? Term, MemberRole? Role);