generated from pagopa/pagopa-functions-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
README onboarding-sdk #29
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# Selfcare Onboarding | ||
|
||
Repository that contains backend services for selfcare onboarding. | ||
Repository that contains backend services for selfcare onboarding. It is a monorepo for onboarding domain that contains: | ||
|
||
- `onboarding-functions`: functions that handle all asynchronous activities related to preparing and completing the onboarding process. Indeed, they are activated by the onboarding microservice upon receiving an onboarding request | ||
- `onboarding-ms`: microservice that implements CRUD operations for the 'onboarding' object and the business logic for the onboarding phase. During the onboarding process | ||
- `onboarding-sdk`: Java utility classes that simplify the work of developers about onboarding activity | ||
|
||
Look at single README module for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Onboarding SDK Azure Storage | ||
|
||
This library has been developed to provide a set of Java utility classes to simplify the work of interact with azure storage. It includes features that helping for upload or download file from an azure storage container. | ||
|
||
## Installation | ||
|
||
To use this library in your projects, you can add the dependency to your pom.xml if you're using Maven: | ||
|
||
```shell script | ||
<dependency> | ||
<groupId>it.pagopa.selfcare</groupId> | ||
<artifactId>onboarding-sdk-azure-storage</artifactId> | ||
<version>0.0.1</version> | ||
</dependency> | ||
``` | ||
|
||
If you are using Gradle, you can add the dependency to your build.gradle file: | ||
|
||
```shell script | ||
dependencies { | ||
implementation 'it.pagopa.selfcare:onboarding-sdk-azure-storage:0.0.1' | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
Here's an example of how to use AzureBlobClient: | ||
|
||
```java script | ||
|
||
public class Main { | ||
public static void main(String[] args) { | ||
final String azureStorageConnectionString = ... ; // set the azure storage connectionString, for ex. AccountName=asd;AccountKey=asd;DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:10000/account; | ||
final String azureStorageContainerName = ... ; // set the azure storage container name | ||
final AzureBlobClient azureBlobClient = new AzureBlobClientDefault(azureStorageConnectionString, azureStorageContainerName); | ||
|
||
//Getting file as text | ||
final String filepath = ... ; | ||
final String jsonString = azureBlobClient.getFileAsText(filepath); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Onboarding SDK Common | ||
|
||
This library has been developed to provide a set of Java utility classes to simplify the work of onboarding service. It includes constants that helping for some aspects of onboarding activity. | ||
|
||
## Installation | ||
|
||
To use this library in your projects, you can add the dependency to your pom.xml if you're using Maven: | ||
|
||
```shell script | ||
<dependency> | ||
<groupId>it.pagopa.selfcare</groupId> | ||
<artifactId>onboarding-sdk-common</artifactId> | ||
<version>0.0.1</version> | ||
</dependency> | ||
``` | ||
|
||
If you are using Gradle, you can add the dependency to your build.gradle file: | ||
|
||
```shell script | ||
dependencies { | ||
implementation 'it.pagopa.selfcare:onboarding-sdk-common:0.0.1' | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
# Onboarding SDK Product | ||
|
||
This library has been developed to provide a set of Java utility classes to simplify the work of handle **Selfcare Product** as string. | ||
|
||
## Installation | ||
|
||
To use this library in your projects, you can add the dependency to your pom.xml if you're using Maven: | ||
|
||
```shell script | ||
<dependency> | ||
<groupId>it.pagopa.selfcare</groupId> | ||
<artifactId>onboarding-sdk-product</artifactId> | ||
<version>0.0.1</version> | ||
</dependency> | ||
``` | ||
|
||
If you are using Gradle, you can add the dependency to your build.gradle file: | ||
|
||
```shell script | ||
dependencies { | ||
implementation 'it.pagopa.selfcare:onboarding-sdk-product:0.0.1' | ||
} | ||
``` | ||
## Product JSON Schema | ||
|
||
Product string which are used by ProductService must follow a specific schema: | ||
|
||
``` | ||
{ | ||
"type" : "record", | ||
"name" : "Product", | ||
"namespace" : "it.pagopa.selfcare.product.entity", | ||
"fields" : [ { | ||
"name" : "id", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "logo", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "depictImageUrl", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "title", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "logoBgColor", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "description", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "urlPublic", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "urlBO", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "createdAt", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "createdBy", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "modifiedAt", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "modifiedBy", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "roleManagementURL", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "contractTemplateUpdatedAt", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "contractTemplatePath", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "contractTemplateVersion", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "institutionContractMappings", | ||
"type" : [ "null", { | ||
"type" : "map", | ||
"values" : { | ||
"type" : "record", | ||
"name" : "ContractStorage", | ||
"fields" : [ { | ||
"name" : "contractTemplateUpdatedAt", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "contractTemplatePath", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "contractTemplateVersion", | ||
"type" : [ "null", "string" ] | ||
} ] | ||
} | ||
} ] | ||
}, { | ||
"name" : "enabled", | ||
"type" : "boolean" | ||
}, { | ||
"name" : "delegable", | ||
"type" : ["null","boolean"] | ||
}, { | ||
"name" : "status", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "parentId", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "identityTokenAudience", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "backOfficeEnvironmentConfigurations", | ||
"type" : [ "null", { | ||
"type" : "map", | ||
"values" : { | ||
"type" : "record", | ||
"name" : "BackOfficeConfigurations", | ||
"fields" : [ { | ||
"name" : "url", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "identityTokenAudience", | ||
"type" : [ "null", "string" ] | ||
} ] | ||
} | ||
} ] | ||
}, { | ||
"name" : "parent", | ||
"type" : [ "null", "Product" ] | ||
} ] | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
Here's an example of how to use ProductService for retrieving product: | ||
|
||
```java script | ||
|
||
public class Main { | ||
public static void main(String[] args) { | ||
final String productJsonString = ... ; // set a json string compliant to a List of Product Pojo | ||
final ProductService productService = new ProductServiceDefault(productJsonString); | ||
|
||
//Get product if it is valid | ||
final String productId = "prod-pagopa"; | ||
final Product product = productService.getProductIsValid(productId); | ||
} | ||
} | ||
``` |
107 changes: 107 additions & 0 deletions
107
onboarding-sdk/onboarding-sdk-product/src/main/schema/Product_v1.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{ | ||
"type" : "record", | ||
"name" : "Product", | ||
"namespace" : "it.pagopa.selfcare.product.entity", | ||
"fields" : [ { | ||
"name" : "id", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "logo", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "depictImageUrl", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "title", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "logoBgColor", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "description", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "urlPublic", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "urlBO", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "createdAt", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "createdBy", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "modifiedAt", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "modifiedBy", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "roleManagementURL", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "contractTemplateUpdatedAt", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "contractTemplatePath", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "contractTemplateVersion", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "institutionContractMappings", | ||
"type" : [ "null", { | ||
"type" : "map", | ||
"values" : { | ||
"type" : "record", | ||
"name" : "ContractStorage", | ||
"fields" : [ { | ||
"name" : "contractTemplateUpdatedAt", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "contractTemplatePath", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "contractTemplateVersion", | ||
"type" : [ "null", "string" ] | ||
} ] | ||
} | ||
} ] | ||
}, { | ||
"name" : "enabled", | ||
"type" : "boolean" | ||
}, { | ||
"name" : "delegable", | ||
"type" : ["null","boolean"] | ||
}, { | ||
"name" : "status", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "parentId", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "identityTokenAudience", | ||
"type" : [ "string" ] | ||
}, { | ||
"name" : "backOfficeEnvironmentConfigurations", | ||
"type" : [ "null", { | ||
"type" : "map", | ||
"values" : { | ||
"type" : "record", | ||
"name" : "BackOfficeConfigurations", | ||
"fields" : [ { | ||
"name" : "url", | ||
"type" : [ "null", "string" ] | ||
}, { | ||
"name" : "identityTokenAudience", | ||
"type" : [ "null", "string" ] | ||
} ] | ||
} | ||
} ] | ||
}, { | ||
"name" : "parent", | ||
"type" : [ "null", "Product" ] | ||
} ] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when do we have such a need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selfcare Products is a collection of PagoPA products available for use by institutions. Each product contains specific information, such as its status, admitted role, or a filepath template for building contract necessary for selfcare business logic.
Currently, these product records are stored in a MongoDB collection which are accessible through a REST API.
We are planning to replace this architecture with a file-based approach in our roadmap. This change is driven by the fact that all product information requires only 36KB of storage so we will saving in terms of resource and maintenance.
The Onboarding SDK Product offers a set of classes designed for managing this collection of records using a file.