Skip to content

Commit

Permalink
Remove left authorTrigram param in CreateOrUpdateManualPriorNotification
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Oct 16, 2024
1 parent c59076b commit 0d47cef
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class CreateOrUpdateManualPriorNotification(

fun execute(
reportId: String?,
authorTrigram: String,
didNotFishAfterZeroNotice: Boolean,
expectedArrivalDate: ZonedDateTime,
expectedLandingDate: ZonedDateTime,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -166,7 +164,6 @@ class CreateOrUpdateManualPriorNotification(
}

private fun getMessage(
authorTrigram: String,
purpose: LogbookMessagePurpose,
expectedArrivalDate: ZonedDateTime,
expectedLandingDate: ZonedDateTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,20 +356,19 @@ 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,
portLocode = "FRVNE",
purpose = LogbookMessagePurpose.LAN,
sentAt = ZonedDateTime.now(),
tripGearCodes = emptyList(),
updatedBy = "bob@example.org",
updatedBy = "editor@example.org",
vesselId = 1,
)

Expand Down Expand Up @@ -406,7 +405,6 @@ class CreateOrUpdateManualPriorNotificationITests : AbstractDBTests() {
val afterPriorNotification =
createOrUpdateManualPriorNotification.execute(
reportId = reportId,
authorTrigram = "ABC",
didNotFishAfterZeroNotice = false,
expectedArrivalDate = ZonedDateTime.now(),
expectedLandingDate = ZonedDateTime.now(),
Expand All @@ -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,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ class PriorNotificationControllerUTests {
anyOrNull(),
anyOrNull(),
anyOrNull(),
anyOrNull(),
),
)
.willReturn(fakePriorNotification)
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 0d47cef

Please sign in to comment.