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

RI-205: ajoute le champ posted_by a job posting #213

Merged
merged 13 commits into from
Dec 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Expand Up @@ -29,6 +29,8 @@ public JobPostingDto toDto(JobPosting model) {
.contractType(model.getContractType())
.createdAt(model.getCreatedAt())
.archive(model.isArchive())
.posterName(model.getPoster().getUsername())
.posterId(model.getPoster().getId())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ public class JobPostingDto {
private Instant createdAt;
private boolean archive;
private boolean apply;

private Long posterId;
private String posterName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ public class JobPosting {

@Column(columnDefinition = "boolean default false")
private boolean archive;

@Column(name = "posted_by")
private User poster;
PaFlu-SDV marked this conversation as resolved.
Show resolved Hide resolved

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public JobPostingDto createJob(JobPostingDto jobPostingDto) {

JobPosting jobPosting = jobPostingAdapter.toModel(jobPostingDto);
jobPosting.setCreatedAt(Instant.now());
jobPosting.setPoster(authService.getCurrentUser());
JobPosting jobSaved = jobPostingRepository.save(jobPosting);
return jobPostingAdapter.toDto(jobSaved);
}
Expand Down