Interface IProjectJoinRequestService
- Namespace
- Builvero.Application.Services
- Assembly
- Builvero.Application.dll
Defines the contract for project join request operations including creation, response, cancellation, and retrieval.
public interface IProjectJoinRequestService
Remarks
This interface provides methods for managing project join requests:
- Creating join requests to join projects
- Responding to join requests (approve/decline) by project owners
- Responding to join requests via secure token (email links)
- Canceling pending join requests
- Retrieving incoming requests (for project owners)
- Retrieving outgoing requests (for requesters)
Methods
CancelRequestAsync(Guid, Guid, CancellationToken)
Cancels a pending join request (requester only).
Task<ProjectJoinRequestDto> CancelRequestAsync(Guid requestId, Guid cancellerUserId, CancellationToken cancellationToken = default)
Parameters
requestIdGuidThe unique identifier of the join request to cancel.
cancellerUserIdGuidThe unique identifier of the user canceling the request (must be the requester).
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequestDto>
The canceled join request DTO.
GetIncomingRequestsAsync(Guid, CancellationToken)
Retrieves all incoming join requests for projects owned by the specified user.
Task<List<ProjectJoinRequestDto>> GetIncomingRequestsAsync(Guid ownerUserId, CancellationToken cancellationToken = default)
Parameters
ownerUserIdGuidThe unique identifier of the project owner.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<List<ProjectJoinRequestDto>>
A list of incoming join request DTOs.
GetOutgoingRequestsAsync(Guid, CancellationToken)
Retrieves all outgoing join requests created by the specified user.
Task<List<ProjectJoinRequestDto>> 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<ProjectJoinRequestDto>>
A list of outgoing join request DTOs.
RequestJoinAsync(Guid, Guid, string?, CancellationToken)
Creates a new join request for a user to join a project.
Task<ProjectJoinRequestDto> RequestJoinAsync(Guid projectId, Guid requesterUserId, string? message, CancellationToken cancellationToken = default)
Parameters
projectIdGuidThe unique identifier of the project to join.
requesterUserIdGuidThe unique identifier of the user requesting to join.
messagestringOptional message explaining why the user wants to join.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequestDto>
The created join request DTO.
RespondToRequestAsync(Guid, Guid, bool, string?, CancellationToken)
Responds to a join request (approve or decline) by the project owner.
Task<ProjectJoinRequestDto> RespondToRequestAsync(Guid requestId, Guid ownerUserId, bool approve, string? reason, CancellationToken cancellationToken = default)
Parameters
requestIdGuidThe unique identifier of the join request to respond to.
ownerUserIdGuidThe unique identifier of the project owner responding.
approveboolTrue to approve the request; false to decline.
reasonstringOptional reason for approving or declining.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequestDto>
The updated join request DTO.
RespondToRequestByTokenAsync(string, bool, string?, CancellationToken)
Responds to a join request via secure token (public endpoint, no authentication required).
Task<ProjectJoinRequestDto> RespondToRequestByTokenAsync(string token, bool approve, string? reason, CancellationToken cancellationToken = default)
Parameters
tokenstringThe secure token from the join request email.
approveboolTrue to approve the request; false to decline.
reasonstringOptional reason for approving or declining.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectJoinRequestDto>
The updated join request DTO.