Skip to content

Commit

Permalink
[SELC-5615] feat: added create attachment function (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
gianmarcoplutino authored Nov 27, 2024
1 parent a4ac1d6 commit 1ad9fde
Show file tree
Hide file tree
Showing 28 changed files with 4,013 additions and 2,606 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package it.pagopa.selfcare.onboarding.event.entity;

import lombok.Data;

@Data
public class BusinessData {
private String businessRegisterNumber;
private String legalRegisterNumber;
private String legalRegisterName;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package it.pagopa.selfcare.onboarding.event.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class GPUData extends BusinessData {

private boolean manager;
private boolean managerAuthorized;
private boolean managerEligible;
private boolean managerProsecution;
private boolean institutionCourtMeasures;

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package it.pagopa.selfcare.onboarding.event.entity;

import lombok.Data;

import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
public class PaymentServiceProvider {
@EqualsAndHashCode(callSuper = true)
public class PaymentServiceProvider extends BusinessData {
private String abiCode;
private String businessRegisterNumber;
private String legalRegisterNumber;
private String legalRegisterName;
private boolean vatNumberGroup;
private String contractType;
private String contractId;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package it.pagopa.selfcare.onboarding.entity;

public class BusinessData {

private String businessRegisterNumber;
private String legalRegisterNumber;
private String legalRegisterName;

public String getBusinessRegisterNumber() {
return businessRegisterNumber;
}

public void setBusinessRegisterNumber(String businessRegisterNumber) {
this.businessRegisterNumber = businessRegisterNumber;
}

public String getLegalRegisterNumber() {
return legalRegisterNumber;
}

public void setLegalRegisterNumber(String legalRegisterNumber) {
this.legalRegisterNumber = legalRegisterNumber;
}

public String getLegalRegisterName() {
return legalRegisterName;
}

public void setLegalRegisterName(String legalRegisterName) {
this.legalRegisterName = legalRegisterName;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package it.pagopa.selfcare.onboarding.entity;

public class GPUData extends BusinessData {

private boolean manager;
private boolean managerAuthorized;
private boolean managerEligible;
private boolean managerProsecution;
private boolean institutionCourtMeasures;

public boolean isManager() {
return manager;
}

public void setManager(boolean manager) {
this.manager = manager;
}

public boolean isManagerAuthorized() {
return managerAuthorized;
}

public void setManagerAuthorized(boolean managerAuthorized) {
this.managerAuthorized = managerAuthorized;
}

public boolean isManagerEligible() {
return managerEligible;
}

public void setManagerEligible(boolean managerEligible) {
this.managerEligible = managerEligible;
}

public boolean isManagerProsecution() {
return managerProsecution;
}

public void setManagerProsecution(boolean managerProsecution) {
this.managerProsecution = managerProsecution;
}

public boolean isInstitutionCourtMeasures() {
return institutionCourtMeasures;
}

public void setInstitutionCourtMeasures(boolean institutionCourtMeasures) {
this.institutionCourtMeasures = institutionCourtMeasures;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import it.pagopa.selfcare.onboarding.common.InstitutionPaSubunitType;
import it.pagopa.selfcare.onboarding.common.InstitutionType;
import it.pagopa.selfcare.onboarding.common.Origin;
import org.bson.codecs.pojo.annotations.BsonProperty;

import java.util.List;
import org.bson.codecs.pojo.annotations.BsonProperty;

public class Institution {

Expand Down Expand Up @@ -39,6 +38,7 @@ public class Institution {

private PaymentServiceProvider paymentServiceProvider;
private DataProtectionOfficer dataProtectionOfficer;
private GPUData gpuData;
private String parentDescription;

public InstitutionType getInstitutionType() {
Expand Down Expand Up @@ -233,6 +233,14 @@ public void setParentDescription(String parentDescription) {
this.parentDescription = parentDescription;
}

public GPUData getGpuData() {
return gpuData;
}

public void setGpuData(GPUData gpuData) {
this.gpuData = gpuData;
}

@Override
public String toString() {
return "Institution{" +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package it.pagopa.selfcare.onboarding.entity;

import it.pagopa.selfcare.product.entity.AttachmentTemplate;

public class OnboardingAttachment {
private Onboarding onboarding;
private AttachmentTemplate attachment;

public OnboardingAttachment() {}

private OnboardingAttachment(OnboardingAttachment.Builder builder) {
this.onboarding = builder.onboarding;
this.attachment = builder.attachment;
}

public static OnboardingAttachment.Builder builder() {
return new OnboardingAttachment.Builder();
}

public static class Builder {
private Onboarding onboarding;
private AttachmentTemplate attachment;

public OnboardingAttachment.Builder onboarding(Onboarding onboarding) {
this.onboarding = onboarding;
return this;
}

public OnboardingAttachment.Builder attachment(AttachmentTemplate attachment) {
this.attachment = attachment;
return this;
}

public OnboardingAttachment build() {
return new OnboardingAttachment(this);
}
}

public AttachmentTemplate getAttachment() {
return attachment;
}

public void setAttachment(AttachmentTemplate attachment) {
this.attachment = attachment;
}

public Onboarding getOnboarding() {
return onboarding;
}

public void setOnboarding(Onboarding onboarding) {
this.onboarding = onboarding;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ public Onboarding getOnboarding() {
public void setOnboarding(Onboarding onboarding) {
this.onboarding = onboarding;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ public String getRejectTokenUrl(MailTemplatePlaceholdersConfig config) {

@Override
public String getContractTemplatePath(Product product) {
return product.getInstitutionContractTemplate(InstitutionUtils.getCurrentInstitutionType(onboarding)).getContractTemplatePath();
return product
.getInstitutionContractTemplate(InstitutionUtils.getCurrentInstitutionType(onboarding))
.getContractTemplatePath();
}

@Override
public String getContractTemplateVersion(Product product) {
return product.getInstitutionContractTemplate(InstitutionUtils.getCurrentInstitutionType(onboarding)).getContractTemplateVersion();
return product
.getInstitutionContractTemplate(InstitutionUtils.getCurrentInstitutionType(onboarding))
.getContractTemplateVersion();
}

public String getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public OnboardingWorkflowUser() {}
@Override
public String getEmailRegistrationPath(MailTemplatePathConfig config) {
final String managerId =
this.onboarding.getUsers().stream()
.filter(user -> PartyRole.MANAGER == user.getRole())
.map(User::getId)
.findAny()
.orElse(null);
this.onboarding.getUsers().stream()
.filter(user -> PartyRole.MANAGER == user.getRole())
.map(User::getId)
.findAny()
.orElse(null);
if (Objects.nonNull(this.onboarding.getPreviousManagerId())
&& this.onboarding.getPreviousManagerId().equals(managerId)) {
&& this.onboarding.getPreviousManagerId().equals(managerId)) {
return config.registrationUserPath();
}
return config.registrationUserNewManagerPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

import java.util.List;

public class PaymentServiceProvider {
public class PaymentServiceProvider extends BusinessData {

private String abiCode;
private String businessRegisterNumber;
private String legalRegisterNumber;
private String legalRegisterName;
private boolean vatNumberGroup;
private List<String> providerNames;
private String contractType;
Expand All @@ -21,30 +19,6 @@ public void setAbiCode(String abiCode) {
this.abiCode = abiCode;
}

public String getBusinessRegisterNumber() {
return businessRegisterNumber;
}

public void setBusinessRegisterNumber(String businessRegisterNumber) {
this.businessRegisterNumber = businessRegisterNumber;
}

public String getLegalRegisterNumber() {
return legalRegisterNumber;
}

public void setLegalRegisterNumber(String legalRegisterNumber) {
this.legalRegisterNumber = legalRegisterNumber;
}

public String getLegalRegisterName() {
return legalRegisterName;
}

public void setLegalRegisterName(String legalRegisterName) {
this.legalRegisterName = legalRegisterName;
}

public boolean isVatNumberGroup() {
return vatNumberGroup;
}
Expand Down
Loading

0 comments on commit 1ad9fde

Please sign in to comment.