2026-08-19 23:25:08 +07:00
|
|
|
using mws.backend.dotnet.application.Common;
|
|
|
|
|
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.Common.Repositories;
|
2026-08-13 23:10:22 +07:00
|
|
|
|
|
|
|
|
public interface IProjectRepository : IRepository<Project>
|
|
|
|
|
{
|
|
|
|
|
Task<Project?> GetByIdAsync(Guid id, CancellationToken ct = default);
|
|
|
|
|
Task<Project?> GetForUserAsync(Guid userId, Guid projectId, CancellationToken ct = default);
|
2026-08-19 23:25:08 +07:00
|
|
|
Task<PagedResult<Project>> GetForUserAsync(Guid userId, int page, int pageSize, CancellationToken ct = default);
|
2026-08-13 23:10:22 +07:00
|
|
|
Task<List<Project>> SearchForUserAsync(Guid userId, string? term, CancellationToken ct = default);
|
|
|
|
|
Task<int> CountMembersAsync(Guid projectId, CancellationToken ct = default);
|
|
|
|
|
|
|
|
|
|
Task<bool> IsMemberAsync(Guid projectId, Guid userId, CancellationToken ct = default);
|
|
|
|
|
Task<MemberRole?> GetMemberRoleAsync(Guid projectId, Guid userId, CancellationToken ct = default);
|
|
|
|
|
Task<ProjectMember?> GetMemberAsync(Guid projectId, Guid userId, CancellationToken ct = default);
|
|
|
|
|
Task<ProjectMember?> GetMemberWithUserAsync(Guid projectId, Guid userId, CancellationToken ct = default);
|
2026-08-19 23:25:08 +07:00
|
|
|
Task<PagedResult<ProjectMember>> GetMembersWithUserAsync(Guid projectId, int page, int pageSize, CancellationToken ct = default);
|
2026-08-13 23:10:22 +07:00
|
|
|
Task<int> CountOwnersAsync(Guid projectId, CancellationToken ct = default);
|
|
|
|
|
Task<List<Guid>> GetProjectIdsForUserAsync(Guid userId, CancellationToken ct = default);
|
|
|
|
|
Task<List<Guid>> GetOwnedProjectIdsAsync(Guid userId, CancellationToken ct = default);
|
|
|
|
|
Task<List<Guid>> GetDocumentViewableProjectIdsAsync(Guid userId, CancellationToken ct = default);
|
|
|
|
|
void AddMember(ProjectMember member);
|
|
|
|
|
void RemoveMember(ProjectMember member);
|
|
|
|
|
|
|
|
|
|
Task<ProjectMemberPermission?> GetMemberPermissionAsync(Guid projectId, Guid userId, string screen, CancellationToken ct = default);
|
|
|
|
|
Task<Dictionary<Guid, ProjectMemberPermission>> GetMemberPermissionsAsync(Guid projectId, string screen, CancellationToken ct = default);
|
|
|
|
|
void AddMemberPermission(ProjectMemberPermission permission);
|
|
|
|
|
}
|