-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added API for get paginated UsersNotification
- Loading branch information
1 parent
343c8a6
commit 72edbb0
Showing
14 changed files
with
283 additions
and
11 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
apps/user-ms/src/main/java/it/pagopa/selfcare/user/constant/CollectionUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...s/src/main/java/it/pagopa/selfcare/user/controller/response/UserNotificationResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package it.pagopa.selfcare.user.controller.response; | ||
|
||
import it.pagopa.selfcare.user.constant.QueueEvent; | ||
import it.pagopa.selfcare.user.model.notification.UserToNotify; | ||
import lombok.Data; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* This objects wrap user's info sent on topic sc-users | ||
*/ | ||
@Data | ||
public class UserNotificationResponse { | ||
|
||
private String id; | ||
private String institutionId; | ||
private String productId; | ||
private String onboardingTokenId; | ||
private LocalDateTime createdAt; | ||
private LocalDateTime updatedAt; | ||
private QueueEvent eventType; | ||
private UserToNotify user; | ||
} |
10 changes: 10 additions & 0 deletions
10
.../src/main/java/it/pagopa/selfcare/user/controller/response/UsersNotificationResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package it.pagopa.selfcare.user.controller.response; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class UsersNotificationResponse { | ||
private List<UserNotificationResponse> users; | ||
} |
29 changes: 29 additions & 0 deletions
29
apps/user-ms/src/main/java/it/pagopa/selfcare/user/mapper/NotificationMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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 org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.openapi.quarkus.user_registry_json.model.UserResource; | ||
|
||
import java.util.UUID; | ||
|
||
@Mapper(componentModel = "cdi", imports = UUID.class) | ||
public interface NotificationMapper { | ||
|
||
@Mapping(source = "onboardedProduct.tokenId", target = "onboardingTokenId") | ||
@Mapping(source = "onboardedProduct.productId", target = "productId") | ||
UserNotificationToSend setNotificationDetailsFromOnboardedProduct(UserToNotify user, OnboardedProduct onboardedProduct, String institutionId); | ||
|
||
|
||
|
||
@Mapping(source = "userResource.id", target = "userId") | ||
@Mapping(source = "userResource.name.value", target = "name") | ||
@Mapping(source = "userResource.familyName.value", target = "familyName") | ||
@Mapping(source = "userResource.email.value", target = "email") | ||
@Mapping(source = "onboardedProduct.role", target = "role") | ||
@Mapping(source = "onboardedProduct.productRole", target = "productRole") | ||
@Mapping(source = "onboardedProduct.status", target = "relationshipStatus") | ||
UserToNotify toUserNotify(UserResource userResource, OnboardedProduct onboardedProduct, String userId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...r-ms/src/main/java/it/pagopa/selfcare/user/model/notification/UserNotificationToSend.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package it.pagopa.selfcare.user.model.notification; | ||
|
||
import it.pagopa.selfcare.user.constant.QueueEvent; | ||
import lombok.Data; | ||
|
||
import java.time.LocalDateTime; | ||
@Data | ||
public class UserNotificationToSend { | ||
|
||
private String id; | ||
private String institutionId; | ||
private String productId; | ||
private String onboardingTokenId; | ||
private LocalDateTime createdAt; | ||
private LocalDateTime updatedAt; | ||
private QueueEvent eventType; | ||
private UserToNotify user; | ||
} |
22 changes: 22 additions & 0 deletions
22
apps/user-ms/src/main/java/it/pagopa/selfcare/user/model/notification/UserToNotify.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package it.pagopa.selfcare.user.model.notification; | ||
|
||
import it.pagopa.selfcare.onboarding.common.PartyRole; | ||
import it.pagopa.selfcare.user.constant.OnboardedProductState; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class UserToNotify { | ||
|
||
private String userId; | ||
private String name; | ||
private String familyName; | ||
private String email; | ||
private PartyRole role; | ||
private String productRole; | ||
private OnboardedProductState relationshipStatus; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.