File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
src/main/kotlin/land/leets/domain/interview Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import java.time.LocalDateTime
99@Entity(name = " interviews" )
1010class Interview (
1111 @OneToOne
12+ @JoinColumn(name = " application_id" , foreignKey = ForeignKey (ConstraintMode .NO_CONSTRAINT ))
1213 val application : Application ,
1314
1415 @Column(columnDefinition = " char(10)" )
Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ class CreateInterviewImpl(
1818 val application = applicationRepository.findById(request.applicationId)
1919 .orElseThrow { ApplicationNotFoundException () }
2020
21+ val existingInterview = interviewRepository.findByApplication(application)
22+ if (existingInterview != null ) {
23+ existingInterview.fixedInterviewDate = request.fixedInterviewDate
24+ existingInterview.place = request.place
25+ return interviewRepository.save(existingInterview)
26+ }
27+
2128 val interview = Interview (
2229 application = application,
2330 fixedInterviewDate = request.fixedInterviewDate,
You can’t perform that action at this time.
0 commit comments