Skip to content

Commit

Permalink
Préavis - Ne pas afficher dans les préavis à vérifier les préavis inv…
Browse files Browse the repository at this point in the history
…alidés (#3532)

## Linked issues

- Resolve #3531

----

- [ ] Tests E2E (Cypress)
  • Loading branch information
louptheron authored Aug 14, 2024
2 parents c67b398 + 8c4e06c commit 924fbc1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class JpaLogbookReportRepository(
}
}.filter {
it.logbookMessageAndValue.value.isInVerificationScope == true &&
it.logbookMessageAndValue.value.isVerified == false
it.logbookMessageAndValue.value.isVerified == false &&
it.logbookMessageAndValue.value.isInvalidated != true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class JpaManualPriorNotificationRepository(
willArriveAfter = CustomZonedDateTime(ZonedDateTime.now()).toString(),
willArriveBefore = CustomZonedDateTime(ZonedDateTime.now().plusHours(24)).toString(),
).filter {
it.value.isInVerificationScope == true && it.value.isVerified == false
it.value.isInVerificationScope == true &&
it.value.isVerified == false &&
it.value.isInvalidated != true
}
.map {
it.toPriorNotification()
Expand All @@ -70,6 +72,7 @@ class JpaManualPriorNotificationRepository(
}

@Transactional
@CacheEvict(value = ["pno_to_verify"], allEntries = true)
override fun save(newOrNextPriorNotification: PriorNotification): PriorNotification {
try {
val manualPriorNotificationEntity = dbManualPriorNotificationRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ class JpaLogbookReportRepositoryITests : AbstractDBTests() {
assertThat(result).hasSizeGreaterThan(0)
assertThat(result.all { it.logbookMessageAndValue.value.isVerified == false }).isTrue()
assertThat(result.all { it.logbookMessageAndValue.value.isInVerificationScope == true }).isTrue()
assertThat(result.all { it.logbookMessageAndValue.value.isInvalidated == null }).isTrue()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ class JpaManualPriorNotificationRepositoryITests : AbstractDBTests() {
assertThat(result).hasSizeGreaterThan(0)
assertThat(result.filter { it.logbookMessageAndValue.value.isVerified == false }).hasSize(1)
assertThat(result.filter { it.logbookMessageAndValue.value.isInVerificationScope == true }).hasSize(1)
assertThat(result.filter { it.logbookMessageAndValue.value.isInvalidated == null }).hasSize(1)
}

@Test
Expand Down

0 comments on commit 924fbc1

Please sign in to comment.