Skip to content

Commit

Permalink
[SELC-4996] feat: remove old message send logic (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSi96 authored Jun 12, 2024
1 parent c43ba7a commit 4eb5a9b
Show file tree
Hide file tree
Showing 39 changed files with 132 additions and 275 deletions.
5 changes: 5 additions & 0 deletions apps/user-ms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
<artifactId>microprofile-metrics-api</artifactId>
<version>5.1.1</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>user-sdk-event</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import it.pagopa.selfcare.azurestorage.AzureBlobClientDefault;
import it.pagopa.selfcare.product.service.ProductService;
import it.pagopa.selfcare.product.service.ProductServiceCacheable;
import it.pagopa.selfcare.user.auth.EventhubSasTokenAuthorization;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.Produces;
import org.eclipse.microprofile.config.inject.ConfigProperty;

@ApplicationScoped
Expand Down Expand Up @@ -39,4 +41,12 @@ public ProductService productService(){
public AzureBlobClient azureBobClientContract(){
return new AzureBlobClientDefault(connectionStringTemplates, containerTemplates);
}

@Produces
@ApplicationScoped
public EventhubSasTokenAuthorization eventhubSasTokenAuthorization(){
return new EventhubSasTokenAuthorization();

}

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import it.pagopa.selfcare.onboarding.common.PartyRole;
import it.pagopa.selfcare.user.constant.OnboardedProductState;
import it.pagopa.selfcare.user.controller.request.AddUserRoleDto;
import it.pagopa.selfcare.user.controller.request.CreateUserDto;
import it.pagopa.selfcare.user.controller.response.*;
import it.pagopa.selfcare.user.controller.response.product.SearchUserDto;
import it.pagopa.selfcare.user.mapper.UserMapper;
import it.pagopa.selfcare.user.model.LoggedUser;
import it.pagopa.selfcare.user.model.UpdateUserRequest;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;
import it.pagopa.selfcare.user.service.UserRegistryService;
import it.pagopa.selfcare.user.service.UserService;
import jakarta.inject.Inject;
Expand Down Expand Up @@ -229,7 +229,7 @@ public Multi<UserInstitutionResponse> retrievePaginatedAndFilteredUser(@QueryPar
public Uni<Response> updateUserRegistryAndSendNotification(@PathParam(value = "id") String userId,
@QueryParam(value = "institutionId") String institutionId,
UpdateUserRequest updateUserRequest) {
return userRegistryService.updateUserRegistryAndSendNotificationToQueue(updateUserRequest, userId, institutionId)
return userRegistryService.updateUserRegistry(updateUserRequest, userId, institutionId)
.map(ignore -> Response
.status(HttpStatus.SC_NO_CONTENT)
.build());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package it.pagopa.selfcare.user.controller.response;

import it.pagopa.selfcare.onboarding.common.Env;
import it.pagopa.selfcare.user.constant.OnboardedProductState;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;
import lombok.Data;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package it.pagopa.selfcare.user.controller.response;

import it.pagopa.selfcare.user.constant.OnboardedProductState;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;
import lombok.Data;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package it.pagopa.selfcare.user.controller.response;

import it.pagopa.selfcare.user.constant.QueueEvent;
import it.pagopa.selfcare.user.model.notification.UserToNotify;

import it.pagopa.selfcare.user.model.UserToNotify;
import it.pagopa.selfcare.user.model.constants.QueueEvent;
import lombok.Data;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import it.pagopa.selfcare.onboarding.common.Env;
import it.pagopa.selfcare.onboarding.common.PartyRole;
import it.pagopa.selfcare.user.constant.OnboardedProductState;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;
import lombok.Data;
import lombok.experimental.FieldNameConstants;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package it.pagopa.selfcare.user.entity;

import it.pagopa.selfcare.onboarding.common.PartyRole;
import it.pagopa.selfcare.user.constant.OnboardedProductState;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;
import lombok.Data;
import lombok.experimental.FieldNameConstants;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package it.pagopa.selfcare.user.mapper;

import it.pagopa.selfcare.user.entity.OnboardedProduct;
import it.pagopa.selfcare.user.model.notification.UserNotificationToSend;
import it.pagopa.selfcare.user.model.notification.UserToNotify;
import it.pagopa.selfcare.user.model.UserNotificationToSend;
import it.pagopa.selfcare.user.model.UserToNotify;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.openapi.quarkus.user_registry_json.model.UserResource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public interface OnboardedProductMapper {

List<OnboardedProductResponse> toList(List<OnboardedProduct> onboardedProducts);

@Mapping(target = "status", expression = "java(it.pagopa.selfcare.user.constant.OnboardedProductState.ACTIVE)")
@Mapping(target = "status", expression = "java(it.pagopa.selfcare.user.model.constants.OnboardedProductState.ACTIVE)")
@Mapping(target = "env", expression = "java(it.pagopa.selfcare.onboarding.common.Env.ROOT)")
@Mapping(target = "createdAt", expression = "java(java.time.LocalDateTime.now())")
@Mapping(target = "updatedAt", expression = "java(java.time.LocalDateTime.now())")
@Mapping(target = "productRole", source = "productRole")
OnboardedProduct toNewOnboardedProduct(CreateUserDto.Product product, String productRole);

@Mapping(target = "status", expression = "java(it.pagopa.selfcare.user.constant.OnboardedProductState.ACTIVE)")
@Mapping(target = "status", expression = "java(it.pagopa.selfcare.user.model.constants.OnboardedProductState.ACTIVE)")
@Mapping(target = "env", expression = "java(it.pagopa.selfcare.onboarding.common.Env.ROOT)")
@Mapping(target = "createdAt", expression = "java(java.time.LocalDateTime.now())")
@Mapping(target = "updatedAt", expression = "java(java.time.LocalDateTime.now())")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package it.pagopa.selfcare.user.mapper;

import it.pagopa.selfcare.user.constant.CollectionUtil;
import it.pagopa.selfcare.user.controller.request.AddUserRoleDto;
import it.pagopa.selfcare.user.controller.request.CreateUserDto;
import it.pagopa.selfcare.user.controller.response.UserInstitutionResponse;
import it.pagopa.selfcare.user.entity.OnboardedProduct;
import it.pagopa.selfcare.user.entity.UserInstitution;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;
import org.bson.types.ObjectId;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
Expand Down Expand Up @@ -81,7 +81,7 @@ default List<OnboardedProduct> toNewOnboardedProductFromAddUserRole(AddUserRoleD
default OnboardedProduct buildOnboardedProduct(){
LocalDateTime now = java.time.LocalDateTime.now();
OnboardedProduct onboardedProduct = new OnboardedProduct();
onboardedProduct.setStatus(it.pagopa.selfcare.user.constant.OnboardedProductState.ACTIVE);
onboardedProduct.setStatus(OnboardedProductState.ACTIVE);
onboardedProduct.setEnv(it.pagopa.selfcare.onboarding.common.Env.ROOT);
onboardedProduct.setCreatedAt(now);
onboardedProduct.setUpdatedAt(now);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package it.pagopa.selfcare.user.mapper;

import it.pagopa.selfcare.onboarding.common.PartyRole;
import it.pagopa.selfcare.user.constant.OnboardedProductState;
import it.pagopa.selfcare.user.controller.request.CreateUserDto;
import it.pagopa.selfcare.user.controller.response.*;
import it.pagopa.selfcare.user.entity.OnboardedProduct;
import it.pagopa.selfcare.user.entity.UserInfo;
import it.pagopa.selfcare.user.entity.UserInstitution;
import it.pagopa.selfcare.user.model.UpdateUserRequest;
import it.pagopa.selfcare.user.model.notification.UserNotificationToSend;
import it.pagopa.selfcare.user.model.UserNotificationToSend;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;
import org.gradle.internal.impldep.org.apache.commons.lang.StringUtils;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package it.pagopa.selfcare.user.model.notification;

import it.pagopa.selfcare.product.entity.Product;
import it.pagopa.selfcare.user.constant.QueueEvent;
import it.pagopa.selfcare.user.entity.UserInstitution;
import it.pagopa.selfcare.user.model.constants.QueueEvent;
import lombok.Builder;
import lombok.Getter;
import org.openapi.quarkus.user_registry_json.model.UserResource;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import it.pagopa.selfcare.onboarding.common.PartyRole;
import it.pagopa.selfcare.user.constant.OnboardedProductState;
import it.pagopa.selfcare.user.constant.PermissionTypeEnum;
import it.pagopa.selfcare.user.controller.request.UpdateDescriptionDto;
import it.pagopa.selfcare.user.controller.response.UserInstitutionResponse;
import it.pagopa.selfcare.user.entity.UserInstitution;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;

import java.time.LocalDateTime;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import it.pagopa.selfcare.onboarding.common.PartyRole;
import it.pagopa.selfcare.user.constant.OnboardedProductState;
import it.pagopa.selfcare.user.constant.PermissionTypeEnum;
import it.pagopa.selfcare.user.constant.SelfCareRole;
import it.pagopa.selfcare.user.controller.request.UpdateDescriptionDto;
Expand All @@ -14,6 +13,7 @@
import it.pagopa.selfcare.user.entity.filter.OnboardedProductFilter;
import it.pagopa.selfcare.user.entity.filter.UserInstitutionFilter;
import it.pagopa.selfcare.user.mapper.UserInstitutionMapper;
import it.pagopa.selfcare.user.model.constants.OnboardedProductState;
import it.pagopa.selfcare.user.util.QueryUtils;
import it.pagopa.selfcare.user.util.UserUtils;
import jakarta.enterprise.context.ApplicationScoped;
Expand All @@ -29,8 +29,8 @@
import java.util.Objects;

import static it.pagopa.selfcare.user.constant.CollectionUtil.*;
import static it.pagopa.selfcare.user.constant.OnboardedProductState.*;
import static it.pagopa.selfcare.user.entity.filter.OnboardedProductFilter.OnboardedProductEnum.*;
import static it.pagopa.selfcare.user.model.constants.OnboardedProductState.*;
import static it.pagopa.selfcare.user.util.GeneralUtils.formatQueryParameterList;

@Slf4j
Expand Down
Loading

0 comments on commit 4eb5a9b

Please sign in to comment.