Skip to content

Commit 0b2a8e3

Browse files
Merge branch 'main' into PIDM-1487-fix-empty-cbill
2 parents c21f06c + 3e31f6b commit 0b2a8e3

File tree

8 files changed

+26
-7
lines changed

8 files changed

+26
-7
lines changed

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: pagopa-selfcare-ms-backoffice
33
description: Microservice that manage api keys for pagopa product from selfcare
44
type: application
55
version: 0.512.0
6-
appVersion: "2.43.1-1-PIDM-1487-fix-empty-cbill"
6+
appVersion: "2.43.2"
77
dependencies:
88
- name: microservice-chart
99
version: 7.5.0

helm/values-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ microservice-chart:
44
fullnameOverride: ""
55
image:
66
repository: ghcr.io/pagopa/pagopa-selfcare-ms-backoffice-backend
7-
tag: "2.43.1-1-PIDM-1487-fix-empty-cbill"
7+
tag: "2.43.2"
88
pullPolicy: Always
99
livenessProbe:
1010
httpGet:

helm/values-prod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ microservice-chart:
44
fullnameOverride: ""
55
image:
66
repository: ghcr.io/pagopa/pagopa-selfcare-ms-backoffice-backend
7-
tag: "2.43.1-1-PIDM-1487-fix-empty-cbill" #improve
7+
tag: "2.43.2" #improve
88
pullPolicy: Always
99
livenessProbe:
1010
httpGet:

helm/values-uat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ microservice-chart:
44
fullnameOverride: ""
55
image:
66
repository: ghcr.io/pagopa/pagopa-selfcare-ms-backoffice-backend
7-
tag: "2.43.1-1-PIDM-1487-fix-empty-cbill" #improve
7+
tag: "2.43.2" #improve
88
pullPolicy: Always
99
livenessProbe:
1010
httpGet:

openapi/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Microservice to manage PagoPA Backoffice",
55
"termsOfService": "https://www.pagopa.gov.it/",
66
"title": "SelfCare Backoffice",
7-
"version": "2.43.1-1-PIDM-1487-fix-empty-cbill"
7+
"version": "2.43.2"
88
},
99
"servers": [
1010
{

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<version>2.7.10</version>
1111
</parent>
1212
<artifactId>pagopa-selfcare-ms-backoffice</artifactId>
13-
<version>2.43.1-1-PIDM-1487-fix-empty-cbill</version>
13+
<version>2.43.2</version>
1414
<name>SelfCare Backoffice</name>
1515
<description>Microservice to manage PagoPA Backoffice</description>
1616

src/main/java/it/pagopa/selfcare/pagopa/backoffice/service/InstitutionServicesService.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
package it.pagopa.selfcare.pagopa.backoffice.service;
22

3+
import it.pagopa.selfcare.pagopa.backoffice.audit.AuditLogger;
34
import it.pagopa.selfcare.pagopa.backoffice.client.ExternalApiClient;
45
import it.pagopa.selfcare.pagopa.backoffice.config.InstitutionServicesConfig;
56
import it.pagopa.selfcare.pagopa.backoffice.entity.InstitutionRTPServiceEntity;
67
import it.pagopa.selfcare.pagopa.backoffice.exception.AppError;
78
import it.pagopa.selfcare.pagopa.backoffice.exception.AppException;
89
import it.pagopa.selfcare.pagopa.backoffice.model.institutions.*;
910
import it.pagopa.selfcare.pagopa.backoffice.model.institutions.client.Institution;
11+
import it.pagopa.selfcare.pagopa.backoffice.util.Utility;
12+
import lombok.extern.slf4j.Slf4j;
1013
import org.springframework.beans.factory.annotation.Autowired;
1114
import org.springframework.data.mongodb.repository.MongoRepository;
15+
import org.springframework.security.core.context.SecurityContextHolder;
1216
import org.springframework.stereotype.Service;
1317

1418
import java.time.Instant;
1519
import java.time.ZoneId;
1620
import java.util.List;
1721

1822
@Service
23+
@Slf4j
1924
public class InstitutionServicesService {
2025
private final MongoRepository<InstitutionRTPServiceEntity, String> rtpServiceRepository;
2126
private final ExternalApiClient externalApiClient;
2227
private final InstitutionServicesConfig servicesConfig;
28+
private final AuditLogger auditLogger;
2329
private static final String ORIGIN_IPA = "IPA";
2430

2531
@Autowired
2632
public InstitutionServicesService(MongoRepository<InstitutionRTPServiceEntity, String> rtpServiceRepository,
27-
ExternalApiClient externalApiClient, InstitutionServicesConfig servicesConfig){
33+
ExternalApiClient externalApiClient, InstitutionServicesConfig servicesConfig,
34+
AuditLogger auditLogger){
2835
this.rtpServiceRepository = rtpServiceRepository;
2936
this.externalApiClient = externalApiClient;
3037
this.servicesConfig = servicesConfig;
38+
this.auditLogger = auditLogger;
3139
}
3240

3341
public ServiceConsentResponse saveServiceConsent(ServiceConsentRequest serviceConsentRequest,
@@ -55,6 +63,13 @@ public ServiceConsentResponse saveServiceConsent(ServiceConsentRequest serviceCo
5563
.consentDate(Instant.now())
5664
.build();
5765
rtpServiceRepository.save(entity);
66+
auditLogger.info(log,
67+
"event=CONSENT_UPDATE institutionId={} serviceId={} userId={} institutionTaxCode={} consent={}",
68+
institutionId,
69+
serviceId,
70+
Utility.extractUserIdFromAuth(SecurityContextHolder.getContext().getAuthentication()),
71+
institution.getTaxCode(),
72+
serviceConsentRequest.getConsent());
5873
response = new ServiceConsentResponse(serviceConsentRequest.getConsent(),
5974
entity.getConsentDate().atZone(ZoneId.of("Europe/Rome")).toOffsetDateTime());
6075
break;

src/test/java/it/pagopa/selfcare/pagopa/backoffice/service/InstitutionServicesServiceTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package it.pagopa.selfcare.pagopa.backoffice.service;
22

3+
import it.pagopa.selfcare.pagopa.backoffice.audit.AuditLogger;
34
import it.pagopa.selfcare.pagopa.backoffice.client.ExternalApiClient;
45
import it.pagopa.selfcare.pagopa.backoffice.config.InstitutionServicesConfig;
56
import it.pagopa.selfcare.pagopa.backoffice.entity.InstitutionRTPServiceEntity;
@@ -38,6 +39,9 @@ class InstitutionServicesServiceTest {
3839
@Mock
3940
private InstitutionServicesConfig defaultServicesConfig;
4041

42+
@Mock
43+
private AuditLogger auditLogger;
44+
4145
@InjectMocks
4246
private InstitutionServicesService sut;
4347

0 commit comments

Comments
 (0)