Files
mws.backend.dotnet/mws.application/Common/Repositories/IProjectRepository.cs
T
namdh f72aaa2329 Commit MWS backend source tree
The ASP.NET Core solution (mws.api/mws.application/mws.domain/
mws.infrastructure) existed only as untracked working files. Adding
it to version control, plus a .gitignore for build output and local
tooling directories, so the CQRS/mediator refactor plan has a real
git history to branch and diff against.
2026-08-13 23:10:22 +07:00

29 lines
1.8 KiB
C#

using Mws.Domain.Projects;
namespace Mws.Application.Common.Repositories;
public interface IProjectRepository : IRepository<Project>
{
Task<Project?> GetByIdAsync(Guid id, CancellationToken ct = default);
Task<Project?> GetForUserAsync(Guid userId, Guid projectId, CancellationToken ct = default);
Task<List<Project>> GetForUserAsync(Guid userId, CancellationToken ct = default);
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);
Task<List<ProjectMember>> GetMembersWithUserAsync(Guid projectId, CancellationToken ct = default);
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);
}