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

[#PE-954] Fixed views update after profile update #240

Merged
merged 1 commit into from
Feb 10, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ public ResponseEntity<Profile> updateProfile(String agreementId, UpdateProfile u
"Hai cambiato la modalità di riconoscimento delle tue opportunità. Per riattivare l'opportunità, aggiorna i dati richiesti dalla nuova opportunità."));
}
profileEntity = profileService.updateProfile(agreementId, profileEntity);

// refresh views
discountService.refreshMaterializedViews(profileEntity);

return ResponseEntity.ok(profileConverter.toDto(profileEntity));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public CrudDiscountWrapper updateDiscount(String agreementId, Long discountId, D
discountEntity.setAgreement(agreementEntity);

discountRepository.save(dbEntity);

// refresh materialized views
refreshMaterializedViews(profile);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,6 @@ public ProfileEntity updateProfile(String agreementId, ProfileEntity newUpdatePr
agreementServiceLight.setDraftAgreementFromRejected(agreementEntity);
documentService.resetAllDocuments(agreementId);
}
// fix for misalignments with addresses
if (!profileEntity.getSalesChannel().equals(SalesChannelEnum.ONLINE) &&
profileEntity.getAddressList().isEmpty() && Boolean.FALSE.equals(profileEntity.getAllNationalAddresses())) {
profileEntity.setAllNationalAddresses(true);
}

validateProfile(profileEntity);

return profileEntity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ protected static class Initializer
// override timeout to 5 seconds
.withEnv("GREENMAIL_OPTS",
"-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.startup.timeout=5000");

static JdbcDatabaseContainer<?> postgres = new PostgisContainerProvider().newInstance("16-master")
.withDatabaseName(
"integration-tests-db")
Expand Down