From 821253b8eb0355569dc79cfda255f08bce84dde4 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Tue, 13 Aug 2024 15:50:33 +0200 Subject: [PATCH 1/3] Restore send state on save for logbook prior notifications --- .../database/repositories/JpaLogbookReportRepository.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaLogbookReportRepository.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaLogbookReportRepository.kt index 0566a0d38e..8bf442c760 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaLogbookReportRepository.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaLogbookReportRepository.kt @@ -425,6 +425,10 @@ class JpaLogbookReportRepository( * - the PDF will be re-generated (done in the use case by deleting the old one) * - the PNO will require another verification before sending */ + if (pnoMessage.isInVerificationScope == true) { + pnoMessage.isBeingSent = false + pnoMessage.isSent = false + } pnoMessage.isVerified = false val nextMessage = objectMapper.writeValueAsString(pnoMessage) From 4dfe172a37a42e812f62cec35b38960f430967e6 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Tue, 13 Aug 2024 16:41:55 +0200 Subject: [PATCH 2/3] Fix logger instantiation in PriorNotification entity --- .../domain/entities/prior_notification/PriorNotification.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/prior_notification/PriorNotification.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/prior_notification/PriorNotification.kt index 01f9823e47..5a53876cf9 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/prior_notification/PriorNotification.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/prior_notification/PriorNotification.kt @@ -33,7 +33,6 @@ data class PriorNotification( ) { /** Each prior notification and each of its updates have a unique fingerprint. */ val fingerprint: String = listOf(reportId, updatedAt, state).joinToString(separator = ".") - private val logger = LoggerFactory.getLogger(PriorNotification::class.java) val state: PriorNotificationState? /** @@ -138,6 +137,8 @@ data class PriorNotification( } companion object { + private val logger = LoggerFactory.getLogger(PriorNotification::class.java) + /** * Next initial state of the prior notification once it will be created or updated. * From af3bf90a9cef8bac0b624a80d65079719ff063e4 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Tue, 13 Aug 2024 16:43:59 +0200 Subject: [PATCH 3/3] Restore send state reset on save for logbook prior notifications --- .../database/repositories/JpaLogbookReportRepository.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaLogbookReportRepository.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaLogbookReportRepository.kt index 8bf442c760..b7b629bb33 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaLogbookReportRepository.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaLogbookReportRepository.kt @@ -425,10 +425,8 @@ class JpaLogbookReportRepository( * - the PDF will be re-generated (done in the use case by deleting the old one) * - the PNO will require another verification before sending */ - if (pnoMessage.isInVerificationScope == true) { - pnoMessage.isBeingSent = false - pnoMessage.isSent = false - } + pnoMessage.isBeingSent = false + pnoMessage.isSent = false pnoMessage.isVerified = false val nextMessage = objectMapper.writeValueAsString(pnoMessage)