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

[PRDP-145] feat add logo management #21

Merged
merged 50 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
67c625c
[PRDP-145] feat: introducing logo management in BizEventToPdfMapper t…
alessio-cialini Oct 4, 2023
fce9ce8
[PRDP-145] feat: updated GenerateReceiptPdfTest
alessio-cialini Oct 4, 2023
1fc70b4
[PRDP-145] feat: updated GenerateReceiptPdfTest
alessio-cialini Oct 4, 2023
06122e8
[PRDP-145] feat: introducing psp info mapping through environment var…
alessio-cialini Oct 5, 2023
87425fe
[PRDP-145] feat: introducing example configuration for maps using ext…
alexyey Oct 6, 2023
5738210
[PRDP-145] feat: Updated brand logo configmaps.yaml
alexyey Oct 6, 2023
40a350e
Merge remote-tracking branch 'origin/main' into PRDP-145-feat-add-log…
alexyey Oct 9, 2023
286d50d
[PRDP-145] Integrating updated tests
alexyey Oct 9, 2023
b462520
[PRDP-145] Integrating updated tests
alexyey Oct 9, 2023
670afb9
[PRDP-145] Updated BizEventToPdfMapper, PdfJsonMappingException
alexyey Oct 9, 2023
00b738a
[PRDP-145] Updated docker-compose.yml
alexyey Oct 9, 2023
69e220a
merge main
pasqualespica Oct 11, 2023
397cf44
Bump to version 1.3.0-2-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 11, 2023
26d026e
align dev uat helm
pasqualespica Oct 11, 2023
400d677
Bump to version 1.3.0-3-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 11, 2023
ee48bb3
feat: update psp management to use pspId for data retriaval
alexyey Oct 12, 2023
4b230ce
[PRDP-145] feat: introducing logo management in BizEventToPdfMapper t…
alessio-cialini Oct 4, 2023
c159ba9
[PRDP-145] feat: updated GenerateReceiptPdfTest
alessio-cialini Oct 4, 2023
49c0ad6
[PRDP-145] feat: updated GenerateReceiptPdfTest
alessio-cialini Oct 4, 2023
d37efe3
[PRDP-145] feat: introducing psp info mapping through environment var…
alessio-cialini Oct 5, 2023
bedabcc
[PRDP-145] feat: introducing example configuration for maps using ext…
alexyey Oct 6, 2023
5a37ee6
[PRDP-145] feat: Updated brand logo configmaps.yaml
alexyey Oct 6, 2023
0ed508c
[PRDP-145] Integrating updated tests
alexyey Oct 9, 2023
0e1a5ef
[PRDP-145] Integrating updated tests
alexyey Oct 9, 2023
889975c
[PRDP-145] Updated BizEventToPdfMapper, PdfJsonMappingException
alexyey Oct 9, 2023
0f6d8c8
[PRDP-145] Updated docker-compose.yml
alexyey Oct 9, 2023
c5d1c28
align dev uat helm
pasqualespica Oct 11, 2023
458c567
feat: update psp management to use pspId for data retriaval
alexyey Oct 12, 2023
16bd6f4
[PRDP-145] feat: updated log management and tests after rebase
alexyey Oct 13, 2023
fa18719
Merge remote-tracking branch 'origin/PRDP-145-feat-add-logo-managemen…
alexyey Oct 13, 2023
798cc72
[PRDP-145] feat: updated log management and tests after rebase
alexyey Oct 13, 2023
846b47a
Bump to version 1.3.0-3-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 13, 2023
1b76bac
Bump to version 1.3.1-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 13, 2023
f7530ce
Merge branch 'main' into PRDP-145-feat-add-logo-management
pasqualespica Oct 16, 2023
930d0c7
fix
pasqualespica Oct 16, 2023
7450fdf
merge main
pasqualespica Oct 16, 2023
c0b6508
fix
pasqualespica Oct 16, 2023
35f2fc5
fix
pasqualespica Oct 16, 2023
45aaec6
fix
pasqualespica Oct 16, 2023
0a2cd35
Bump to version 1.3.2-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 16, 2023
a97917d
Bump to version 1.3.3-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 16, 2023
fbe469d
merge main
pasqualespica Oct 16, 2023
d102dc9
Bump to version 1.3.4-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 16, 2023
3d48ece
from CDN
pasqualespica Oct 16, 2023
a36a812
Bump to version 1.3.5-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 16, 2023
cdba23a
Bump to version 1.3.6-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 16, 2023
2936b69
fix
pasqualespica Oct 16, 2023
83fa3e5
fix
pasqualespica Oct 16, 2023
531fa89
Bump to version 1.3.7-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 16, 2023
0171b06
Bump to version 1.3.8-PRDP-145-feat-add-logo-management [skip ci]
pagopa-github-bot Oct 16, 2023
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
3 changes: 3 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ services:
build:
dockerfile: Dockerfile
context: ../
environment:
BRAND_LOGO_MAP: '{"MASTERCARD":"assets/mastercard.png","VISA":"assets/visa.png","AMEX":"assets/amex.png","MAESTRO":"assets/maestro.png","JCB":"assets/jcb.png","OTHER":"","DINERS":"assets/diners.png","DISCOVER":"assets/discover.png","UNIONPAY":"assets/unionpay.png"}'
PSP_INFO_MAP: '{"60000000001":{"logo":"assets/nexi-logo.png","name":"Nexi","companyName":"Nexi Payments S.p.A.","address":"Corso Sempione","buildingNumber":"55","postalCode":"20149","city":"Milano","province":"MI","fee":{"amount":"2,00"}}}'
env_file:
- ./.env
ports:
Expand Down
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: pagopareceiptpdfgenerator
description: Microservice description
type: application
version: 0.76.0
appVersion: 1.3.2
version: 0.83.0
appVersion: 1.3.8-PRDP-145-feat-add-logo-management
dependencies:
- name: microservice-chart
version: 2.4.0
Expand Down
10 changes: 10 additions & 0 deletions helm/templates/configmaps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: template-maps
namespace: receipts
data:
brand-logo-map: |
{"MASTERCARD":"assets/mastercard.png","VISA":"assets/visa.png","AMEX":"https://assets.cdn.platform.pagopa.it/payment-methods/amex.png","MAESTRO":"assets/maestro.png","JCB":"assets/jcb.png","OTHER":"","DINERS":"assets/diners.png","DISCOVER":"assets/discover.png","UNIONPAY":"assets/unionpay.png"}
psp-info-map: |
{"CIPBITMM":{"logo":"https://assets.cdn.io.italia.it/logos/abi/32875.png","name":"Nexi","companyName":"Nexi Payments S.p.A.","address":"Corso Sempione","buildingNumber":"55","postalCode":"20149","city":"Milano","province":"MI","fee":{"amount":"2,00"}}}
6 changes: 5 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-receipt-pdf-generator
tag: "1.3.2"
tag: "1.3.8-PRDP-145-feat-add-logo-management"
pullPolicy: Always
# https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs
livenessProbe:
Expand Down Expand Up @@ -100,6 +100,10 @@ microservice-chart:
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
AZURE_FUNCTIONS_MESH_JAVA_OPTS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar -Xmx1024m -XX:+UseG1GC"
envConfigMapExternals:
template-maps:
PSP_INFO_MAP: psp-info-map
BRAND_LOGO_MAP: brand-logo-map
envFieldRef:
APP_NAME: "metadata.labels['app.kubernetes.io/instance']"
APP_VERSION: "metadata.labels['app.kubernetes.io/version']"
Expand Down
40 changes: 22 additions & 18 deletions 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-receipt-pdf-generator
tag: "1.3.2"
tag: "1.3.8-PRDP-145-feat-add-logo-management"
pullPolicy: Always
# https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs
livenessProbe:
Expand Down Expand Up @@ -54,14 +54,14 @@ microservice-chart:
allowPrivilegeEscalation: false
resources:
requests:
memory: "1512Mi"
cpu: "0.75"
memory: "1024Mi"
cpu: "0.40"
limits:
memory: "1512Mi"
cpu: "0.75"
autoscaling:
enable: true
minReplica: 2
minReplica: 3
maxReplica: 10
pollingInterval: 10 # seconds
cooldownPeriod: 50 # seconds
Expand All @@ -81,35 +81,39 @@ microservice-chart:
ENV: "prod"
WEBSITE_SITE_NAME: "pagopareceiptpdfgenerator" # required to show cloud role name in application insights
FUNCTIONS_WORKER_RUNTIME: "java"
RECEIPT_QUEUE_TOPIC: 'pagopa-p-weu-receipts-queue-receipt-waiting-4-gen'
RECEIPT_QUEUE_TOPIC: "pagopa-p-weu-receipts-queue-receipt-waiting-4-gen"
RECEIPT_QUEUE_TOPIC_POISON: "pagopa-d-weu-receipts-queue-receipt-waiting-4-gen-poison"
COSMOS_RECEIPT_QUEUE_MAX_RETRY: '5'
PDF_ENGINE_ENDPOINT: 'https://api.prod.platform.pagopa.it/shared/pdf-engine/v1/generate-pdf'
COSMOS_RECEIPT_SERVICE_ENDPOINT: 'https://pagopa-p-weu-receipts-ds-cosmos-account.documents.azure.com:443/'
COSMOS_RECEIPT_DB_NAME: 'db'
COSMOS_RECEIPT_CONTAINER_NAME: 'receipts'
BLOB_STORAGE_ACCOUNT_ENDPOINT: 'https://pagopapweureceiptsfnsa.blob.core.windows.net'
BLOB_STORAGE_CONTAINER_NAME: 'pagopa-p-weu-receipts-azure-blob-receipt-st-attach'
COSMOS_RECEIPT_QUEUE_MAX_RETRY: "5"
PDF_ENGINE_ENDPOINT: "https://api.prod.platform.pagopa.it/shared/pdf-engine/v1/generate-pdf"
COSMOS_RECEIPT_SERVICE_ENDPOINT: "https://pagopa-p-weu-receipts-ds-cosmos-account.documents.azure.com:443/"
COSMOS_RECEIPT_DB_NAME: "db"
COSMOS_RECEIPT_CONTAINER_NAME: "receipts"
BLOB_STORAGE_ACCOUNT_ENDPOINT: "https://pagopapweureceiptsfnsa.blob.core.windows.net"
BLOB_STORAGE_CONTAINER_NAME: "pagopa-p-weu-receipts-azure-blob-receipt-st-attach"
WORKING_DIRECTORY_PATH: "/temp"
ENABLE_ECS_CONSOLE: "true"
CONSOLE_LOG_THRESHOLD: "DEBUG"
CONSOLE_LOG_PATTERN: "%d{HH:mm:ss.SSS}[%thread]%-5level%logger{36}-%msg%n"
CONSOLE_LOG_CHARSET: "UTF-8"
OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopareceiptpdfgeneratorotl,deployment.environment=prod"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317"
OTEL_LOGS_EXPORTER: none
OTEL_LOGS_EXPORTER: "none"
OTEL_TRACES_SAMPLER: "always_on"
AZURE_FUNCTIONS_MESH_JAVA_OPTS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar -Xmx1024m -XX:+UseG1GC"
envConfigMapExternals:
template-maps:
PSP_INFO_MAP: psp-info-map
BRAND_LOGO_MAP: brand-logo-map
envFieldRef:
APP_NAME: "metadata.labels['app.kubernetes.io/instance']"
APP_VERSION: "metadata.labels['app.kubernetes.io/version']"
envSecret:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-p-connection-string'
RECEIPTS_STORAGE_CONN_STRING: 'pdf-blob-storage-p-connection-string'
COSMOS_RECEIPTS_CONN_STRING: 'cosmos-receipt-p-connection-string'
OCP_APIM_SUBSCRIPTION_KEY: 'shared-apim-p-subscription-key'
APPLICATIONINSIGHTS_CONNECTION_STRING: "ai-p-connection-string"
RECEIPTS_STORAGE_CONN_STRING: "pdf-blob-storage-p-connection-string"
COSMOS_RECEIPTS_CONN_STRING: "cosmos-receipt-p-connection-string"
OCP_APIM_SUBSCRIPTION_KEY: "shared-apim-p-subscription-key"
COSMOS_RECEIPT_KEY: "cosmos-receipt-pkey"
OTEL_EXPORTER_OTLP_HEADERS: 'elastic-otl-secret-token'
OTEL_EXPORTER_OTLP_HEADERS: "elastic-otl-secret-token"
keyvault:
name: "pagopa-p-receipts-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
Expand Down
32 changes: 18 additions & 14 deletions 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-receipt-pdf-generator
tag: "1.3.2"
tag: "1.3.8-PRDP-145-feat-add-logo-management"
pullPolicy: Always
# https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs
livenessProbe:
Expand Down Expand Up @@ -54,8 +54,8 @@ microservice-chart:
allowPrivilegeEscalation: false
resources:
requests:
memory: "1512Mi"
cpu: "0.75"
memory: "1024Mi"
cpu: "0.40"
limits:
memory: "1512Mi"
cpu: "0.75"
Expand All @@ -81,15 +81,15 @@ microservice-chart:
ENV: "uat"
WEBSITE_SITE_NAME: "pagopareceiptpdfgenerator" # required to show cloud role name in application insights
FUNCTIONS_WORKER_RUNTIME: "java"
RECEIPT_QUEUE_TOPIC: 'pagopa-u-weu-receipts-queue-receipt-waiting-4-gen'
RECEIPT_QUEUE_TOPIC: "pagopa-u-weu-receipts-queue-receipt-waiting-4-gen"
RECEIPT_QUEUE_TOPIC_POISON: "pagopa-u-weu-receipts-queue-receipt-waiting-4-gen-poison"
COSMOS_RECEIPT_QUEUE_MAX_RETRY: '5'
PDF_ENGINE_ENDPOINT: 'https://api.uat.platform.pagopa.it/shared/pdf-engine/v1/generate-pdf'
COSMOS_RECEIPT_SERVICE_ENDPOINT: 'https://pagopa-u-weu-receipts-ds-cosmos-account.documents.azure.com:443/'
COSMOS_RECEIPT_DB_NAME: 'db'
COSMOS_RECEIPT_CONTAINER_NAME: 'receipts'
BLOB_STORAGE_ACCOUNT_ENDPOINT: 'https://pagopauweureceiptsfnsa.blob.core.windows.net'
BLOB_STORAGE_CONTAINER_NAME: 'pagopa-u-weu-receipts-azure-blob-receipt-st-attach'
COSMOS_RECEIPT_QUEUE_MAX_RETRY: "5"
PDF_ENGINE_ENDPOINT: "https://api.uat.platform.pagopa.it/shared/pdf-engine/v1/generate-pdf"
COSMOS_RECEIPT_SERVICE_ENDPOINT: "https://pagopa-u-weu-receipts-ds-cosmos-account.documents.azure.com:443/"
COSMOS_RECEIPT_DB_NAME: "db"
COSMOS_RECEIPT_CONTAINER_NAME: "receipts"
BLOB_STORAGE_ACCOUNT_ENDPOINT: "https://pagopauweureceiptsfnsa.blob.core.windows.net"
BLOB_STORAGE_CONTAINER_NAME: "pagopa-u-weu-receipts-azure-blob-receipt-st-attach"
WORKING_DIRECTORY_PATH: "/temp"
ENABLE_ECS_CONSOLE: "true"
CONSOLE_LOG_THRESHOLD: "DEBUG"
Expand All @@ -100,16 +100,20 @@ microservice-chart:
OTEL_LOGS_EXPORTER: "none"
OTEL_TRACES_SAMPLER: "always_on"
AZURE_FUNCTIONS_MESH_JAVA_OPTS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar -Xmx1024m -XX:+UseG1GC"
envConfigMapExternals:
template-maps:
PSP_INFO_MAP: psp-info-map
BRAND_LOGO_MAP: brand-logo-map
envFieldRef:
APP_NAME: "metadata.labels['app.kubernetes.io/instance']"
APP_VERSION: "metadata.labels['app.kubernetes.io/version']"
envSecret:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-u-connection-string'
APPLICATIONINSIGHTS_CONNECTION_STRING: "ai-u-connection-string"
RECEIPTS_STORAGE_CONN_STRING: "receipts-storage-account-connection-string"
COSMOS_RECEIPTS_CONN_STRING: "cosmos-receipt-connection-string"
OCP_APIM_SUBSCRIPTION_KEY: 'shared-apim-u-subscription-key'
OCP_APIM_SUBSCRIPTION_KEY: "shared-apim-u-subscription-key"
COSMOS_RECEIPT_KEY: "cosmos-receipt-pkey"
OTEL_EXPORTER_OTLP_HEADERS: 'elastic-otl-secret-token'
OTEL_EXPORTER_OTLP_HEADERS: "elastic-otl-secret-token"
keyvault:
name: "pagopa-u-receipts-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
Expand Down
4 changes: 2 additions & 2 deletions host.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"queues": {
"maxPollingInterval": "00:00:02",
"visibilityTimeout" : "00:00:30",
"batchSize": 8,
"batchSize": 12,
"maxDequeueCount": 5,
"newBatchThreshold": 4,
"newBatchThreshold": 6,
"messageEncoding": "none"
}
},
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>it.gov.pagopa.receipt</groupId>
<artifactId>receipt-pdf-generator</artifactId>
<version>1.3.2</version>
<version>1.3.8-PRDP-145-feat-add-logo-management</version>
<packaging>jar</packaging>

<name>pagopa-receipt-pdf-generator</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package it.gov.pagopa.receipt.pdf.generator.exception;

import com.fasterxml.jackson.core.JsonProcessingException;

public class PdfJsonMappingException extends RuntimeException {
public PdfJsonMappingException(JsonProcessingException e) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@ public class PSP {

private String name;
private PSPFee fee;
private String companyName;
private String logo;
private String address;
private String buildingNumber;
private String postalCode;
private String city;
private String province;

}
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,7 @@ private ReceiptPDFTemplate buildTemplate(BizEvent bizEvent, boolean partialTempl
.id(BizEventToPdfMapper.getId(bizEvent))
.timestamp(BizEventToPdfMapper.getTimestamp(bizEvent))
.amount(BizEventToPdfMapper.getAmount(bizEvent))
.psp(PSP.builder()
.name(BizEventToPdfMapper.getPspName(bizEvent))
.fee(PSPFee.builder()
.amount(BizEventToPdfMapper.getPspFee(bizEvent))
.build())
.build())
.psp(BizEventToPdfMapper.getPsp(bizEvent))
.rrn(BizEventToPdfMapper.getRnn(bizEvent))
.paymentMethod(PaymentMethod.builder()
.name(BizEventToPdfMapper.getPaymentMethodName(bizEvent))
Expand Down
Loading