diff --git a/app/src/main/resources/swagger/api-docs.json b/app/src/main/resources/swagger/api-docs.json index 00abb9d5..5ba9630a 100644 --- a/app/src/main/resources/swagger/api-docs.json +++ b/app/src/main/resources/swagger/api-docs.json @@ -3667,6 +3667,10 @@ "description" : "User's unique identifier", "format" : "uuid" }, + "mobilePhone" : { + "type" : "string", + "description" : "User's institutional phone number" + }, "name" : { "type" : "string", "description" : "User's name" @@ -4489,6 +4493,10 @@ "description" : "User's unique identifier", "format" : "uuid" }, + "mobilePhone" : { + "description" : "User's institutional phone number", + "$ref" : "#/components/schemas/CertifiedFieldResourceOfstring" + }, "name" : { "description" : "User's name", "$ref" : "#/components/schemas/CertifiedFieldResourceOfstring" diff --git a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/user/User.java b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/user/User.java index 88bbd9fa..caa1bba4 100644 --- a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/user/User.java +++ b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/user/User.java @@ -15,6 +15,7 @@ public class User { private CertifiedField name; private CertifiedField familyName; private CertifiedField email; + private CertifiedField mobilePhone; private Map workContacts; diff --git a/connector/rest/docs/openapi/selfcare-user-docs.json b/connector/rest/docs/openapi/selfcare-user-docs.json index 39d3966c..4a28b4c3 100644 --- a/connector/rest/docs/openapi/selfcare-user-docs.json +++ b/connector/rest/docs/openapi/selfcare-user-docs.json @@ -1898,6 +1898,9 @@ "email" : { "type" : "string" }, + "mobilePhone" : { + "type" : "string" + }, "workContacts" : { "type" : "object", "additionalProperties" : { diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/model/mapper/UserMapper.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/model/mapper/UserMapper.java index 21076161..4fce17f6 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/model/mapper/UserMapper.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/model/mapper/UserMapper.java @@ -27,6 +27,7 @@ default CertifiedField toCertifiedField(CertifiableFieldResponseString f @Mapping(target = "name", expression = "java(toCertifiedField(response.getName()))") @Mapping(target = "familyName", expression = "java(toCertifiedField(response.getFamilyName()))") @Mapping(target = "email", expression = "java(toCertifiedField(response.getEmail()))") + @Mapping(target = "mobilePhone", expression = "java(toCertifiedField(response.getMobilePhone()))") @Mapping(target = "workContacts", expression = "java(toCertifiedWorkContact(response.getWorkContacts()))") User toUser(UserDetailResponse response); @@ -38,6 +39,7 @@ default CertifiedField toCertifiedField(CertifiableFieldResponseString f @Mapping(target = "user.name", expression = "java(toCertifiedField(userResponse.getName()))") @Mapping(target = "user.familyName", expression = "java(toCertifiedField(userResponse.getSurname()))") @Mapping(target = "user.email", expression = "java(toCertifiedField(userResponse.getEmail()))") + @Mapping(target = "user.mobilePhone", expression = "java(toCertifiedField(userResponse.getMobilePhone()))") @Mapping(target = "user.workContacts", expression = "java(toUserInfoContacts(userResponse.getWorkContacts()))") @Mapping(target = "role", expression = "java(it.pagopa.selfcare.commons.base.security.PartyRole.valueOf(userDashboardResponse.getRole()).getSelfCareAuthority())") @Mapping(target = "products", expression = "java(toProductInfoMap(userDashboardResponse.getProducts()))") diff --git a/connector/rest/src/test/resources/stubs/User.json b/connector/rest/src/test/resources/stubs/User.json index c6f7aee1..0a91622e 100644 --- a/connector/rest/src/test/resources/stubs/User.json +++ b/connector/rest/src/test/resources/stubs/User.json @@ -10,6 +10,9 @@ "email": { "value": "john.doe@example.com" }, + "mobilePhone": { + "value": "0000000000" + }, "workContacts": { "institution1": { "email": { diff --git a/connector/rest/src/test/resources/stubs/UserDataResponse.json b/connector/rest/src/test/resources/stubs/UserDataResponse.json index 9c760980..d9410d5f 100644 --- a/connector/rest/src/test/resources/stubs/UserDataResponse.json +++ b/connector/rest/src/test/resources/stubs/UserDataResponse.json @@ -22,10 +22,11 @@ ], "userResponse": { "id": "id", - "taxCode": "name", - "name": "email", - "surname": "ACTIVE", - "email": "2020-01-01T00:00:00Z", + "taxCode": "taxCode", + "name": "name", + "surname": "surname", + "email": "email", + "mobilePhone": "phone", "workContacts": null } } diff --git a/connector/rest/src/test/resources/stubs/UserDetailResponse.json b/connector/rest/src/test/resources/stubs/UserDetailResponse.json index c6f7aee1..0a91622e 100644 --- a/connector/rest/src/test/resources/stubs/UserDetailResponse.json +++ b/connector/rest/src/test/resources/stubs/UserDetailResponse.json @@ -10,6 +10,9 @@ "email": { "value": "john.doe@example.com" }, + "mobilePhone": { + "value": "0000000000" + }, "workContacts": { "institution1": { "email": { diff --git a/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionV2Service.java b/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionV2Service.java index 2261ddba..5589e39f 100644 --- a/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionV2Service.java +++ b/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionV2Service.java @@ -7,7 +7,6 @@ public interface InstitutionV2Service { UserInfo getInstitutionUser(String institutionId, String userId, String loggedUserId); - Institution findInstitutionById(String institutionId); Boolean verifyIfExistsPendingOnboarding(String taxCode, String subunitCode, String productId); diff --git a/core/src/test/resources/expectations/User.json b/core/src/test/resources/expectations/User.json index 4e46c785..8069b511 100644 --- a/core/src/test/resources/expectations/User.json +++ b/core/src/test/resources/expectations/User.json @@ -10,6 +10,9 @@ "email": { "value": "john.doe@example.com" }, + "mobilePhone": { + "value": "0000000000" + }, "workContacts": { "institution1": { "email": { diff --git a/core/src/test/resources/expectations/UserInfo.json b/core/src/test/resources/expectations/UserInfo.json index 1fe5986e..cdbc9ccf 100644 --- a/core/src/test/resources/expectations/UserInfo.json +++ b/core/src/test/resources/expectations/UserInfo.json @@ -12,6 +12,9 @@ "email": { "value": "john.doe@example.com" }, + "mobilePhone": { + "value": "0000000000" + }, "workContacts": { "institution1": { "email": { diff --git a/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/InstitutionUserResource.java b/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/InstitutionUserResource.java index 0aa9ec58..3ceefcd9 100644 --- a/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/InstitutionUserResource.java +++ b/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/InstitutionUserResource.java @@ -35,6 +35,9 @@ public class InstitutionUserResource { @ApiModelProperty(value = "${swagger.dashboard.user.model.email}") private String email; + @ApiModelProperty(value = "${swagger.dashboard.user.model.institutionalPhone}") + private String mobilePhone; + @ApiModelProperty(value = "${swagger.dashboard.user.model.role}") private SelfCareAuthority role; diff --git a/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/mapper/UserMapper.java b/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/mapper/UserMapper.java index 19321211..e08422ca 100644 --- a/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/mapper/UserMapper.java +++ b/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/mapper/UserMapper.java @@ -106,6 +106,7 @@ private static T toInstitutionUser(UserInfo resource.setName(CertifiedFieldMapper.toValue(model.getUser().getName())); resource.setSurname(CertifiedFieldMapper.toValue(model.getUser().getFamilyName())); resource.setEmail(CertifiedFieldMapper.toValue(model.getUser().getEmail())); + resource.setMobilePhone(CertifiedFieldMapper.toValue(model.getUser().getMobilePhone())); } if (model.getProducts() != null) { resource.setProducts(model.getProducts().values().stream() diff --git a/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/mapper/UserMapperV2.java b/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/mapper/UserMapperV2.java index 97590902..9933aa2d 100644 --- a/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/mapper/UserMapperV2.java +++ b/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/mapper/UserMapperV2.java @@ -1,6 +1,5 @@ package it.pagopa.selfcare.dashboard.web.model.mapper; -import it.pagopa.selfcare.dashboard.connector.exception.InvalidRequestException; import it.pagopa.selfcare.dashboard.connector.model.user.*; import it.pagopa.selfcare.dashboard.web.model.UpdateUserDto; import it.pagopa.selfcare.dashboard.web.model.user.CertifiedFieldResource; @@ -22,6 +21,7 @@ public interface UserMapperV2 { @Mapping(target = "name", expression = "java(toCertifiedFieldResource(model.getName()))") @Mapping(target = "familyName", expression = "java(toCertifiedFieldResource(model.getFamilyName()))") @Mapping(target = "email", expression = "java(toCertifiedFieldResource(model.getEmail()))") + @Mapping(target = "mobilePhone", expression = "java(toCertifiedFieldResource(model.getMobilePhone()))") UserResource toUserResource(User model); UpdateUserRequestDto fromUpdateUser(UpdateUserDto userDto); diff --git a/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/user/UserResource.java b/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/user/UserResource.java index 12e90fea..34c0f28c 100644 --- a/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/user/UserResource.java +++ b/web/src/main/java/it/pagopa/selfcare/dashboard/web/model/user/UserResource.java @@ -21,6 +21,9 @@ public class UserResource { @ApiModelProperty(value = "${swagger.dashboard.user.model.institutionalEmail}") private CertifiedFieldResource email; + @ApiModelProperty(value = "${swagger.dashboard.user.model.institutionalPhone}") + private CertifiedFieldResource mobilePhone; + @ApiModelProperty(value = "${swagger.dashboard.user.model.fiscalCode}") private String fiscalCode; diff --git a/web/src/test/resources/json/InstitutionUserDetailsResource.json b/web/src/test/resources/json/InstitutionUserDetailsResource.json index 6e8535b3..3599e881 100644 --- a/web/src/test/resources/json/InstitutionUserDetailsResource.json +++ b/web/src/test/resources/json/InstitutionUserDetailsResource.json @@ -3,6 +3,7 @@ "name": "string", "surname": "string", "email": "string", + "mobilePhone": "string", "role": "ADMIN", "status": "string", "products": [ diff --git a/web/src/test/resources/json/User.json b/web/src/test/resources/json/User.json index ddd66479..8a9f47a0 100644 --- a/web/src/test/resources/json/User.json +++ b/web/src/test/resources/json/User.json @@ -13,6 +13,10 @@ "certification": "SPID", "value": "email@example.com" }, + "mobilePhone": { + "certification": "SPID", + "value": "0000000000" + }, "workContacts": { "contact1": { "email": { diff --git a/web/src/test/resources/json/UserInfo.json b/web/src/test/resources/json/UserInfo.json index 0dd381fe..6d0fa504 100644 --- a/web/src/test/resources/json/UserInfo.json +++ b/web/src/test/resources/json/UserInfo.json @@ -15,6 +15,10 @@ "certification": "NONE", "value": "string" }, + "mobilePhone": { + "certification": "NONE", + "value": "string" + }, "workContacts": { "string": { "email": { diff --git a/web/src/test/resources/json/UserResource.json b/web/src/test/resources/json/UserResource.json index 3541766f..62ca21da 100644 --- a/web/src/test/resources/json/UserResource.json +++ b/web/src/test/resources/json/UserResource.json @@ -12,6 +12,10 @@ "certified": true, "value": "email@example.com" }, + "mobilePhone": { + "certified": true, + "value": "0000000000" + }, "fiscalCode": "fiscalCode", "workContacts": { "contact1": {