Skip to content

Commit 49a4177

Browse files
[SELC-6580] Disabled deletion on PecNotification. Removed PecNotification from institution-ms (#66)
1 parent bad77e5 commit 49a4177

File tree

10 files changed

+0
-248
lines changed

10 files changed

+0
-248
lines changed

apps/institution-ms/app/src/test/java/it/pagopa/selfcare/mscore/integration_test/steps/InstitutionSteps.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
import io.cucumber.java.en.And;
66
import it.pagopa.selfcare.mscore.connector.dao.InstitutionRepository;
77
import it.pagopa.selfcare.mscore.connector.dao.MailNotificationRepository;
8-
import it.pagopa.selfcare.mscore.connector.dao.PecNotificationRepository;
98
import it.pagopa.selfcare.mscore.connector.dao.model.InstitutionEntity;
109
import it.pagopa.selfcare.mscore.connector.dao.model.MailNotificationEntity;
11-
import it.pagopa.selfcare.mscore.connector.dao.model.PecNotificationEntity;
1210
import it.pagopa.selfcare.mscore.connector.dao.model.inner.OnboardingEntity;
1311
import it.pagopa.selfcare.mscore.constant.Origin;
1412
import it.pagopa.selfcare.mscore.constant.RelationshipState;
@@ -29,20 +27,17 @@ public class InstitutionSteps {
2927

3028
private final SharedStepData sharedStepData;
3129
private final InstitutionRepository institutionRepository;
32-
private final PecNotificationRepository pecNotificationRepository;
3330
private final MailNotificationRepository mailNotificationRepository;
3431
private final MongoTemplate mongoTemplate;
3532

3633
private String mockInstitutionId;
3734

3835
public InstitutionSteps(SharedStepData sharedStepData,
3936
InstitutionRepository institutionRepository,
40-
PecNotificationRepository pecNotificationRepository,
4137
MailNotificationRepository mailNotificationRepository,
4238
MongoTemplate mongoTemplate) {
4339
this.sharedStepData = sharedStepData;
4440
this.institutionRepository = institutionRepository;
45-
this.pecNotificationRepository = pecNotificationRepository;
4641
this.mailNotificationRepository = mailNotificationRepository;
4742
this.mongoTemplate = mongoTemplate;
4843
}
@@ -65,7 +60,6 @@ public void removeSubunitAndParentInstitutionAfterScenario(Scenario scenario) {
6560
public void removeMockInstitution() {
6661
Optional.ofNullable(mockInstitutionId).ifPresent(id -> {
6762
institutionRepository.deleteById(id);
68-
mongoTemplate.remove(new Query(Criteria.where("institutionId").is(id)), PecNotificationEntity.class);
6963
mongoTemplate.remove(new Query(Criteria.where("institutionId").is(id)), MailNotificationEntity.class);
7064
});
7165
}
@@ -87,19 +81,6 @@ public void createMockInstitutionWithId(String id) {
8781
final InstitutionEntity savedEntity = institutionRepository.save(entity);
8882
mockInstitutionId = savedEntity.getId();
8983

90-
final PecNotificationEntity pecNotificationEntityIO = new PecNotificationEntity();
91-
pecNotificationEntityIO.setInstitutionId(mockInstitutionId);
92-
pecNotificationEntityIO.setProductId("prod-io");
93-
pecNotificationEntityIO.setModuleDayOfTheEpoch(10);
94-
pecNotificationEntityIO.setDigitalAddress("digital.address@test.com");
95-
pecNotificationRepository.save(pecNotificationEntityIO);
96-
final PecNotificationEntity pecNotificationEntityPA = new PecNotificationEntity();
97-
pecNotificationEntityPA.setInstitutionId(mockInstitutionId);
98-
pecNotificationEntityPA.setProductId("prod-pagopa");
99-
pecNotificationEntityPA.setModuleDayOfTheEpoch(20);
100-
pecNotificationEntityPA.setDigitalAddress("digital.address@test.com");
101-
pecNotificationRepository.save(pecNotificationEntityPA);
102-
10384
final MailNotificationEntity mailNotificationEntity = new MailNotificationEntity();
10485
mailNotificationEntity.setInstitutionId(mockInstitutionId);
10586
mailNotificationEntity.setProductIds(Set.of("prod-io", "prod-pagopa"));
@@ -150,12 +131,6 @@ public void checkOnboardingsStates(String institutionId, Map<String, String> exp
150131
entity.getOnboarding().forEach(e -> Assertions.assertEquals(expectedProductState.get(e.getProductId()), e.getStatus().name()));
151132
}
152133

153-
@And("Count of PecNotification with institutionId {string} is {long}")
154-
public void checkPecNotificationCount(String institutionId, long expectedCount) {
155-
long count = mongoTemplate.count(new Query(Criteria.where("institutionId").is(institutionId)), PecNotificationEntity.class);
156-
Assertions.assertEquals(expectedCount, count);
157-
}
158-
159134
@And("Count of MailNotification with institutionId {string} is {long}")
160135
public void checkMailNotificationCount(String institutionId, long expectedCount) {
161136
long count = mongoTemplate.count(new Query(Criteria.where("institutionId").is(institutionId)), MailNotificationEntity.class);

apps/institution-ms/app/src/test/resources/features/institution.feature

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,6 @@ Feature: Institution
11071107
| prod-idpay | DELETED |
11081108
| prod-pn | SUSPENDED |
11091109
| prod-io-premium | ACTIVE |
1110-
And Count of PecNotification with institutionId "123" is 2
11111110
And Count of MailNotification with institutionId "123" is 1
11121111
And Onboarding for institutionId "123" and productId "prod-io-premium" was saved to db successfully with token "123456789" contract "testContractPath" and a module of 10
11131112

@@ -1136,7 +1135,6 @@ Feature: Institution
11361135
And Onboardings of institution with id "123" have following states:
11371136
| prod-io | ACTIVE |
11381137
| prod-idpay | DELETED |
1139-
And Count of PecNotification with institutionId "123" is 0
11401138
And Count of MailNotification with institutionId "123" is 1
11411139
And Onboarding for institutionId "123" and productId "prod-io" was saved to db successfully with token "123456789" contract "testContractPath" and a module of 4
11421140

@@ -1169,7 +1167,6 @@ Feature: Institution
11691167
| prod-pagopa | ACTIVE |
11701168
| prod-idpay | DELETED |
11711169
| prod-pn | SUSPENDED |
1172-
And Count of PecNotification with institutionId "123" is 2
11731170
And Onboarding for institutionId "123" and productId "prod-pn" was saved to db successfully with token "MOCK_TOKEN" contract "MOCK_CONTRACT" and a module of 10
11741171

11751172
Scenario: Do not persist PecNotification with PT institution type
@@ -1190,7 +1187,6 @@ Feature: Institution
11901187
| prod-pagopa |
11911188
| prod-interop |
11921189
And The response body contains field "id"
1193-
And Count of PecNotification with institutionId "067327d3-bdd6-408d-8655-87e8f1960046" is 0
11941190
And Count of MailNotification with institutionId "067327d3-bdd6-408d-8655-87e8f1960046" is 0
11951191

11961192
Scenario: Not found institution while persistOnboarding
@@ -1248,7 +1244,6 @@ Feature: Institution
12481244
| prod-pagopa | DELETED |
12491245
| prod-idpay | DELETED |
12501246
| prod-pn | SUSPENDED |
1251-
And Count of PecNotification with institutionId "123" is 1
12521247
And Count of MailNotification with institutionId "123" is 1
12531248
And MailNotification for institutionId "123" and productId "prod-pagopa" was removed from db successfully
12541249
# No more products left in MailNotification
@@ -1263,7 +1258,6 @@ Feature: Institution
12631258
| prod-pagopa | DELETED |
12641259
| prod-idpay | DELETED |
12651260
| prod-pn | SUSPENDED |
1266-
And Count of PecNotification with institutionId "123" is 0
12671261
And Count of MailNotification with institutionId "123" is 0
12681262
And MailNotification for institutionId "123" was deleted from db successfully
12691263

@@ -1281,7 +1275,6 @@ Feature: Institution
12811275
| prod-pagopa | ACTIVE |
12821276
| prod-idpay | DELETED |
12831277
| prod-pn | SUSPENDED |
1284-
And Count of PecNotification with institutionId "123" is 2
12851278
And Count of MailNotification with institutionId "123" is 1
12861279

12871280
# GET /institutions/{id}/geotaxonomies

apps/institution-ms/connector-api/src/main/java/it/pagopa/selfcare/mscore/api/PecNotificationConnector.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/institution-ms/connector-api/src/main/java/it/pagopa/selfcare/mscore/model/pecnotification/PecNotification.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

apps/institution-ms/connector/dao/src/main/java/it/pagopa/selfcare/mscore/connector/dao/PecNotificationConnectorImpl.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

apps/institution-ms/connector/dao/src/main/java/it/pagopa/selfcare/mscore/connector/dao/PecNotificationRepository.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

apps/institution-ms/connector/dao/src/main/java/it/pagopa/selfcare/mscore/connector/dao/model/PecNotificationEntity.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

apps/institution-ms/connector/dao/src/test/java/it/pagopa/selfcare/mscore/connector/dao/PecNotificationConnectorImplTest.java

Lines changed: 0 additions & 79 deletions
This file was deleted.

apps/institution-ms/core/src/main/java/it/pagopa/selfcare/mscore/core/OnboardingServiceImpl.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import it.pagopa.selfcare.mscore.api.InstitutionConnector;
44
import it.pagopa.selfcare.mscore.api.MailNotificationConnector;
5-
import it.pagopa.selfcare.mscore.api.PecNotificationConnector;
65
import it.pagopa.selfcare.mscore.config.InstitutionSendMailConfig;
76
import it.pagopa.selfcare.mscore.constant.CustomError;
87
import it.pagopa.selfcare.mscore.constant.RelationshipState;
@@ -32,22 +31,19 @@ public class OnboardingServiceImpl implements OnboardingService {
3231
private final OnboardingDao onboardingDao;
3332
private final InstitutionService institutionService;
3433
private final InstitutionConnector institutionConnector;
35-
private final PecNotificationConnector pecNotificationConnector;
3634
private final MailNotificationConnector mailNotificationConnector;
3735

3836
private final InstitutionSendMailConfig institutionSendMailConfig;
3937

4038
public OnboardingServiceImpl(OnboardingDao onboardingDao,
4139
InstitutionService institutionService,
4240
InstitutionConnector institutionConnector,
43-
PecNotificationConnector pecNotificationConnector,
4441
MailNotificationConnector mailNotificationConnector,
4542
InstitutionSendMailConfig institutionSendMailConfig) {
4643

4744
this.onboardingDao = onboardingDao;
4845
this.institutionService = institutionService;
4946
this.institutionConnector = institutionConnector;
50-
this.pecNotificationConnector = pecNotificationConnector;
5147
this.mailNotificationConnector = mailNotificationConnector;
5248
this.institutionSendMailConfig = institutionSendMailConfig;
5349
}
@@ -148,7 +144,6 @@ private boolean isMailNotificationEnabled(Institution institution) {
148144
public void deleteOnboardedInstitution(String institutionId, String productId) {
149145
institutionConnector.findAndDeleteOnboarding(institutionId, productId);
150146
mailNotificationConnector.removeMailNotification(institutionId, productId);
151-
pecNotificationConnector.findAndDeletePecNotification(institutionId, productId);
152147
}
153148

154149
}

0 commit comments

Comments
 (0)