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
applicationVolunteerApplicationThe volunteer application entity to create.
cancellationTokenCancellationTokenCancellation 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
idGuidThe unique identifier of the application to delete.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
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
emailstringThe email address to check.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
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
pageintThe page number (1-based) to retrieve.
pageSizeintThe number of applications per page.
roleIdGuid?Optional role ID filter to retrieve applications for a specific role.
statusApplicationStatus?Optional status filter (e.g., New, Reviewed, Accepted).
cancellationTokenCancellationTokenCancellation 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
roleIdGuid?Optional role ID filter to count applications for a specific role.
statusApplicationStatus?Optional status filter (e.g., New, Reviewed, Accepted).
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
GetByIdAsync(Guid, CancellationToken)
Retrieves a volunteer application by its unique identifier.
Task<VolunteerApplication?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default)
Parameters
idGuidThe unique identifier of the application to retrieve.
cancellationTokenCancellationTokenCancellation 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
applicationVolunteerApplicationThe volunteer application entity with updated values.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<VolunteerApplication>
The updated volunteer application entity.