diff --git a/openapi/openapi.json b/openapi/openapi.json index edea448b5..f53e0e06c 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -18147,7 +18147,7 @@ }, "config_description": { "type": "string", - "example": " default millisecondi validità token" + "example": " default millisecondi validità token" } } }, @@ -18648,7 +18648,7 @@ }, "config_description": { "type": "string", - "example": " default millisecondi validità token" + "example": " default millisecondi validità token" }, "config_category": { "type": "string", @@ -19574,7 +19574,8 @@ "business_name", "enabled", "payment_types", - "psp_code" + "psp_code", + "tax_code" ], "type": "object", "properties": { @@ -19592,6 +19593,9 @@ "items": { "type": "string" } + }, + "tax_code": { + "type": "string" } } }, @@ -19793,4 +19797,4 @@ } } } -} +} \ No newline at end of file diff --git a/openapi/swagger.json b/openapi/swagger.json index 7e05504b6..1a4fc5714 100644 --- a/openapi/swagger.json +++ b/openapi/swagger.json @@ -14395,13 +14395,17 @@ }, "psp_code": { "type": "string" + }, + "tax_code": { + "type": "string" } }, "required": [ "business_name", "enabled", "payment_types", - "psp_code" + "psp_code", + "tax_code" ], "type": "object" }, @@ -14472,7 +14476,7 @@ "type": "string" }, "config_description": { - "example": " default millisecondi validità token", + "example": " default millisecondi validità token", "type": "string" }, "config_key": { @@ -14494,7 +14498,7 @@ "ConfigurationKeyBase": { "properties": { "config_description": { - "example": " default millisecondi validità token", + "example": " default millisecondi validità token", "type": "string" }, "config_value": { diff --git a/src/main/java/it/gov/pagopa/apiconfig/core/model/psp/ChannelPsp.java b/src/main/java/it/gov/pagopa/apiconfig/core/model/psp/ChannelPsp.java index 434f546ae..bf937d8c4 100644 --- a/src/main/java/it/gov/pagopa/apiconfig/core/model/psp/ChannelPsp.java +++ b/src/main/java/it/gov/pagopa/apiconfig/core/model/psp/ChannelPsp.java @@ -41,4 +41,9 @@ public class ChannelPsp { // should be @NotEmpty for requests, but it is not compatible for responses // check on empty request is managed in the service method private List paymentTypeList; + + @JsonProperty("tax_code") + @Schema(required = true) + @NotNull + private String taxCode; } diff --git a/src/main/java/it/gov/pagopa/apiconfig/core/service/ChannelsService.java b/src/main/java/it/gov/pagopa/apiconfig/core/service/ChannelsService.java index 120ece5b4..92517c2b2 100644 --- a/src/main/java/it/gov/pagopa/apiconfig/core/service/ChannelsService.java +++ b/src/main/java/it/gov/pagopa/apiconfig/core/service/ChannelsService.java @@ -388,26 +388,27 @@ private List getPaymentTypeList(List type) { .collect(Collectors.toList()); } - /** - * Maps PSP objects stored in the DB in a List of PaymentServiceProvider - * - * @param page page of PSP returned from the database - * @param channelCode id of the channel - * @return a list of {@link PaymentServiceProvider}. - */ - private List getPspList(Page page, String channelCode) { - return page.stream() - .map( - elem -> { - var psp = modelMapper.map(elem, PaymentServiceProvider.class); - return ChannelPsp.builder() - .pspCode(psp.getPspCode()) - .enabled(psp.getEnabled()) - .businessName(psp.getBusinessName()) - .paymentTypeList( - mapPaymentType(elem.getPspCanaleTipoVersamentoList(), channelCode)) - .build(); - }) - .collect(Collectors.toList()); - } + /** + * Maps PSP objects stored in the DB in a List of PaymentServiceProvider + * + * @param page page of PSP returned from the database + * @param channelCode id of the channel + * @return a list of {@link PaymentServiceProvider}. + */ + private List getPspList(Page page, String channelCode) { + return page.stream() + .map( + elem -> { + var psp = modelMapper.map(elem, PaymentServiceProvider.class); + return ChannelPsp.builder() + .pspCode(psp.getPspCode()) + .enabled(psp.getEnabled()) + .businessName(psp.getBusinessName()) + .taxCode(psp.getTaxCode()) + .paymentTypeList( + mapPaymentType(elem.getPspCanaleTipoVersamentoList(), channelCode)) + .build(); + }) + .collect(Collectors.toList()); + } }