Table of Contents

Interface IVolunteerApplicationRepository

Namespace
Builvero.Application.Interfaces.Repositories
Assembly
Builvero.Application.dll

Defines the contract for volunteer application data access operations including retrieval, creation, updates, deletion, and querying.

public interface IVolunteerApplicationRepository

Remarks

This repository interface provides methods for managing volunteer application entities. Applications include applicant information, resume metadata, and application status. Applications can be filtered by role and status for administrative review.

Methods

CreateAsync(VolunteerApplication, CancellationToken)

Creates a new volunteer application entity in the database.

Task<VolunteerApplication> CreateAsync(VolunteerApplication application, CancellationToken cancellationToken = default)

Parameters

application VolunteerApplication

The volunteer application entity to create.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<VolunteerApplication>

The created volunteer application entity with generated ID and timestamps.

DeleteAsync(Guid, CancellationToken)

Deletes a volunteer application entity from the database (GDPR compliance - right to be forgotten).

Task<bool> DeleteAsync(Guid id, CancellationToken cancellationToken = default)

Parameters

id Guid

The unique identifier of the application to delete.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<bool>

True if the application was successfully deleted; otherwise, false.

EmailExistsAsync(string, CancellationToken)

Checks if a volunteer application with the specified email address exists in the database.

Task<bool> EmailExistsAsync(string email, CancellationToken cancellationToken = default)

Parameters

email string

The email address to check.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<bool>

True if an application with the email exists; otherwise, false.

Remarks

Used for client-side validation to prevent duplicate applications with the same email address.

GetApplicationsAsync(int, int, Guid?, ApplicationStatus?, CancellationToken)

Retrieves a paginated list of volunteer applications with optional filtering by role and status.

Task<List<VolunteerApplication>> GetApplicationsAsync(int page, int pageSize, Guid? roleId = null, ApplicationStatus? status = null, CancellationToken cancellationToken = default)

Parameters

page int

The page number (1-based) to retrieve.

pageSize int

The number of applications per page.

roleId Guid?

Optional role ID filter to retrieve applications for a specific role.

status ApplicationStatus?

Optional status filter (e.g., New, Reviewed, Accepted).

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<List<VolunteerApplication>>

A list of volunteer applications matching the filters.

GetApplicationsCountAsync(Guid?, ApplicationStatus?, CancellationToken)

Gets the total count of volunteer applications matching the specified filters.

Task<int> GetApplicationsCountAsync(Guid? roleId = null, ApplicationStatus? status = null, CancellationToken cancellationToken = default)

Parameters

roleId Guid?

Optional role ID filter to count applications for a specific role.

status ApplicationStatus?

Optional status filter (e.g., New, Reviewed, Accepted).

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<int>

The total count of applications matching the filters.

GetByIdAsync(Guid, CancellationToken)

Retrieves a volunteer application by its unique identifier.

Task<VolunteerApplication?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default)

Parameters

id Guid

The unique identifier of the application to retrieve.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<VolunteerApplication>

The volunteer application entity if found; otherwise, null.

UpdateAsync(VolunteerApplication, CancellationToken)

Updates an existing volunteer application entity in the database.

Task<VolunteerApplication> UpdateAsync(VolunteerApplication application, CancellationToken cancellationToken = default)

Parameters

application VolunteerApplication

The volunteer application entity with updated values.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<VolunteerApplication>

The updated volunteer application entity.