diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotification.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotification.kt index accb213478..5e4ed46484 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotification.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotification.kt @@ -29,7 +29,6 @@ class CreateOrUpdateManualPriorNotification( fun execute( reportId: String?, - authorTrigram: String, didNotFishAfterZeroNotice: Boolean, expectedArrivalDate: ZonedDateTime, expectedLandingDate: ZonedDateTime, @@ -75,7 +74,6 @@ class CreateOrUpdateManualPriorNotification( val priorNotificationTypes = computedValues.types.map { it.toPriorNotificationType() } val message = getMessage( - authorTrigram = authorTrigram, expectedArrivalDate = expectedArrivalDate, expectedLandingDate = expectedLandingDate, // At the moment, manual prior notifications only have a single global FAO area field in Frontend, @@ -166,7 +164,6 @@ class CreateOrUpdateManualPriorNotification( } private fun getMessage( - authorTrigram: String, purpose: LogbookMessagePurpose, expectedArrivalDate: ZonedDateTime, expectedLandingDate: ZonedDateTime, diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PriorNotificationController.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PriorNotificationController.kt index 84fea18365..7eca982123 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PriorNotificationController.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PriorNotificationController.kt @@ -220,14 +220,13 @@ class PriorNotificationController( ): ManualPriorNotificationFormDataOutput { val createdPriorNotification = createOrUpdateManualPriorNotification.execute( - hasPortEntranceAuthorization = manualPriorNotificationFormDataInput.hasPortEntranceAuthorization, - hasPortLandingAuthorization = manualPriorNotificationFormDataInput.hasPortLandingAuthorization, - authorTrigram = manualPriorNotificationFormDataInput.authorTrigram, didNotFishAfterZeroNotice = manualPriorNotificationFormDataInput.didNotFishAfterZeroNotice, expectedArrivalDate = manualPriorNotificationFormDataInput.expectedArrivalDate, expectedLandingDate = manualPriorNotificationFormDataInput.expectedLandingDate, - globalFaoArea = manualPriorNotificationFormDataInput.globalFaoArea, fishingCatches = manualPriorNotificationFormDataInput.fishingCatches.map { it.toLogbookFishingCatch() }, + globalFaoArea = manualPriorNotificationFormDataInput.globalFaoArea, + hasPortEntranceAuthorization = manualPriorNotificationFormDataInput.hasPortEntranceAuthorization, + hasPortLandingAuthorization = manualPriorNotificationFormDataInput.hasPortLandingAuthorization, note = manualPriorNotificationFormDataInput.note, portLocode = manualPriorNotificationFormDataInput.portLocode, reportId = null, @@ -253,14 +252,13 @@ class PriorNotificationController( ): ManualPriorNotificationFormDataOutput { val updatedPriorNotification = createOrUpdateManualPriorNotification.execute( - hasPortEntranceAuthorization = manualPriorNotificationFormDataInput.hasPortEntranceAuthorization, - hasPortLandingAuthorization = manualPriorNotificationFormDataInput.hasPortLandingAuthorization, - authorTrigram = manualPriorNotificationFormDataInput.authorTrigram, didNotFishAfterZeroNotice = manualPriorNotificationFormDataInput.didNotFishAfterZeroNotice, expectedArrivalDate = manualPriorNotificationFormDataInput.expectedArrivalDate, expectedLandingDate = manualPriorNotificationFormDataInput.expectedLandingDate, - globalFaoArea = manualPriorNotificationFormDataInput.globalFaoArea, fishingCatches = manualPriorNotificationFormDataInput.fishingCatches.map { it.toLogbookFishingCatch() }, + globalFaoArea = manualPriorNotificationFormDataInput.globalFaoArea, + hasPortEntranceAuthorization = manualPriorNotificationFormDataInput.hasPortEntranceAuthorization, + hasPortLandingAuthorization = manualPriorNotificationFormDataInput.hasPortLandingAuthorization, note = manualPriorNotificationFormDataInput.note, portLocode = manualPriorNotificationFormDataInput.portLocode, reportId = reportId, diff --git a/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotificationITests.kt b/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotificationITests.kt index 795d5a1f81..95e82bc431 100644 --- a/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotificationITests.kt +++ b/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotificationITests.kt @@ -356,12 +356,11 @@ class CreateOrUpdateManualPriorNotificationITests : AbstractDBTests() { val afterPriorNotification = createOrUpdateManualPriorNotification.execute( reportId = reportId, - authorTrigram = "ABC", didNotFishAfterZeroNotice = false, expectedArrivalDate = ZonedDateTime.now(), expectedLandingDate = ZonedDateTime.now(), - globalFaoArea = "FAKE_FAO_AREA", fishingCatches = emptyList(), + globalFaoArea = "FAKE_FAO_AREA", hasPortEntranceAuthorization = false, hasPortLandingAuthorization = false, note = null, @@ -369,7 +368,7 @@ class CreateOrUpdateManualPriorNotificationITests : AbstractDBTests() { purpose = LogbookMessagePurpose.LAN, sentAt = ZonedDateTime.now(), tripGearCodes = emptyList(), - updatedBy = "bob@example.org", + updatedBy = "editor@example.org", vesselId = 1, ) @@ -406,7 +405,6 @@ class CreateOrUpdateManualPriorNotificationITests : AbstractDBTests() { val afterPriorNotification = createOrUpdateManualPriorNotification.execute( reportId = reportId, - authorTrigram = "ABC", didNotFishAfterZeroNotice = false, expectedArrivalDate = ZonedDateTime.now(), expectedLandingDate = ZonedDateTime.now(), @@ -419,7 +417,7 @@ class CreateOrUpdateManualPriorNotificationITests : AbstractDBTests() { purpose = LogbookMessagePurpose.LAN, sentAt = ZonedDateTime.now(), tripGearCodes = emptyList(), - updatedBy = "bob@example.org", + updatedBy = "editor@example.org", vesselId = 1, ) diff --git a/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotificationUTests.kt b/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotificationUTests.kt index 7ceb52e371..588f119486 100644 --- a/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotificationUTests.kt +++ b/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/prior_notification/CreateOrUpdateManualPriorNotificationUTests.kt @@ -85,21 +85,20 @@ class CreateOrUpdateManualPriorNotificationUTests { computeManualPriorNotification, getPriorNotification, ).execute( - hasPortEntranceAuthorization = true, - hasPortLandingAuthorization = true, purpose = LogbookMessagePurpose.LAN, - authorTrigram = "ABC", didNotFishAfterZeroNotice = false, expectedArrivalDate = ZonedDateTime.parse("2024-01-01T00:00:00Z"), expectedLandingDate = ZonedDateTime.parse("2024-01-01T00:00:00Z"), - globalFaoArea = "FAKE_FAO_AREA", fishingCatches = emptyList(), + globalFaoArea = "FAKE_FAO_AREA", + hasPortEntranceAuthorization = true, + hasPortLandingAuthorization = true, note = null, portLocode = "FAKE_PORT_LOCODE", reportId = fakePriorNotification.reportId!!, sentAt = ZonedDateTime.parse("2024-01-01T00:00:00Z"), tripGearCodes = emptyList(), - updatedBy = "bob@example.org", + updatedBy = "editor@example.org", vesselId = 1, ) diff --git a/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PriorNotificationControllerUTests.kt b/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PriorNotificationControllerUTests.kt index 96a9b8f348..ba32f5506e 100644 --- a/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PriorNotificationControllerUTests.kt +++ b/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PriorNotificationControllerUTests.kt @@ -218,7 +218,6 @@ class PriorNotificationControllerUTests { anyOrNull(), anyOrNull(), anyOrNull(), - anyOrNull(), ), ) .willReturn(fakePriorNotification) @@ -262,12 +261,11 @@ class PriorNotificationControllerUTests { given( createOrUpdateManualPriorNotification.execute( reportId = any(), - authorTrigram = anyOrNull(), didNotFishAfterZeroNotice = anyOrNull(), expectedArrivalDate = anyOrNull(), expectedLandingDate = anyOrNull(), - globalFaoArea = anyOrNull(), fishingCatches = anyOrNull(), + globalFaoArea = anyOrNull(), hasPortEntranceAuthorization = anyOrNull(), hasPortLandingAuthorization = anyOrNull(), note = anyOrNull(),