Skip to content

Commit

Permalink
Fix Upsert
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitolo-Andrea committed Nov 13, 2024
1 parent 6bc83a6 commit 16fa3c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/it/gov/pagopa/tpp/service/TppServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ private Mono<Tpp> createAndSaveNewTpp(TppDTO tppDTO, String tppId) {
log.info("[TPP-SERVICE][UPSERT] Creating new entry with generated tppId: {}", tppId);
Tpp tppToSave = mapperToObject.map(tppDTO);
tppToSave.setTppId(tppId);
tppToSave.setLastUpdateDate(LocalDateTime.now());
tppToSave.setCreationDate(LocalDateTime.now());
return tppRepository.save(tppToSave)
.doOnSuccess(savedTpp -> log.info("[TPP-SERVICE][UPSERT] Created new TPP with tppId: {}", tppToSave.getTppId()))
.doOnError(error -> log.error("[TPP-SERVICE][SAVE] Error saving TPP with tppId {}: {}", tppToSave.getTppId(), error.getMessage()));
Expand Down

0 comments on commit 16fa3c0

Please sign in to comment.