-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat update curriculummembership api #1043
base: main
Are you sure you want to change the base?
Conversation
e068655
to
2ed80c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I feel not very clear is whether the field TIS_ProgrammeMembership_ID*
in the template is for update or for validation.
* @param curriculumMembershipDto the dto to patch | ||
* @return the ResponseEntity with status 200 (OK) and with body the patched dto | ||
*/ | ||
@PatchMapping("/curriculum-membership") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Pepe suggested using the plural format: https://hee-nhs-tis.slack.com/archives/C03GBMYGZD4/p1736356584130419?thread_ts=1736352700.784459&cid=C03GBMYGZD4
- Just want to check with you.
patch
requests are not going to be logged in the AuditingAspect class, are you okay with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Ok thanks. I will go for plural format.
- Yeah, looks like it is, patch requests are not logged in because we don't have patch enum here in the GenericAuditEventType class. We also need to write a pointcut and advice (that might be a new Jira ticket, what do you think?) Patch was used earlier in ProgrammeMembership update. So I went for patch because of this AC "Given I have left some of the column empty on the template
When the template is uploaded
Then existing TIS values should not be overwritten with blanks."
@Transactional | ||
public CurriculumMembershipDTO patch(CurriculumMembershipDTO cmDto) { | ||
log.debug("Request to patch CurriculumMembership : {}", cmDto); | ||
CurriculumMembershipDTO curriculumMembershipDtoFromDb = findOne(cmDto.getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the explanation on Sonar. Any method marked with @Transactional
seems to be executed asynchronously, so it suggets to use a injected instance to invoke it rather than this
.
public CurriculumMembershipDTO patch(CurriculumMembershipDTO cmDto) { | ||
log.debug("Request to patch CurriculumMembership : {}", cmDto); | ||
CurriculumMembershipDTO curriculumMembershipDtoFromDb = findOne(cmDto.getId()); | ||
if (curriculumMembershipDtoFromDb == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only place curriculumMembershipDtoFromDb
is used, but I thought you would update it with the dto got from the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
...n/java/com/transformuk/hee/tis/tcs/service/service/impl/CurriculumMembershipServiceImpl.java
Show resolved
Hide resolved
tcs-client/src/main/java/com/transformuk/hee/tis/tcs/client/service/impl/TcsServiceImpl.java
Outdated
Show resolved
Hide resolved
6d7f575
to
69450f9
Compare
69450f9
to
53c6c5b
Compare
Checked with James and Ade. It is for validation only. The confluence page also says so. |
ba8cc3e
to
9b09123
Compare
9b09123
to
0d5d7a5
Compare
Quality Gate passedIssues Measures |
This end point is required by the Bulk Upload service for updating curriculum memberships.
TIS21-3819