Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/ recruiter view details of application endpoint fixed #373

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package com.hydraulic.applyforme.controller.recruiter;

import com.hydraulic.applyforme.model.dto.RecruiterCustomDto;
import com.hydraulic.applyforme.model.response.RecruiterApplicantDetails;
import com.hydraulic.applyforme.model.response.base.ApplyForMeResponse;
import com.hydraulic.applyforme.service.RecruiterCustomService;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

import static com.hydraulic.applyforme.constants.PagingConstants.*;
import static com.hydraulic.applyforme.constants.PagingConstants.DEFAULT_SORT_DIRECTION;

Expand Down Expand Up @@ -39,7 +35,10 @@ public ApplyForMeResponse findEntries(

@PreAuthorize("hasAnyRole('Recruiter')")
@GetMapping("/details")
public RecruiterApplicantDetails getDetail(@RequestBody RecruiterCustomDto recruiterCustomDto){
return service.getOne(recruiterCustomDto);
public RecruiterApplicantDetails getDetail(@RequestParam(value="memberid") Long memberid,
@RequestParam(value="role") String role,
@RequestParam(value="salary") String salary,
@RequestParam(value="employement") String employement){
return service.getOne(memberid, role, salary, employement);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package com.hydraulic.applyforme.service;

import com.hydraulic.applyforme.model.dto.RecruiterCustomDto;
import com.hydraulic.applyforme.model.response.RecruiterApplicantDetails;
import com.hydraulic.applyforme.model.response.base.ApplyForMeResponse;

import java.util.Date;

public interface RecruiterCustomService {
RecruiterApplicantDetails getOne(RecruiterCustomDto recruiterCustomDto);
RecruiterApplicantDetails getOne(Long memberid, String role, String salary, String employement);
ApplyForMeResponse getEntries(int pageNo, int pageSize, String sortBy, String sortDir);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.hydraulic.applyforme.model.domain.Member;
import com.hydraulic.applyforme.model.domain.Professional;
import com.hydraulic.applyforme.model.domain.Submission;
import com.hydraulic.applyforme.model.dto.RecruiterCustomDto;
import com.hydraulic.applyforme.model.dto.submission.SubmissionDto;
import com.hydraulic.applyforme.model.exception.MemberNotFoundException;
import com.hydraulic.applyforme.model.response.RecruiterApplicantDetails;
Expand Down Expand Up @@ -98,26 +97,26 @@ private List<SubmissionResponse> getMemberResponse(Collection<Submission> submis
}

@Override
public RecruiterApplicantDetails getOne(RecruiterCustomDto recruiterCustomDto) {
Member member = memberRepository.getOne(recruiterCustomDto.getMemberId());
public RecruiterApplicantDetails getOne(Long memberid, String role, String salary, String employement) {
Member member = memberRepository.getOne(memberid);

if (member == null) {
throw new MemberNotFoundException(recruiterCustomDto.getMemberId());
throw new MemberNotFoundException(memberid);
}

Professional professional = professionalJpaRepository.getProfessional(recruiterCustomDto.getMemberId());
Professional professional = professionalJpaRepository.getProfessional(memberid);

RecruiterApplicantDetails response = RecruiterApplicantDetails.builder()
.name(member.getFirstName()+" "+member.getLastName())
.role(recruiterCustomDto.getRole())
.role(role)
.joinedOn(member.getCreatedOn())
.email(member.getEmailAddress())
.phoneNumber(member.getPhoneNumber())
.membershipPlan("Basic")
.experience(3L)
.industry("Tech")
.salaryExpectation(recruiterCustomDto.getSalary())
.employementType(recruiterCustomDto.getEmployement())
.salaryExpectation(salary)
.employementType(employement)
.cv("Cv of " + member.getFirstName()+".pdf")
.coverLetter("Cover letter of "+member.getFirstName()+".pdf")
.build();
Expand Down