Table of Contents

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

request ProjectJoinRequest

The project join request entity to create.

cancellationToken CancellationToken

Cancellation 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

id Guid

The unique identifier of the join request to retrieve.

cancellationToken CancellationToken

Cancellation 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

token string

The secure token from the join request email.

cancellationToken CancellationToken

Cancellation 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

ownerUserId Guid

The unique identifier of the project owner.

cancellationToken CancellationToken

Cancellation 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

userId Guid

The unique identifier of the user who created the requests.

cancellationToken CancellationToken

Cancellation 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

projectId Guid

The unique identifier of the project.

requesterUserId Guid

The unique identifier of the user who created the request.

cancellationToken CancellationToken

Cancellation 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

request ProjectJoinRequest

The project join request entity with updated values.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<ProjectJoinRequest>

The updated project join request entity.