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.
87 lines
2.3 KiB
C#
87 lines
2.3 KiB
C#
using PortBlog.API.Entities;
|
|
|
|
namespace PortBlog.API.Repositories.Contracts
|
|
{
|
|
public interface IResumeRepository
|
|
{
|
|
Task<Resume?> GetLatestResumeForCandidateAsync(int candidateId, bool includeOtherData = false);
|
|
|
|
Task<Resume?> GetHobbiesAsync(int candidateId);
|
|
|
|
Task<Resume?> GetResumeAsync(int candidateId);
|
|
|
|
Task<Resume?> GetCandidateWithSocialLinksAsync(int candidateId);
|
|
|
|
Task<Resume?> GetProjectsAsync(int candidateId);
|
|
|
|
Task<Blog?> GetBlogAsync(int candidate);
|
|
|
|
// Added for admin write operations used by controllers
|
|
Task<Resume?> GetByIdAsync(int resumeId);
|
|
|
|
Task<Resume?> GetByIdWithCollectionsAsync(int resumeId);
|
|
|
|
Task<Project?> GetProjectAsync(int projectId);
|
|
|
|
Task<Hobby?> GetHobbyAsync(int hobbyId);
|
|
|
|
Task<IEnumerable<Hobby>> GetHobbiesByResumeIdAsync(int resumeId);
|
|
|
|
Task<Candidate?> GetCandidateByIdAsync(int candidateId);
|
|
|
|
void AddProject(Project project);
|
|
|
|
void UpdateProject(Project project);
|
|
|
|
void RemoveProject(Project project);
|
|
|
|
void AddHobby(Hobby hobby);
|
|
|
|
void UpdateHobby(Hobby hobby);
|
|
|
|
void RemoveHobby(Hobby hobby);
|
|
|
|
void AddSkill(Skill skill);
|
|
|
|
void UpdateSkill(Skill skill);
|
|
|
|
void RemoveSkill(Skill skill);
|
|
|
|
void AddAcademic(Academic academic);
|
|
|
|
void UpdateAcademic(Academic academic);
|
|
|
|
void RemoveAcademic(Academic academic);
|
|
|
|
void AddExperience(Experience experience);
|
|
|
|
void UpdateExperience(Experience experience);
|
|
|
|
void RemoveExperience(Experience experience);
|
|
|
|
void AddExperienceDetails(ExperienceDetails details);
|
|
|
|
void UpdateExperienceDetails(ExperienceDetails details);
|
|
|
|
void RemoveExperienceDetails(ExperienceDetails details);
|
|
|
|
void AddCertification(Certification certification);
|
|
|
|
void UpdateCertification(Certification certification);
|
|
|
|
void RemoveCertification(Certification certification);
|
|
|
|
void AddResume(Resume resume);
|
|
|
|
void UpdateResume(Resume resume);
|
|
|
|
void UpdateCandidate(Candidate candidate);
|
|
|
|
void AddSocialLink(SocialLinks socialLink);
|
|
|
|
void UpdateSocialLink(SocialLinks socialLink);
|
|
|
|
Task<bool> SaveChangesAsync();
|
|
}
|
|
}
|