Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
examsAndAdmissions
Commits
d8bf4efe
Commit
d8bf4efe
authored
1 year ago
by
Radheshhathwar
Browse files
Options
Download
Patches
Plain Diff
Changes for assign alternative examCenter
parent
9a6d4443
github/fork/ruksana2808/filter_bug_examCycle
development
1 merge request
!191
Changes for assign alternative examCenter
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/tarento/upsmf/examsAndAdmissions/model/ExamCenter.java
+11
-0
...om/tarento/upsmf/examsAndAdmissions/model/ExamCenter.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/ExamCenterService.java
+2
-2
...o/upsmf/examsAndAdmissions/service/ExamCenterService.java
with
13 additions
and
2 deletions
+13
-2
src/main/java/com/tarento/upsmf/examsAndAdmissions/model/ExamCenter.java
+
11
−
0
View file @
d8bf4efe
package
com.tarento.upsmf.examsAndAdmissions.model
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.tarento.upsmf.examsAndAdmissions.enums.ApprovalStatus
;
import
lombok.*
;
...
...
@@ -43,6 +44,16 @@ public class ExamCenter {
private
Boolean
alternateExamCenterAssigned
=
false
;
@OneToOne
@JoinColumn
(
name
=
"alternate_exam_center_id"
)
// @JsonIgnore // Ignore this field during JSON serialization
private
ExamCenter
alternateExamCenter
;
@Override
public
String
toString
()
{
return
"ExamCenter{"
+
"id="
+
id
+
", name='"
+
name
+
'\''
+
// ... (other fields)
", alternateExamCenter="
+
(
alternateExamCenter
!=
null
?
alternateExamCenter
.
getId
()
:
null
)
+
// Handle alternateExamCenter to break the cyclic reference
'}'
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/ExamCenterService.java
+
2
−
2
View file @
d8bf4efe
...
...
@@ -78,13 +78,13 @@ public class ExamCenterService {
// Set the alternate exam center for the unverified exam center
unverifiedExamCenter
.
setAlternateExamCenter
(
alternateExamCenter
);
unverifiedExamCenter
.
setAlternateExamCenterAssigned
(
true
);
examCenterRepository
.
save
(
unverifiedExamCenter
);
unverifiedExamCenter
=
examCenterRepository
.
save
(
unverifiedExamCenter
);
// Save the updated registrations
List
<
StudentExamRegistration
>
updatedRegistrations
=
studentExamRegistrationRepository
.
saveAll
(
affectedRegistrations
);
response
.
put
(
"message"
,
"Alternate Exam Center assigned successfully."
);
response
.
put
(
Constants
.
RESPONSE
,
u
pdatedRegistrations
);
response
.
put
(
Constants
.
RESPONSE
,
u
nverifiedExamCenter
);
response
.
setResponseCode
(
HttpStatus
.
OK
);
}
}
catch
(
EntityNotFoundException
e
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets