Skip to content

Commit

Permalink
Merge pull request #306 from pagopa/VAS-1146-primitive-version-channel
Browse files Browse the repository at this point in the history
[VAS-1146] feat: Added property "primitive_version" to Channel class
  • Loading branch information
svariant authored Jul 10, 2024
2 parents e3042ed + 99a6eaa commit 394a98e
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 34 deletions.
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: core
description: APIs to manage configuration for CI and PSP of pagoPA
type: application
version: 0.151.0
appVersion: 0.59.0
version: 0.153.0
appVersion: 0.59.0-2-VAS-1146-primitive-version-channel
dependencies:
- name: microservice-chart
version: 2.8.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ microservice-chart: &microservice-chart
envSecret: {}
image:
repository: ghcr.io/pagopa/pagopa-api-config
tag: "0.59.0"
tag: "0.59.0-2-VAS-1146-primitive-version-channel"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ microservice-chart: &microservice-chart
envSecret: {}
image:
repository: ghcr.io/pagopa/pagopa-api-config
tag: "0.59.0"
tag: "0.59.0-2-VAS-1146-primitive-version-channel"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ microservice-chart: &microservice-chart
envSecret: {}
image:
repository: ghcr.io/pagopa/pagopa-api-config
tag: "0.59.0"
tag: "0.59.0-2-VAS-1146-primitive-version-channel"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
22 changes: 13 additions & 9 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "core",
"description": "Spring application exposes APIs to manage configuration for CI/PSP on the Nodo dei Pagamenti",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.59.0"
"version": "0.59.0-2-VAS-1146-primitive-version-channel"
},
"servers": [
{
Expand Down Expand Up @@ -18288,6 +18288,11 @@
"description": "Broker description. Read only field",
"example": "Lorem ipsum dolor sit amet"
},
"primitive_version": {
"type": "integer",
"description": "Primitive number version",
"format": "int32"
},
"password": {
"type": "string"
},
Expand Down Expand Up @@ -18435,13 +18440,6 @@
"flag_psp_cp": {
"type": "boolean",
"description": "Represents the authorization to carry out the transfer of the information present in additional payment information in the tags relating to payment by card for the PA in V1"
},
"primitive_version": {
"maximum": 2,
"minimum": 1,
"type": "integer",
"description": "Primitive number version",
"format": "int32"
}
}
},
Expand Down Expand Up @@ -19590,7 +19588,8 @@
"Channel": {
"required": [
"channel_code",
"enabled"
"enabled",
"primitive_version"
],
"type": "object",
"properties": {
Expand All @@ -19605,6 +19604,11 @@
"type": "string",
"description": "Broker description. Read only field",
"example": "Lorem ipsum dolor sit amet"
},
"primitive_version": {
"type": "integer",
"description": "Primitive number version",
"format": "int32"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion openapi/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Spring application exposes APIs to manage configuration for CI/PSP on the Nodo dei Pagamenti",
"termsOfService": "https://www.pagopa.gov.it/",
"title": "core",
"version": "0.59.0"
"version": "0.59.0-2-VAS-1146-primitive-version-channel"
},
"host": "localhost:8080",
"basePath": "/",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>it.gov.pagopa.apiconfig</groupId>
<artifactId>core</artifactId>
<version>0.59.0</version>
<version>0.59.0-2-VAS-1146-primitive-version-channel</version>
<description>Spring application exposes APIs to manage configuration for CI/PSP on the Nodo dei Pagamenti</description>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@
import it.gov.pagopa.apiconfig.core.model.psp.Channel;
import it.gov.pagopa.apiconfig.core.util.CommonUtil;
import it.gov.pagopa.apiconfig.starter.entity.Canali;

import javax.validation.Valid;

import lombok.extern.slf4j.Slf4j;
import org.modelmapper.Converter;
import org.modelmapper.spi.MappingContext;

@Slf4j
public class ConvertCanaliToChannel implements Converter<Canali, Channel> {

@Override
public Channel convert(MappingContext<Canali, Channel> context) {
@Valid Canali source = context.getSource();
log.debug(source.toString());
return Channel.builder()
.channelCode(source.getIdCanale())
.enabled(source.getEnabled())
.brokerDescription(
CommonUtil.deNull(source.getFkIntermediarioPsp().getCodiceIntermediario()))
.build();
}
@Override
public Channel convert(MappingContext<Canali, Channel> context) {
@Valid Canali source = context.getSource();
log.debug(source.toString());
return Channel.builder()
.channelCode(source.getIdCanale())
.enabled(source.getEnabled())
.primitiveVersion(source.getFkCanaliNodo() != null ? source.getFkCanaliNodo().getVersionePrimitive() : null)
.brokerDescription(
CommonUtil.deNull(source.getFkIntermediarioPsp().getCodiceIntermediario()))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ public class Channel {
description = "Broker description. Read only field",
example = "Lorem ipsum dolor sit amet")
private String brokerDescription;

@Schema(required = true, description = "Primitive number version")
@JsonProperty("primitive_version")
private Integer primitiveVersion;
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,6 @@ public class ChannelDetails extends Channel {
@NotNull
private Boolean flagPspCp;

@Min(1)
@Max(2)
@NotNull
@Schema(required = true, description = "Primitive number version")
@JsonProperty("primitive_version")
private Integer primitiveVersion;

@JsonIgnore private IntermediariPsp fkIntermediarioPsp;

@JsonIgnore private WfespPluginConf fkWfespPluginConf;
Expand Down

0 comments on commit 394a98e

Please sign in to comment.