generated from pagopa/pagopa-functions-template
-
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.
Merge back from hotfix send user fd notification (#559)
Co-authored-by: empassaro <emanuele.passaro@emeal.nttdata.com>
- Loading branch information
1 parent
e9c0e50
commit d4c3668
Showing
17 changed files
with
732 additions
and
99 deletions.
There are no files selected for viewing
120 changes: 120 additions & 0 deletions
120
...ing-functions/src/main/java/it/pagopa/selfcare/onboarding/dto/NotificationUserToSend.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,120 @@ | ||
package it.pagopa.selfcare.onboarding.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import it.pagopa.selfcare.onboarding.utils.CustomOffsetDateTimeSerializer; | ||
|
||
import java.nio.file.Paths; | ||
import java.time.OffsetDateTime; | ||
import java.util.Objects; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class NotificationUserToSend { | ||
|
||
private String id; | ||
private String institutionId; | ||
private String product; | ||
|
||
private String onboardingTokenId; | ||
|
||
private String createdAt; | ||
@JsonSerialize(using = CustomOffsetDateTimeSerializer.class) | ||
private OffsetDateTime closedAt; | ||
|
||
private String updatedAt; | ||
|
||
private NotificationUserType type; | ||
private UserToNotify user; | ||
|
||
|
||
public String getInstitutionId() { | ||
return institutionId; | ||
} | ||
|
||
public void setInstitutionId(String institutionId) { | ||
this.institutionId = institutionId; | ||
} | ||
|
||
|
||
public NotificationUserType getType() { | ||
return type; | ||
} | ||
|
||
public void setType(NotificationUserType type) { | ||
this.type = type; | ||
} | ||
|
||
|
||
public String getOnboardingTokenId() { | ||
return onboardingTokenId; | ||
} | ||
|
||
public void setOnboardingTokenId(String onboardingTokenId) { | ||
this.onboardingTokenId = onboardingTokenId; | ||
} | ||
|
||
public OffsetDateTime getClosedAt() { | ||
return closedAt; | ||
} | ||
|
||
public void setClosedAt(OffsetDateTime closedAt) { | ||
this.closedAt = closedAt; | ||
} | ||
|
||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getProduct() { | ||
return product; | ||
} | ||
|
||
public void setProduct(String product) { | ||
this.product = product; | ||
} | ||
|
||
|
||
public String getCreatedAt() { | ||
return createdAt; | ||
} | ||
|
||
public void setCreatedAt(String createdAt) { | ||
this.createdAt = createdAt; | ||
} | ||
|
||
public String getUpdatedAt() { | ||
return updatedAt; | ||
} | ||
|
||
public void setUpdatedAt(String updatedAt) { | ||
this.updatedAt = updatedAt; | ||
} | ||
|
||
public UserToNotify getUser() { | ||
return user; | ||
} | ||
|
||
public void setUser(UserToNotify user) { | ||
this.user = user; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "NotificationToSend{" + | ||
"id='" + id + '\'' + | ||
", institutionId='" + institutionId + '\'' + | ||
", product='" + product + '\'' + | ||
", onboardingTokenId='" + onboardingTokenId + '\'' + | ||
", createdAt=" + createdAt + | ||
", closedAt=" + closedAt + | ||
", updatedAt=" + updatedAt + | ||
", userId=" + user.getUserId() + | ||
'}'; | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...rding-functions/src/main/java/it/pagopa/selfcare/onboarding/dto/NotificationUserType.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,25 @@ | ||
package it.pagopa.selfcare.onboarding.dto; | ||
|
||
public enum NotificationUserType { | ||
ADD_INSTITUTE(QueueUserEvent.ADD_INSTITUTE), | ||
UPDATE_INSTITUTION(QueueUserEvent.UPDATE_INSTITUTION), | ||
ACTIVE_USER(QueueUserEvent.ACTIVE_USER), | ||
SUSPEND_USER(QueueUserEvent.SUSPEND_USER), | ||
DELETE_USER(QueueUserEvent.DELETE_USER); | ||
|
||
|
||
private final QueueUserEvent queueUserEvent; | ||
|
||
NotificationUserType(QueueUserEvent queueUserEvent) { | ||
this.queueUserEvent = queueUserEvent; | ||
} | ||
|
||
public static NotificationUserType getNotificationTypeFromQueueEvent(QueueUserEvent queueEvent) { | ||
for (NotificationUserType notificationType : NotificationUserType.values()) { | ||
if (notificationType.queueUserEvent == queueEvent) { | ||
return notificationType; | ||
} | ||
} | ||
return null; // Return null if no matching NotificationType is found | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
.../onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/dto/QueueUserEvent.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,9 @@ | ||
package it.pagopa.selfcare.onboarding.dto; | ||
|
||
public enum QueueUserEvent { | ||
ADD_INSTITUTE, | ||
UPDATE_INSTITUTION, | ||
ACTIVE_USER, | ||
SUSPEND_USER, | ||
DELETE_USER | ||
} |
38 changes: 38 additions & 0 deletions
38
apps/onboarding-functions/src/main/java/it/pagopa/selfcare/onboarding/dto/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,38 @@ | ||
package it.pagopa.selfcare.onboarding.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import it.pagopa.selfcare.onboarding.common.PartyRole; | ||
|
||
import java.util.List; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class UserToNotify { | ||
|
||
private String userId; | ||
private String role; | ||
private List<String> roles; | ||
|
||
public String getUserId() { | ||
return userId; | ||
} | ||
|
||
public void setUserId(String userId) { | ||
this.userId = userId; | ||
} | ||
|
||
public String getRole() { | ||
return role; | ||
} | ||
|
||
public void setRole(String role) { | ||
this.role = role; | ||
} | ||
|
||
public List<String> getRoles() { | ||
return roles; | ||
} | ||
|
||
public void setRoles(List<String> roles) { | ||
this.roles = roles; | ||
} | ||
} |
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.