Skip to content

Commit eb72a03

Browse files
feat: add UserRequestDto and UserRequester models
* Update OpenAPI documentation with new models * Include userRequest field in OnboardingData and OnboardingProductDto * Map userRequest in OnboardingResourceMapper
1 parent 5dc46d0 commit eb72a03

File tree

7 files changed

+100
-2
lines changed

7 files changed

+100
-2
lines changed

app/src/main/resources/swagger/api-docs.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"openapi" : "3.0.1",
33
"info" : {
4-
"title" : "${openapi_title}",
4+
"title" : "selc-onboarding",
55
"description" : "Self Care OnBoarding API documentation",
66
"contact" : {
77
"name" : "PagoPA",
@@ -3810,6 +3810,9 @@
38103810
},
38113811
"payment" : {
38123812
"$ref" : "#/components/schemas/PaymentDto"
3813+
},
3814+
"userRequest" : {
3815+
"$ref" : "#/components/schemas/UserRequestDto"
38133816
}
38143817
}
38153818
},
@@ -3873,6 +3876,21 @@
38733876
}
38743877
}
38753878
},
3879+
"UserRequestDto" : {
3880+
"required" : [ "email", "name", "surname" ],
3881+
"type" : "object",
3882+
"properties" : {
3883+
"name" : {
3884+
"type" : "string"
3885+
},
3886+
"surname" : {
3887+
"type" : "string"
3888+
},
3889+
"email" : {
3890+
"type" : "string"
3891+
}
3892+
}
3893+
},
38763894
"InvalidParam" : {
38773895
"required" : [ "name", "reason" ],
38783896
"type" : "object",

connector-api/src/main/java/it/pagopa/selfcare/onboarding/connector/model/onboarding/OnboardingData.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public class OnboardingData {
5757
private List<String> atecoCodes;
5858
private Payment payment;
5959
private Boolean toAddOnAggregates;
60+
private UserRequester userRequest;
6061
public List<User> getUsers() {
6162
return Optional.ofNullable(users).orElse(Collections.emptyList());
6263
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Party Process Micro Service
3+
* This service is the party process
4+
*
5+
* OpenAPI spec version: {{version}}
6+
* Contact: support@example.com
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package it.pagopa.selfcare.onboarding.connector.model.onboarding;
14+
15+
import lombok.Data;
16+
17+
@Data
18+
public class UserRequester {
19+
20+
private String name;
21+
private String surname;
22+
private String email;
23+
24+
}

connector/rest/docs/openapi/api-selfcare-onboarding-docs.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2936,6 +2936,9 @@
29362936
"signContract" : {
29372937
"type" : "boolean"
29382938
},
2939+
"userRequester" : {
2940+
"$ref" : "#/components/schemas/UserRequester"
2941+
},
29392942
"institution" : {
29402943
"$ref" : "#/components/schemas/InstitutionBaseRequest"
29412944
},
@@ -2985,6 +2988,9 @@
29852988
"signContract" : {
29862989
"type" : "boolean"
29872990
},
2991+
"userRequester" : {
2992+
"$ref" : "#/components/schemas/UserRequester"
2993+
},
29882994
"institution" : {
29892995
"$ref" : "#/components/schemas/InstitutionBaseRequest"
29902996
},
@@ -3183,6 +3189,9 @@
31833189
"signContract" : {
31843190
"type" : "boolean"
31853191
},
3192+
"userRequester" : {
3193+
"$ref" : "#/components/schemas/UserRequester"
3194+
},
31863195
"institution" : {
31873196
"$ref" : "#/components/schemas/InstitutionBaseRequest"
31883197
},
@@ -3258,6 +3267,9 @@
32583267
"signContract" : {
32593268
"type" : "boolean"
32603269
},
3270+
"userRequester" : {
3271+
"$ref" : "#/components/schemas/UserRequester"
3272+
},
32613273
"institution" : {
32623274
"$ref" : "#/components/schemas/InstitutionPspRequest"
32633275
},
@@ -3561,6 +3573,20 @@
35613573
}
35623574
}
35633575
},
3576+
"UserRequester" : {
3577+
"type" : "object",
3578+
"properties" : {
3579+
"name" : {
3580+
"type" : "string"
3581+
},
3582+
"surname" : {
3583+
"type" : "string"
3584+
},
3585+
"email" : {
3586+
"type" : "string"
3587+
}
3588+
}
3589+
},
35643590
"UserResponse" : {
35653591
"type" : "object",
35663592
"properties" : {
@@ -3614,4 +3640,4 @@
36143640
}
36153641
}
36163642
}
3617-
}
3643+
}

web/src/main/java/it/pagopa/selfcare/onboarding/web/model/OnboardingProductDto.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,7 @@ public class OnboardingProductDto {
8888
@ApiModelProperty(value = "${swagger.onboarding.institutions.model.payment}")
8989
private PaymentDto payment;
9090

91+
@ApiModelProperty(value = "${swagger.onboarding.institutions.model.requester}")
92+
private UserRequestDto userRequest;
93+
9194
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package it.pagopa.selfcare.onboarding.web.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import io.swagger.annotations.ApiModelProperty;
5+
import jakarta.validation.constraints.NotBlank;
6+
import lombok.Data;
7+
8+
@Data
9+
public class UserRequestDto {
10+
11+
@ApiModelProperty(value = "${swagger.onboarding.user.model.name}", required = true)
12+
@JsonProperty(required = true)
13+
@NotBlank
14+
private String name;
15+
16+
@ApiModelProperty(value = "${swagger.onboarding.user.model.surname}", required = true)
17+
@JsonProperty(required = true)
18+
@NotBlank
19+
private String surname;
20+
21+
@ApiModelProperty(value = "${swagger.onboarding.user.model.email}", required = true)
22+
@JsonProperty(required = true)
23+
@NotBlank
24+
private String email;
25+
}

web/src/main/java/it/pagopa/selfcare/onboarding/web/model/mapper/OnboardingResourceMapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public interface OnboardingResourceMapper {
3939
@Mapping(source = "gpuData", target = "institutionUpdate.gpuData")
4040
@Mapping(source = "originId", target = "originId")
4141
@Mapping(source= "billingData.legalForm", target="institutionUpdate.legalForm")
42+
@Mapping(source = "userRequest", target = "userRequest")
4243
OnboardingData toEntity(OnboardingProductDto dto);
4344

4445
VerifyManagerResponse toManagerVerification(ManagerVerification managerVerification);

0 commit comments

Comments
 (0)