Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
SELC-5170: fix for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenbegiqi committed Jul 5, 2024
1 parent f37347f commit 48a4fa7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Objects;

@Slf4j
@Component
Expand All @@ -31,13 +32,13 @@ public boolean findAndDeletePecNotification(String institutionId, String product

List<PecNotificationEntity> pecNotificationEntityList = repository.find(query, PecNotificationEntity.class);

if(null != pecNotificationEntityList && pecNotificationEntityList.size() == 1) {
if(Objects.nonNull(pecNotificationEntityList) && pecNotificationEntityList.size() == 1) {
repository.delete(pecNotificationEntityList.get(0));
log.trace("Deleted PecNotification with institutionId: {} and productId: {}", institutionId, productId);
return true;
}

if (null != pecNotificationEntityList && pecNotificationEntityList.size() > 1) {
if (Objects.nonNull(pecNotificationEntityList) && pecNotificationEntityList.size() > 1) {
log.trace("Cannot delete PecNotification with institutionId: {} and productId: {}, because there are multiple entries", institutionId, productId);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
public interface PecNotificationEntityMapper {

@Mapping(target = "id", defaultExpression = "java(UUID.randomUUID().toString())")
@Mapping(target = "institutionId", defaultExpression = "java(UUID.randomUUID().toString())")
PecNotificationEntity convertToPecNotificationEntity(PecNotification institution);

PecNotification convertToPecNotification(PecNotificationEntity entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public ResponseEntity<InstitutionResponse> onboardingInstitution(@RequestBody @V

@ResponseStatus(HttpStatus.NO_CONTENT)
@ApiOperation(value = "${swagger.mscore.onboarding.users.delete}", notes = "${swagger.mscore.onboarding.users.delete}")
@DeleteMapping(value = "/{id}/{productId}", produces = MediaType.APPLICATION_JSON_VALUE)
@DeleteMapping(value = "/{id}/products/{productId}", produces = MediaType.APPLICATION_JSON_VALUE)
public void deleteOnboardedInstitution(@PathVariable("productId") String productId,
@PathVariable("id") String institutionId) {

Expand Down
2 changes: 1 addition & 1 deletion web/src/main/resources/swagger/swagger_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ swagger.mscore.institution.relationships=returns the relationships related to th
swagger.mscore.onboarding.operator=performs operators onboarding on an already existing institution
swagger.mscore.onboarding.subdelegates=performs subdelegates onboarding on an already existing institution
swagger.mscore.onboarding.users=The service adds users to the registry if they are not present and associates them with the institution and product contained in the body
swagger.mscore.onboarding.users.delete=The service delete the users changing the user status to 'DELETE' and remove from DB the PecNotification record by productId and institutionId
swagger.mscore.onboarding.users.delete=The service set DELETE status on onboarding association with the product and institutionId
swagger.mscore.onboarding.legals=performs legals onboarding on an already existing institution
swagger.mscore.relationships=Gets the corresponding relationship
swagger.mscore.relationship.delete=Given a relationship identifier, it deletes the corresponding relationship
Expand Down

0 comments on commit 48a4fa7

Please sign in to comment.