From 238269cb729ae29df8bef4a17c94275d89d12c95 Mon Sep 17 00:00:00 2001 From: Thomas Brosset Date: Tue, 17 Oct 2023 09:09:43 +0200 Subject: [PATCH] fix after rebase --- .../domain/mappers/EnvActionMapper.kt | 6 ++++- .../database/model/EnvActionModel.kt | 26 +++++++++---------- .../repositories/JpaBaseRepositoryITests.kt | 4 +-- .../JpaControlUnitRepositoryITests.kt | 13 +++++++--- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/mappers/EnvActionMapper.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/mappers/EnvActionMapper.kt index 5405b05f7..4788457d7 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/mappers/EnvActionMapper.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/mappers/EnvActionMapper.kt @@ -31,8 +31,8 @@ object EnvActionMapper { value: String?, isAdministrativeControl: Boolean?, isComplianceWithWaterRegulationsControl: Boolean?, - isSeafarersControl: Boolean?, isSafetyEquipmentAndStandardsComplianceControl: Boolean?, + isSeafarersControl: Boolean?, ): EnvActionEntity { return try { if (!value.isNullOrEmpty() && value != jsonbNullString) { @@ -58,6 +58,10 @@ object EnvActionMapper { facade, department, geom, + isAdministrativeControl, + isComplianceWithWaterRegulationsControl, + isSafetyEquipmentAndStandardsComplianceControl, + isSeafarersControl, ) ActionTypeEnum.NOTE -> mapper.readValue( value, diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/model/EnvActionModel.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/model/EnvActionModel.kt index 77cd82eff..ffe07c900 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/model/EnvActionModel.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/model/EnvActionModel.kt @@ -87,19 +87,19 @@ data class EnvActionModel( fun toActionEntity(mapper: ObjectMapper): EnvActionEntity { return EnvActionMapper.getEnvActionEntityFromJSON( - mapper, - id, - actionStartDateTime?.atZone(UTC), - actionEndDateTime?.atZone(UTC), - geom, - actionType, - facade, - department, - value, - isAdministrativeControl, - isComplianceWithWaterRegulationsControl, - isSafetyEquipmentAndStandardsComplianceControl, - isSeafarersControl, + mapper = mapper, + id = id, + actionStartDateTimeUtc = actionStartDateTime?.atZone(UTC), + actionEndDateTimeUtc = actionEndDateTime?.atZone(UTC), + geom = geom, + actionType = actionType, + facade = facade, + department = department, + value = value, + isAdministrativeControl = isAdministrativeControl, + isComplianceWithWaterRegulationsControl = isComplianceWithWaterRegulationsControl, + isSafetyEquipmentAndStandardsComplianceControl = isSafetyEquipmentAndStandardsComplianceControl, + isSeafarersControl = isSeafarersControl, ) } companion object { diff --git a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaBaseRepositoryITests.kt b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaBaseRepositoryITests.kt index 36c1f7e72..8503c7351 100644 --- a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaBaseRepositoryITests.kt +++ b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaBaseRepositoryITests.kt @@ -93,7 +93,7 @@ class JpaBaseRepositoryITests : AbstractDBTests() { ControlUnitResourceEntity( id = 8, baseId = 3, - controlUnitId = 10010, + controlUnitId = 10121, name = "PAM Jeanne Barret", note = null, photo = null, @@ -102,7 +102,7 @@ class JpaBaseRepositoryITests : AbstractDBTests() { ControlUnitResourceEntity( id = 9, baseId = 3, - controlUnitId = 10011, + controlUnitId = 10080, name = "PAM Themis", note = null, photo = null, diff --git a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaControlUnitRepositoryITests.kt b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaControlUnitRepositoryITests.kt index ad3ff8aad..4485688c4 100644 --- a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaControlUnitRepositoryITests.kt +++ b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaControlUnitRepositoryITests.kt @@ -174,14 +174,19 @@ class JpaControlUnitRepositoryITests : AbstractDBTests() { controlUnitContacts = listOf(), controlUnitResources = listOf( FullControlUnitResourceDTO( - base = BaseEntity(id = 3, name = "Dunkerque"), + base = BaseEntity( + id = 3, + name = "Dunkerque", + latitude = 51.035534, + longitude = 2.372845, + ), controlUnit = ControlUnitEntity( id = 10121, administrationId = 1009, areaNote = null, isArchived = false, name = "PAM Jeanne Barret", - termsNote = null + termsNote = null, ), controlUnitResource = ControlUnitResourceEntity( id = 8, @@ -190,8 +195,8 @@ class JpaControlUnitRepositoryITests : AbstractDBTests() { name = "PAM Jeanne Barret", note = null, photo = null, - type = ControlUnitResourceType.FRIGATE - ) + type = ControlUnitResourceType.FRIGATE, + ), ), ), ),