Major refactor of AdminController and related services to support full CRUD for candidate resume, projects, hobbies, skills, academics, experiences, certifications, and contact info, all using access token claims for candidate identity. Introduced AdminService and expanded IResumeRepository for granular entity management. Updated DTOs for upsert operations and date support. Improved API versioning (Asp.Versioning.Mvc), Swagger integration, and middleware setup. Added unit test project. Enhanced error handling, documentation, and mapping.
38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
using System.Security.Claims;
|
|
using PortBlog.API.Models;
|
|
|
|
namespace PortBlog.API.Services.Contracts
|
|
{
|
|
/// <summary>
|
|
/// Service for administrative operations related to candidates, resumes, and their associated data.
|
|
/// </summary>
|
|
public interface IAdminService
|
|
{
|
|
int GetCandidateIdFromClaims(ClaimsPrincipal user);
|
|
|
|
Task<AboutDto?> GetHobbiesAsync(int candidateId);
|
|
|
|
Task<CandidateSocialLinksDto?> GetContactAsync(int candidateId);
|
|
|
|
Task<ResumeDto?> GetResumeAsync(int candidateId);
|
|
|
|
Task<ProjectsDto?> GetProjectsAsync(int candidateId);
|
|
|
|
Task<ProjectDto> UpsertProjectAsync(int candidateId, ProjectDto projectDto);
|
|
|
|
Task<bool> DeleteProjectAsync(int candidateId, int projectId);
|
|
|
|
Task<AboutDto> UpsertHobbiesAsync(int candidateId, AboutDto aboutDto);
|
|
|
|
Task<IEnumerable<SkillDto>> UpsertSkillsAsync(int candidateId, IEnumerable<SkillDto> skillDtos);
|
|
|
|
Task<IEnumerable<AcademicDto>> UpsertAcademicsAsync(int candidateId, IEnumerable<AcademicDto> academicDtos);
|
|
|
|
Task<IEnumerable<ExperienceDto>> UpsertExperiencesAsync(int candidateId, IEnumerable<ExperienceDto> experienceDtos);
|
|
|
|
Task<IEnumerable<CertificationDto>> UpsertCertificationsAsync(int candidateId, IEnumerable<CertificationDto> certificationDtos);
|
|
|
|
Task<CandidateSocialLinksDto> UpsertContactAsync(int candidateId, CandidateSocialLinksDto contactDto);
|
|
}
|
|
}
|