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-4197] Feat: Added user V2 api for activate, suspend and delete user product #352

Merged
merged 8 commits into from
Feb 20, 2024
329 changes: 329 additions & 0 deletions app/src/main/resources/swagger/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3323,6 +3323,335 @@
"bearerAuth" : [ "global" ]
} ]
}
},
"/v2/institutions" : {
"get" : {
"tags" : [ "user" ],
"summary" : "getInstitutions",
"description" : "Service to get all the institutions related to logged user",
"operationId" : "getInstitutionsUsingGET_1",
"parameters" : [ {
"name" : "authenticated",
"in" : "query",
"required" : false,
"style" : "form",
"schema" : {
"type" : "boolean"
}
}, {
"name" : "authorities[0].authority",
"in" : "query",
"required" : false,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "credentials",
"in" : "query",
"required" : false,
"style" : "form",
"schema" : {
"type" : "object"
}
}, {
"name" : "details",
"in" : "query",
"required" : false,
"style" : "form",
"schema" : {
"type" : "object"
}
}, {
"name" : "principal",
"in" : "query",
"required" : false,
"style" : "form",
"schema" : {
"type" : "object"
}
} ],
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"application/json" : {
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/InstitutionBaseResource"
}
}
}
}
},
"400" : {
"description" : "Bad Request",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"401" : {
"description" : "Unauthorized",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"404" : {
"description" : "Not Found",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"500" : {
"description" : "Internal Server Error",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
}
},
"security" : [ {
"bearerAuth" : [ "global" ]
} ]
}
},
"/v2/{userId}" : {
"delete" : {
"tags" : [ "user" ],
"summary" : "deleteRelationshipById",
"description" : "Delete the relationship",
"operationId" : "deleteRelationshipByIdUsingDELETE_1",
"parameters" : [ {
"name" : "userId",
"in" : "path",
"description" : "User's unique identifier",
"required" : true,
"style" : "simple",
"schema" : {
"type" : "string"
}
}, {
"name" : "institutionId",
"in" : "query",
"description" : "institutionId",
"required" : true,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "productId",
"in" : "query",
"description" : "productId",
"required" : true,
"style" : "form",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"204" : {
"description" : "No Content"
},
"400" : {
"description" : "Bad Request",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"401" : {
"description" : "Unauthorized",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"500" : {
"description" : "Internal Server Error",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
}
},
"security" : [ {
"bearerAuth" : [ "global" ]
} ]
}
},
"/v2/{userId}/activate" : {
"post" : {
"tags" : [ "user" ],
"summary" : "activateRelationship",
"description" : "Activate the relationship",
"operationId" : "activateRelationshipUsingPOST_1",
"parameters" : [ {
"name" : "userId",
"in" : "path",
"description" : "User's unique identifier",
"required" : true,
"style" : "simple",
"schema" : {
"type" : "string"
}
}, {
"name" : "institutionId",
"in" : "query",
"description" : "institutionId",
"required" : true,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "productId",
"in" : "query",
"description" : "productId",
"required" : true,
"style" : "form",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"204" : {
"description" : "No Content"
},
"400" : {
"description" : "Bad Request",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"401" : {
"description" : "Unauthorized",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"500" : {
"description" : "Internal Server Error",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
}
},
"security" : [ {
"bearerAuth" : [ "global" ]
} ]
}
},
"/v2/{userId}/suspend" : {
"post" : {
"tags" : [ "user" ],
"summary" : "suspendRelationship",
"description" : "Suspend the relationship",
"operationId" : "suspendRelationshipUsingPOST_1",
"parameters" : [ {
"name" : "userId",
"in" : "path",
"description" : "User's unique identifier",
"required" : true,
"style" : "simple",
"schema" : {
"type" : "string"
}
}, {
"name" : "institutionId",
"in" : "query",
"description" : "Institution's identifier",
"required" : true,
"style" : "form",
"schema" : {
"type" : "string"
}
}, {
"name" : "productId",
"in" : "query",
"description" : "productId",
"required" : true,
"style" : "form",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"204" : {
"description" : "No Content"
},
"400" : {
"description" : "Bad Request",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"401" : {
"description" : "Unauthorized",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
},
"500" : {
"description" : "Internal Server Error",
"content" : {
"application/problem+json" : {
"schema" : {
"$ref" : "#/components/schemas/Problem"
}
}
}
}
},
"security" : [ {
"bearerAuth" : [ "global" ]
} ]
}
}
},
"components" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class SwaggerConfigTest {
@MockBean
private UserService userServiceMock;

@MockBean
private UserV2Service userServiceV2Mock;

@MockBean
private BrokerService brokerService;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package it.pagopa.selfcare.dashboard.connector.api;

import it.pagopa.selfcare.dashboard.connector.model.institution.InstitutionInfo;
import it.pagopa.selfcare.dashboard.connector.model.user.MutableUserFieldsDto;

import java.util.List;


public interface UserApiConnector {

void updateUser(String userId, String institutionId, MutableUserFieldsDto userDto);

List<InstitutionInfo> getUserProducts(String userId);

void suspendUserProduct(String userId, String institutionId, String productId);

void activateUserProduct(String userId, String institutionId, String productId);

void deleteUserProduct(String userId, String institutionId, String productId);
}
Loading
Loading