Interface IProjectJoinRequestRepository
- Namespace
- Builvero.Application.Interfaces.Repositories
- Assembly
- Builvero.Application.dll
Defines the contract for project join request data access operations including retrieval, creation, updates, and querying.
public interface IProjectJoinRequestRepository
Remarks
This repository interface provides methods for managing project join request entities. Join requests include secure tokens for email-based approval/decline without requiring login. Join requests expire after 30 days.
Methods
CreateAsync(ProjectJoinRequest, CancellationToken)
Creates a new project join request entity in the database.
Task<ProjectJoinRequest> CreateAsync(ProjectJoinRequest request, CancellationToken cancellationToken = default)
Parameters
requestProjectJoinRequestThe project join request entity to create.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequest>
The created project join request entity with generated ID, token, and timestamps.
GetByIdAsync(Guid, CancellationToken)
Retrieves a project join request by its unique identifier.
Task<ProjectJoinRequest?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default)
Parameters
idGuidThe unique identifier of the join request to retrieve.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequest>
The project join request entity if found; otherwise, null.
GetByTokenAsync(string, CancellationToken)
Retrieves a project join request by its secure token (used for email-based approval/decline).
Task<ProjectJoinRequest?> GetByTokenAsync(string token, CancellationToken cancellationToken = default)
Parameters
tokenstringThe secure token from the join request email.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequest>
The project join request entity if found; otherwise, null.
GetIncomingRequestsAsync(Guid, CancellationToken)
Retrieves all incoming join requests for projects owned by a specific user.
Task<List<ProjectJoinRequest>> GetIncomingRequestsAsync(Guid ownerUserId, CancellationToken cancellationToken = default)
Parameters
ownerUserIdGuidThe unique identifier of the project owner.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<List<ProjectJoinRequest>>
A list of incoming join requests for projects owned by the user.
GetOutgoingRequestsAsync(Guid, CancellationToken)
Retrieves all outgoing join requests created by a specific user.
Task<List<ProjectJoinRequest>> GetOutgoingRequestsAsync(Guid userId, CancellationToken cancellationToken = default)
Parameters
userIdGuidThe unique identifier of the user who created the requests.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<List<ProjectJoinRequest>>
A list of outgoing join requests created by the user.
GetPendingRequestAsync(Guid, Guid, CancellationToken)
Retrieves a pending join request for a specific project and user combination.
Task<ProjectJoinRequest?> GetPendingRequestAsync(Guid projectId, Guid requesterUserId, CancellationToken cancellationToken = default)
Parameters
projectIdGuidThe unique identifier of the project.
requesterUserIdGuidThe unique identifier of the user who created the request.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequest>
The pending join request if found; otherwise, null.
Remarks
Used to check if a pending join request already exists before creating a new one.
UpdateAsync(ProjectJoinRequest, CancellationToken)
Updates an existing project join request entity in the database.
Task<ProjectJoinRequest> UpdateAsync(ProjectJoinRequest request, CancellationToken cancellationToken = default)
Parameters
requestProjectJoinRequestThe project join request entity with updated values.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequest>
The updated project join request entity.