Skip to content

Commit

Permalink
[SELC - 5148] feat: added new AggregateInstitution Object (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
gianmarcoplutino authored Jun 21, 2024
1 parent 624791c commit 3347acd
Show file tree
Hide file tree
Showing 12 changed files with 322 additions and 21 deletions.
38 changes: 37 additions & 1 deletion apps/onboarding-cdc/src/main/openapi/onboarding_functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"aggregates": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Institution"
"$ref": "#/components/schemas/AggregateInstitution"
}
},
"billing": {
Expand Down Expand Up @@ -320,6 +320,42 @@
}
}
},
"AggregateInstitution": {
"title": "AggregateInstitution",
"type": "object",
"properties": {
"taxCode": {
"type": "string"
},
"subunitCode": {
"type": "string"
},
"subunitType": {
"type": "string"
},
"origin": {
"$ref": "#/components/schemas/Origin"
},
"originId": {
"type": "string"
},
"geographicTaxonomies": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GeographicTaxonomy"
}
},
"description": {
"type": "string"
},
"address": {
"type": "string"
},
"zipCode": {
"type": "string"
}
}
},
"DataProtectionOfficer": {
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package it.pagopa.selfcare.onboarding.entity;


import it.pagopa.selfcare.onboarding.common.Origin;


import java.util.List;


public class AggregateInstitution {

private String taxCode;
private String description;
private String subunitCode;
private String subunitType;
private List<GeographicTaxonomy> geographicTaxonomies;
private String address;
private String zipCode;
private String originId;
private Origin origin;

public String getTaxCode() {
return taxCode;
}

public void setTaxCode(String taxCode) {
this.taxCode = taxCode;
}

public String getSubunitCode() {
return subunitCode;
}

public void setSubunitCode(String subunitCode) {
this.subunitCode = subunitCode;
}

public String getSubunitType() {
return subunitType;
}

public void setSubunitType(String subunitType) {
this.subunitType = subunitType;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

public String getZipCode() {
return zipCode;
}

public void setZipCode(String zipCode) {
this.zipCode = zipCode;
}

public List<GeographicTaxonomy> getGeographicTaxonomies() {
return geographicTaxonomies;
}

public void setGeographicTaxonomies(List<GeographicTaxonomy> geographicTaxonomies) {
this.geographicTaxonomies = geographicTaxonomies;
}

public Origin getOrigin() {
return origin;
}

public void setOrigin(Origin origin) {
this.origin = origin;
}

public String getOriginId() {
return originId;
}

public void setOriginId(String originId) {
this.originId = originId;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Onboarding {
private WorkflowType workflowType;
private Institution institution;
private List<User> users;
private List<Institution> aggregates;
private List<AggregateInstitution> aggregates;
private String pricingPlan;
private Billing billing;
private Boolean signContract;
Expand Down Expand Up @@ -175,9 +175,9 @@ public void setDeletedAt(LocalDateTime deletedAt) {
this.deletedAt = deletedAt;
}

public List<Institution> getAggregates() { return aggregates; }
public List<AggregateInstitution> getAggregates() { return aggregates; }

public void setAggregates(List<Institution> aggregates) { this.aggregates = aggregates; }
public void setAggregates(List<AggregateInstitution> aggregates) { this.aggregates = aggregates; }

public Boolean getIsAggregator() { return isAggregator; }

Expand Down
53 changes: 50 additions & 3 deletions apps/onboarding-ms/src/main/docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,42 @@
}
}
},
"AggregateInstitutionRequest" : {
"required" : [ "taxCode", "description" ],
"type" : "object",
"properties" : {
"taxCode" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"subunitCode" : {
"type" : "string"
},
"subunitType" : {
"type" : "string"
},
"geographicTaxonomies" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/GeographicTaxonomy"
}
},
"address" : {
"type" : "string"
},
"zipCode" : {
"type" : "string"
},
"originId" : {
"type" : "string"
},
"origin" : {
"$ref" : "#/components/schemas/Origin"
}
}
},
"BillingPaRequest" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -1091,6 +1127,17 @@
}
}
},
"GeographicTaxonomy" : {
"type" : "object",
"properties" : {
"code" : {
"type" : "string"
},
"desc" : {
"type" : "string"
}
}
},
"GeographicTaxonomyDto" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -1420,7 +1467,7 @@
"aggregates" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/InstitutionBaseRequest"
"$ref" : "#/components/schemas/AggregateInstitutionRequest"
}
},
"isAggregator" : {
Expand Down Expand Up @@ -1606,7 +1653,7 @@
"aggregates" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/InstitutionBaseRequest"
"$ref" : "#/components/schemas/AggregateInstitutionRequest"
}
},
"isAggregator" : {
Expand Down Expand Up @@ -1676,7 +1723,7 @@
"aggregates" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/InstitutionBaseRequest"
"$ref" : "#/components/schemas/AggregateInstitutionRequest"
}
},
"isAggregator" : {
Expand Down
39 changes: 36 additions & 3 deletions apps/onboarding-ms/src/main/docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,32 @@ components:
type: string
otherNote:
type: string
AggregateInstitutionRequest:
required:
- taxCode
- description
type: object
properties:
taxCode:
type: string
description:
type: string
subunitCode:
type: string
subunitType:
type: string
geographicTaxonomies:
type: array
items:
$ref: "#/components/schemas/GeographicTaxonomy"
address:
type: string
zipCode:
type: string
originId:
type: string
origin:
$ref: "#/components/schemas/Origin"
BillingPaRequest:
type: object
properties:
Expand Down Expand Up @@ -771,6 +797,13 @@ components:
type: string
pec:
type: string
GeographicTaxonomy:
type: object
properties:
code:
type: string
desc:
type: string
GeographicTaxonomyDto:
type: object
properties:
Expand Down Expand Up @@ -1016,7 +1049,7 @@ components:
aggregates:
type: array
items:
$ref: "#/components/schemas/InstitutionBaseRequest"
$ref: "#/components/schemas/AggregateInstitutionRequest"
isAggregator:
type: boolean
pricingPlan:
Expand Down Expand Up @@ -1152,7 +1185,7 @@ components:
aggregates:
type: array
items:
$ref: "#/components/schemas/InstitutionBaseRequest"
$ref: "#/components/schemas/AggregateInstitutionRequest"
isAggregator:
type: boolean
pricingPlan:
Expand Down Expand Up @@ -1208,7 +1241,7 @@ components:
aggregates:
type: array
items:
$ref: "#/components/schemas/InstitutionBaseRequest"
$ref: "#/components/schemas/AggregateInstitutionRequest"
isAggregator:
type: boolean
pricingPlan:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package it.pagopa.selfcare.onboarding.controller.request;

import it.pagopa.selfcare.onboarding.common.Origin;
import it.pagopa.selfcare.onboarding.entity.GeographicTaxonomy;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

@Data
public class AggregateInstitutionRequest {
@NotNull(message = "taxCode is required")
private String taxCode;

@NotNull(message = "description is required")
private String description;

private String subunitCode;
private String subunitType;
private List<GeographicTaxonomy> geographicTaxonomies;
private String address;
private String zipCode;
private String originId;
private Origin origin;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class OnboardingBaseRequest {
@NotEmpty(message = "at least one user is required")
private List<UserRequest> users;

private List<InstitutionBaseRequest> aggregates;
private List<AggregateInstitutionRequest> aggregates;

private Boolean isAggregator;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package it.pagopa.selfcare.onboarding.entity;

import it.pagopa.selfcare.onboarding.common.Origin;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

@Data
public class AggregateInstitution {

private String taxCode;
private String description;
private String subunitCode;
private String subunitType;
private List<GeographicTaxonomy> geographicTaxonomies;
private String address;
private String zipCode;
private String originId;
private Origin origin;

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Onboarding extends ReactivePanacheMongoEntityBase {
private WorkflowType workflowType;
private Institution institution;
private List<User> users;
private List<Institution> aggregates;
private List<AggregateInstitution> aggregates;
private String pricingPlan;
private Billing billing;
private Boolean signContract;
Expand Down
Loading

0 comments on commit 3347acd

Please sign in to comment.