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 branch 'feature/SELC-5779' into releases/0.4.0_user_fd_notifica…
…tion
- Loading branch information
Showing
73 changed files
with
2,489 additions
and
227 deletions.
There are no files selected for viewing
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
195 changes: 195 additions & 0 deletions
195
...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,195 @@ | ||
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 state; | ||
private String filePath; | ||
private String fileName; | ||
private String contentType; | ||
private String onboardingTokenId; | ||
private String pricingPlan; | ||
private BillingToSend billing; | ||
@JsonSerialize(using = CustomOffsetDateTimeSerializer.class) | ||
private OffsetDateTime createdAt; | ||
@JsonSerialize(using = CustomOffsetDateTimeSerializer.class) | ||
private OffsetDateTime closedAt; | ||
@JsonSerialize(using = CustomOffsetDateTimeSerializer.class) | ||
private OffsetDateTime updatedAt; | ||
private QueueUserEvent notificationType; | ||
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 getState() { | ||
return state; | ||
} | ||
|
||
public void setState(String state) { | ||
this.state = state; | ||
} | ||
|
||
public String getFilePath() { | ||
return filePath; | ||
} | ||
|
||
public void setFilePath(String filePath) { | ||
this.filePath = filePath; | ||
} | ||
|
||
public String getFileName() { | ||
return fileName; | ||
} | ||
|
||
public void setFileName(String fileName) { | ||
this.fileName = fileName; | ||
} | ||
|
||
public String getContentType() { | ||
return this.contentType; | ||
} | ||
|
||
public void setContentType(String contractSigned) { | ||
String contractFileName = Objects.isNull(contractSigned) ? "" : Paths.get(contractSigned).getFileName().toString(); | ||
if (contractFileName.isEmpty()) { | ||
this.contentType = ""; | ||
} else if (contractFileName.endsWith(".p7m")) { | ||
this.contentType = "application/pkcs7-mime"; | ||
} else if (contractFileName.endsWith(".pdf")) { | ||
this.contentType = "application/pdf"; | ||
} else { | ||
this.contentType = "application/octet-stream"; | ||
} | ||
} | ||
|
||
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 QueueUserEvent getNotificationType() { | ||
return notificationType; | ||
} | ||
|
||
public void setNotificationType(QueueUserEvent notificationType) { | ||
this.notificationType = notificationType; | ||
} | ||
|
||
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 getPricingPlan() { | ||
return pricingPlan; | ||
} | ||
|
||
public void setPricingPlan(String pricingPlan) { | ||
this.pricingPlan = pricingPlan; | ||
} | ||
|
||
public BillingToSend getBilling() { | ||
return billing; | ||
} | ||
|
||
public void setBilling(BillingToSend billing) { | ||
this.billing = billing; | ||
} | ||
|
||
public OffsetDateTime getCreatedAt() { | ||
return createdAt; | ||
} | ||
|
||
public void setCreatedAt(OffsetDateTime createdAt) { | ||
this.createdAt = createdAt; | ||
} | ||
|
||
public OffsetDateTime getUpdatedAt() { | ||
return updatedAt; | ||
} | ||
|
||
public void setUpdatedAt(OffsetDateTime 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 + '\'' + | ||
", state='" + state + '\'' + | ||
", filePath='" + filePath + '\'' + | ||
", fileName='" + fileName + '\'' + | ||
", contentType='" + contentType + '\'' + | ||
", onboardingTokenId='" + onboardingTokenId + '\'' + | ||
", pricingPlan='" + pricingPlan + '\'' + | ||
", billing=" + billing + | ||
", createdAt=" + createdAt + | ||
", closedAt=" + closedAt + | ||
", updatedAt=" + updatedAt + | ||
", notificationType=" + notificationType + | ||
", 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 | ||
} |
45 changes: 45 additions & 0 deletions
45
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,45 @@ | ||
package it.pagopa.selfcare.onboarding.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import it.pagopa.selfcare.onboarding.common.PartyRole; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class UserToNotify { | ||
|
||
private String userId; | ||
private String role; | ||
private String productRole; | ||
private String relationshipStatus; | ||
|
||
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 String getProductRole() { | ||
return productRole; | ||
} | ||
|
||
public void setProductRole(String productRole) { | ||
this.productRole = productRole; | ||
} | ||
|
||
public String getRelationshipStatus() { | ||
return relationshipStatus; | ||
} | ||
|
||
public void setRelationshipStatus(String relationshipStatus) { | ||
this.relationshipStatus = relationshipStatus; | ||
} | ||
} |
Oops, something went wrong.