Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SELC-5615] feat: added create attachment function #614

Merged
merged 33 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7b50f83
feat: added create attachment function
gianmarcoplutino Nov 20, 2024
20cbee3
Merge branch 'main' into feature/SELC-5615
gianmarcoplutino Nov 21, 2024
2a80479
feat: added create attachment function
gianmarcoplutino Nov 21, 2024
75e02ff
fix: removed ;
gianmarcoplutino Nov 21, 2024
3719d2f
fix: fixed attachment test
gianmarcoplutino Nov 21, 2024
6f67ee5
feat: adjust service logic
gianmarcoplutino Nov 22, 2024
6cba4ff
Merge branch 'main' into feature/SELC-5615
gianmarcoplutino Nov 22, 2024
84e393d
fix: updated params
gianmarcoplutino Nov 22, 2024
bac2941
fix: updated params
gianmarcoplutino Nov 22, 2024
7460859
feat: extracted method createAttachments
gianmarcoplutino Nov 22, 2024
5522095
fix: fixed Sonar vulnerability
gianmarcoplutino Nov 22, 2024
61f5f1c
fix: undo Sonar vulnerability
gianmarcoplutino Nov 22, 2024
5e16ff6
Merge branch 'refs/heads/main' into feature/SELC-5615
gianmarcoplutino Nov 25, 2024
e052927
Merge branch 'refs/heads/main' into feature/SELC-5615
gianmarcoplutino Nov 25, 2024
28dcd14
feat: rework logic
gianmarcoplutino Nov 25, 2024
a57f039
Added retry into callActivity
giampieroferrara Nov 25, 2024
22697ed
Fixed junit test for buildAttachmentsAndSaveTokensOrchestrator_invoke…
giampieroferrara Nov 25, 2024
61754ba
feat: refactor logic
gianmarcoplutino Nov 26, 2024
c9ede6b
feat: updated onboardingString instead onboardingWorkflowString
gianmarcoplutino Nov 26, 2024
9ca143f
feat: updated template name
gianmarcoplutino Nov 26, 2024
5b78793
Merge branch 'main' into feature/SELC-5615
gianmarcoplutino Nov 26, 2024
982ce4f
feat: commented test
gianmarcoplutino Nov 26, 2024
04343b5
Added GPUData into onboarding-cdc
giampieroferrara Nov 26, 2024
a2290ba
feat: updated saveTokenAttachment
gianmarcoplutino Nov 27, 2024
3f82178
Merge remote-tracking branch 'origin/feature/SELC-5615' into feature/…
gianmarcoplutino Nov 27, 2024
3667062
Merge branch 'main' into feature/SELC-5615
gianmarcoplutino Nov 27, 2024
7948886
Fixed PaymentServiceProviderRequest into ms
giampieroferrara Nov 27, 2024
4b779e0
Added GPUData and BusinessData
giampieroferrara Nov 27, 2024
bcec006
Added into institution gpuData
giampieroferrara Nov 27, 2024
111d247
Fixed sonar issues
giampieroferrara Nov 27, 2024
7a58ceb
Merge branch 'main' into feature/SELC-5615
giampieroferrara Nov 27, 2024
15d2682
feat: added attachment mapping
gianmarcoplutino Nov 27, 2024
80556b9
fix: fixed PdfMapper
gianmarcoplutino Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading