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

Nod 822 viste #11

Merged
merged 18 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: pagopa-node-cfg-sync
description: Microservice that sync api-config-cache and standin configuration
type: application
version: 0.77.0
appVersion: 0.0.5
version: 0.81.0
appVersion: 0.0.5-4-NOD-822_viste
dependencies:
- name: microservice-chart
version: 2.8.0
Expand Down
9 changes: 8 additions & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-node-cfg-sync
tag: "0.0.5"
tag: "0.0.5-4-NOD-822_viste"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -95,6 +95,13 @@ microservice-chart:
OTEL_METRICS_EXPORTER: otlp
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
RIVERSAMENTO_ENABLED: "true"
RIVERSAMENTO_SOURCE: "nexi-oracle"
RIVERSAMENTO_TARGET: "nexi-oracle"
CDI_PREFERENCES_VIEW: CDI_PREFERENCES_VIEW
CDI_PREFERENCES_TABLE: CDI_PREFERENCES_TABLE
ELENCO_SERVIZI_VIEW: ELENCO_SERVIZI_VIEW
ELENCO_SERVIZI_TABLE: ELENCO_SERVIZI_TABLE
envSecret:
# required
APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string'
Expand Down
9 changes: 8 additions & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-node-cfg-sync
tag: "0.0.5"
tag: "0.0.5-4-NOD-822_viste"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -96,6 +96,13 @@ microservice-chart:
OTEL_METRICS_EXPORTER: otlp
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
RIVERSAMENTO_ENABLED: "true"
RIVERSAMENTO_SOURCE: "nexi-oracle"
RIVERSAMENTO_TARGET: "nexi-oracle"
CDI_PREFERENCES_VIEW: CDI_PREFERENCES_VIEW
CDI_PREFERENCES_TABLE: CDI_PREFERENCES_TABLE
ELENCO_SERVIZI_VIEW: ELENCO_SERVIZI_VIEW
ELENCO_SERVIZI_TABLE: ELENCO_SERVIZI_TABLE
envSecret:
# required
APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string'
Expand Down
9 changes: 8 additions & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-node-cfg-sync
tag: "0.0.5"
tag: "0.0.5-4-NOD-822_viste"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -95,6 +95,13 @@ microservice-chart:
OTEL_METRICS_EXPORTER: otlp
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
RIVERSAMENTO_ENABLED: "true"
RIVERSAMENTO_SOURCE: "nexi-oracle"
RIVERSAMENTO_TARGET: "nexi-oracle"
CDI_PREFERENCES_VIEW: CDI_PREFERENCES_VIEW
CDI_PREFERENCES_TABLE: CDI_PREFERENCES_TABLE
ELENCO_SERVIZI_VIEW: ELENCO_SERVIZI_VIEW
ELENCO_SERVIZI_TABLE: ELENCO_SERVIZI_TABLE
envSecret:
# required
APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string'
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "cfg-sync",
"description": "Microservice to update configuration schema of Nodo dei Pagamenti",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.0.5"
"version": "0.0.5-4-NOD-822_viste"
},
"servers": [
{
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.node</groupId>
<artifactId>cfg-sync</artifactId>
<version>0.0.5</version>
<version>0.0.5-4-NOD-822_viste</version>
<description>Microservice to update configuration schema of Nodo dei Pagamenti</description>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package it.gov.pagopa.node.cfgsync.config;

import org.hibernate.boot.model.naming.Identifier;
import org.hibernate.boot.model.naming.PhysicalNamingStrategy;
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
import org.springframework.stereotype.Component;

@Component
public class ViewNamingStrategy implements PhysicalNamingStrategy {

@Override
public Identifier toPhysicalCatalogName(final Identifier identifier, final JdbcEnvironment jdbcEnv) {
return identifier;
}

@Override
public Identifier toPhysicalColumnName(final Identifier identifier, final JdbcEnvironment jdbcEnv) {
return identifier;
}

@Override
public Identifier toPhysicalSchemaName(final Identifier identifier, final JdbcEnvironment jdbcEnv) {
return identifier;
}

@Override
public Identifier toPhysicalSequenceName(final Identifier identifier, final JdbcEnvironment jdbcEnv) {
return identifier;
}

@Override
public Identifier toPhysicalTableName(final Identifier identifier, final JdbcEnvironment jdbcEnv) {
return convertToSnakeCase(identifier);
}

private Identifier convertToSnakeCase(final Identifier identifier) {
if(identifier.getText().equals("{cdi_preferences_target}")){
String cdiPreferencesTable = System.getenv("CDI_PREFERENCES_TABLE");
return Identifier.toIdentifier(cdiPreferencesTable);
}
if(identifier.getText().equals("{elenco_servizi_target}")){
String elencoServiziTable = System.getenv("ELENCO_SERVIZI_TABLE");
return Identifier.toIdentifier(elencoServiziTable);
}
if(identifier.getText().equals("{cdi_preferences_source}")){
String cdiPreferencesTable = System.getenv("CDI_PREFERENCES_VIEW");
return Identifier.toIdentifier(cdiPreferencesTable);
}
if(identifier.getText().equals("{elenco_servizi_source}")){
String elencoServiziTable = System.getenv("ELENCO_SERVIZI_VIEW");
return Identifier.toIdentifier(elencoServiziTable);
}
return identifier;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import it.gov.pagopa.node.cfgsync.model.AppCorsConfiguration;
import lombok.SneakyThrows;
import org.hibernate.boot.model.naming.ImplicitNamingStrategy;
import org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl;
import org.hibernate.boot.model.naming.PhysicalNamingStrategy;
import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
Expand All @@ -15,6 +21,9 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
@Value("${cors.configuration}")
private String corsConfiguration;

@Autowired
private ViewNamingStrategy viewNamingStrategy;


@SneakyThrows
@Override
Expand All @@ -25,6 +34,12 @@ public void addCorsMappings(CorsRegistry registry) {
.allowedOrigins(appCorsConfiguration.getOrigins())
.allowedMethods(appCorsConfiguration.getMethods());
}

@Bean
public ImplicitNamingStrategy implicit() {
return new ImplicitNamingStrategyLegacyJpaImpl();
}

}


Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package it.gov.pagopa.node.cfgsync.repository.model;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;


@NoArgsConstructor
@Entity
@Table(name = "{cdi_preferences_target}")
@Setter
@Getter
public class CDIPreferences {

@Column(name="OBJ_ID")
@Id
private Long objid;
@Column(name="SELLER")
private String seller;
@Column(name="BUYER")
private String buyer;
@Column(name="COSTO_CONVENZIONE")
private BigDecimal costoconvenzione;
@Column(name="ID_CDI_MASTER")
private Long idcdimaster;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package it.gov.pagopa.node.cfgsync.repository.model;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;


@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "{cdi_preferences_source}")
@Setter
@Getter
public class CDIPreferencesView {

@Column(name="`OBJ_ID`")
@Id
private Long objid;
@Column(name="`SELLER`")
private String seller;
@Column(name="`BUYER`")
private String buyer;
@Column(name="`COSTO_CONVENZIONE`")
private BigDecimal costoconvenzione;
@Column(name="`ID_CDI_MASTER`")
private Long idcdimaster;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package it.gov.pagopa.node.cfgsync.repository.model;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;


@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "{elenco_servizi_target}")
@Setter
@Getter
public class ElencoServizi {

@Column(name="OBJ_ID")
@Id
private Long objid;
@Column(name="PSP_ID")
private String pspid;
@Column(name="PSP_RAG_SOC")
private String pspragsoc;
@Column(name="PSP_FLAG_STORNO")
private String pspflagstorno;
@Column(name="PSP_FLAG_BOLLO")
private String pspflagbollo;
@Column(name="LOGO_PSP")
private byte[] logopsp;
@Column(name="FLUSSO_ID")
private String flussoid;
@Column(name="INTM_ID")
private String intmid;
@Column(name="CANALE_ID")
private String canaleid;
@Column(name="NOME_SERVIZIO")
private String nomeservizio;
@Column(name="CANALE_MOD_PAG")
private Long canalemodpag;
@Column(name="TIPO_VERS_COD")
private String tipoverscod;
@Column(name="CODICE_LINGUA")
private String codicelingua;
@Column(name="INF_COND_EC_MAX")
private String infcondecmax;
@Column(name="INF_DESC_SERV")
private String infdescserv;
@Column(name="INF_DISP_SERV")
private String infdispserv;
@Column(name="INF_URL_CANALE")
private String infurlcanale;
@Column(name="TIMESTAMP_INS")
private LocalDate timestampins;
@Column(name="DATA_VALIDITA")
private LocalDateTime datavalidita;
@Column(name="IMPORTO_MINIMO")
private BigDecimal importominimo;
@Column(name="IMPORTO_MASSIMO")
private BigDecimal importomassimo;
@Column(name="COSTO_FISSO")
private BigDecimal costofisso;
@Column(name="TAGS")
private String tags;
@Column(name="LOGO_SERVIZIO")
private byte[] logoservizio;
@Column(name="CANALE_APP")
private String canaleapp;
@Column(name="ON_US")
private String onus;
@Column(name="CARRELLO_CARTE")
private String carrellocarte;
@Column(name="CODICE_ABI")
private String codiceabi;
@Column(name="CODICE_MYBANK")
private String codicemybank;
@Column(name="CODICE_CONVENZIONE")
private String codiceconvenzione;
@Column(name="FLAG_IO")
private String flagio;

}
Loading
Loading