Skip to content

Commit

Permalink
Update resource mapper (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-putzu authored Nov 6, 2024
1 parent c45ad7d commit 88a1a99
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public interface ProductsMapper {

@Mapping(target = "roleMappings", expression = "java(toRoleMappings(model.getRoleMappings(institutionType)))")
@Mapping(target = "contractTemplatePath", expression = "java(model.getInstitutionContractTemplate(institutionType).getContractTemplatePath())")
ProductResource toResource(Product model, String institutionType);

@Named("toRoleMappings")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ public class ProductResource {
@NotBlank
private String id;

@ApiModelProperty(value = "${swagger.external_api.products.model.alias}", required = true)
private String alias;

@ApiModelProperty(value = "${swagger.external_api.products.model.title}", required = true)
@NotBlank
private String title;

@ApiModelProperty(value = "${swagger.external_api.products.model.contractTemplatePath}", required = true)
@NotBlank
private String contractTemplatePath;

@ApiModelProperty(value = "${swagger.external_api.products.model.contractTemplateUpdatedAt}")
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/swagger/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2241,9 +2241,13 @@
},
"ProductResource" : {
"title" : "ProductResource",
"required" : [ "contractTemplatePath", "contractTemplateVersion", "description", "id", "roleMappings", "title", "urlBO" ],
"required" : [ "alias", "contractTemplatePath", "contractTemplateVersion", "description", "id", "roleMappings", "title", "urlBO" ],
"type" : "object",
"properties" : {
"alias" : {
"type" : "string",
"description" : "Product's alias"
},
"contractTemplatePath" : {
"type" : "string",
"description" : "The path of contract"
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/swagger/swagger_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ swagger.external_api.products.model.parentId=Root parent of the sub product
swagger.external_api.products.model.roleMappings=Mappings between Party's and Product's role
swagger.external_api.products.model.roleManagementURL=Url of the utilities management
swagger.external_api.products.model.logo=Product's logo
swagger.external_api.products.model.alias=Product's alias
swagger.external_api.products.model.title=Product's title
swagger.external_api.products.model.status=Product's status
swagger.external_api.product-role-info.model.multiroleAllowed=Flag indicating if a User can have more than one product role
Expand Down

0 comments on commit 88a1a99

Please sign in to comment.