Table of Contents

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)
Join requests include secure tokens for email-based approval/decline without requiring login. Join requests expire after 30 days if not responded to.

Methods

CancelRequestAsync(Guid, Guid, CancellationToken)

Cancels a pending join request (requester only).

Task<ProjectJoinRequestDto> CancelRequestAsync(Guid requestId, Guid cancellerUserId, CancellationToken cancellationToken = default)

Parameters

requestId Guid

The unique identifier of the join request to cancel.

cancellerUserId Guid

The unique identifier of the user canceling the request (must be the requester).

cancellationToken CancellationToken

Cancellation 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

ownerUserId Guid

The unique identifier of the project owner.

cancellationToken CancellationToken

Cancellation 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

userId Guid

The unique identifier of the user who created the requests.

cancellationToken CancellationToken

Cancellation 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

projectId Guid

The unique identifier of the project to join.

requesterUserId Guid

The unique identifier of the user requesting to join.

message string

Optional message explaining why the user wants to join.

cancellationToken CancellationToken

Cancellation 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

requestId Guid

The unique identifier of the join request to respond to.

ownerUserId Guid

The unique identifier of the project owner responding.

approve bool

True to approve the request; false to decline.

reason string

Optional reason for approving or declining.

cancellationToken CancellationToken

Cancellation 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

token string

The secure token from the join request email.

approve bool

True to approve the request; false to decline.

reason string

Optional reason for approving or declining.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ProjectJoinRequestDto>

The updated join request DTO.