diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/entities/missions/MissionEntity.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/entities/missions/MissionEntity.kt index 0b484cc37..f0cdd62a2 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/entities/missions/MissionEntity.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/domain/entities/missions/MissionEntity.kt @@ -18,6 +18,7 @@ data class MissionEntity( val envActions: List? = listOf(), val isClosed: Boolean, val isDeleted: Boolean, + val isGeometryComputedFromControls: Boolean, val missionSource: MissionSourceEnum, val hasMissionOrder: Boolean, val isUnderJdp: Boolean, diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/ControllersExceptionHandler.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/ControllersExceptionHandler.kt index d81f8787b..03c861f95 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/ControllersExceptionHandler.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/ControllersExceptionHandler.kt @@ -1,7 +1,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.ApiError -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.MissingParameterApiError +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.ApiError +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.MissingParameterApiError import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.core.Ordered.HIGHEST_PRECEDENCE diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/inputs/CreateOrUpdateMissionDataInput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/inputs/CreateOrUpdateMissionDataInput.kt similarity index 94% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/inputs/CreateOrUpdateMissionDataInput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/inputs/CreateOrUpdateMissionDataInput.kt index b68b351cc..6b109778c 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/inputs/CreateOrUpdateMissionDataInput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/inputs/CreateOrUpdateMissionDataInput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.inputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.inputs import fr.gouv.cacem.monitorenv.domain.entities.controlResources.ControlUnitEntity import fr.gouv.cacem.monitorenv.domain.entities.missions.EnvActionEntity @@ -48,6 +48,7 @@ data class CreateOrUpdateMissionDataInput( envActions = this.envActions, hasMissionOrder = hasMissionOrder, isUnderJdp = isUnderJdp, + isGeometryComputedFromControls = false ) } } diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/AMPDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/AMPDataOutput.kt similarity index 87% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/AMPDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/AMPDataOutput.kt index 29512b498..e8a51be71 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/AMPDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/AMPDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.amp.AMPEntity import org.locationtech.jts.geom.MultiPolygon diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ApiError.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ApiError.kt similarity index 71% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ApiError.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ApiError.kt index e3e66a247..761773a25 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ApiError.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ApiError.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs class ApiError(val error: String, val type: String) { constructor(exception: Throwable) : this(exception.cause?.message ?: "", exception.cause?.javaClass?.simpleName.toString()) diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlResourceDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlResourceDataOutput.kt similarity index 84% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlResourceDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlResourceDataOutput.kt index 42b375622..b72822251 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlResourceDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlResourceDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.controlResources.ControlResourceEntity diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlThemeDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlThemeDataOutput.kt similarity index 86% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlThemeDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlThemeDataOutput.kt index 8c88ac04b..838f67402 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlThemeDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlThemeDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.controlThemes.ControlThemeEntity diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlUnitDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlUnitDataOutput.kt similarity index 90% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlUnitDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlUnitDataOutput.kt index b8f84a292..b2faa8baf 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/ControlUnitDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/ControlUnitDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.controlResources.ControlUnitEntity diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/GeoJsonOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/GeoJsonOutput.kt similarity index 81% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/GeoJsonOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/GeoJsonOutput.kt index 5a725b421..7f3bf63f1 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/GeoJsonOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/GeoJsonOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import org.n52.jackson.datatype.jts.GeometrySerializer diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/HealthDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/HealthDataOutput.kt similarity index 88% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/HealthDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/HealthDataOutput.kt index 9d8174d35..e3cbe0ccb 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/HealthDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/HealthDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.health.Health diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/MissingParameterApiError.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/MissingParameterApiError.kt new file mode 100644 index 000000000..ed3e7a023 --- /dev/null +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/MissingParameterApiError.kt @@ -0,0 +1,3 @@ +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs + +data class MissingParameterApiError(val error: String) diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/MissionDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/MissionDataOutput.kt similarity index 96% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/MissionDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/MissionDataOutput.kt index 38340ff59..40148b6d2 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/MissionDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/MissionDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.controlResources.ControlUnitEntity import fr.gouv.cacem.monitorenv.domain.entities.missions.EnvActionEntity diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/NatinfDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/NatinfDataOutput.kt similarity index 87% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/NatinfDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/NatinfDataOutput.kt index 8e409b476..54f6635e6 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/NatinfDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/NatinfDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.natinfs.NatinfEntity diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/RegulatoryAreaDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/RegulatoryAreaDataOutput.kt similarity index 96% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/RegulatoryAreaDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/RegulatoryAreaDataOutput.kt index 56a6aca3b..d968063a0 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/RegulatoryAreaDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/RegulatoryAreaDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.regulatoryAreas.RegulatoryAreaEntity import org.locationtech.jts.geom.MultiPolygon diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/SemaphoreDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/SemaphoreDataOutput.kt similarity index 92% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/SemaphoreDataOutput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/SemaphoreDataOutput.kt index 67ca3cbcb..30f0e278e 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/SemaphoreDataOutput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/bff/outputs/SemaphoreDataOutput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs import fr.gouv.cacem.monitorenv.domain.entities.semaphores.SemaphoreEntity import org.locationtech.jts.geom.Point diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/MissingParameterApiError.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/MissingParameterApiError.kt deleted file mode 100644 index 0410eba09..000000000 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/MissingParameterApiError.kt +++ /dev/null @@ -1,3 +0,0 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs - -data class MissingParameterApiError(val error: String) diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/inputs/CreateOrUpdatePublicMissionDataInput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/publicapi/inputs/CreateOrUpdateMissionDataInput.kt similarity index 88% rename from backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/inputs/CreateOrUpdatePublicMissionDataInput.kt rename to backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/publicapi/inputs/CreateOrUpdateMissionDataInput.kt index ed63ca3a7..4fec7fa42 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/inputs/CreateOrUpdatePublicMissionDataInput.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/publicapi/inputs/CreateOrUpdateMissionDataInput.kt @@ -1,4 +1,4 @@ -package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.inputs +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.publicapi.inputs import fr.gouv.cacem.monitorenv.domain.entities.controlResources.ControlUnitEntity import fr.gouv.cacem.monitorenv.domain.entities.missions.EnvActionEntity @@ -8,7 +8,7 @@ import fr.gouv.cacem.monitorenv.domain.entities.missions.MissionTypeEnum import org.locationtech.jts.geom.MultiPolygon import java.time.ZonedDateTime -data class CreateOrUpdatePublicMissionDataInput( +data class CreateOrUpdateMissionDataInput( val id: Int? = null, val missionTypes: List, val controlUnits: List = listOf(), @@ -25,6 +25,7 @@ data class CreateOrUpdatePublicMissionDataInput( val envActions: List? = null, val hasMissionOrder: Boolean, val isUnderJdp: Boolean, + val isGeometryComputedFromControls: Boolean ) { fun toMissionEntity(): MissionEntity { return MissionEntity( @@ -45,6 +46,7 @@ data class CreateOrUpdatePublicMissionDataInput( envActions = this.envActions, hasMissionOrder = this.hasMissionOrder, isUnderJdp = this.isUnderJdp, + isGeometryComputedFromControls = this.isGeometryComputedFromControls ) } } diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/publicapi/outputs/MissionDataOutput.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/publicapi/outputs/MissionDataOutput.kt new file mode 100644 index 000000000..3c4b105d2 --- /dev/null +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/publicapi/outputs/MissionDataOutput.kt @@ -0,0 +1,57 @@ +package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.publicapi.outputs + +import fr.gouv.cacem.monitorenv.domain.entities.controlResources.ControlUnitEntity +import fr.gouv.cacem.monitorenv.domain.entities.missions.EnvActionEntity +import fr.gouv.cacem.monitorenv.domain.entities.missions.MissionEntity +import fr.gouv.cacem.monitorenv.domain.entities.missions.MissionSourceEnum +import fr.gouv.cacem.monitorenv.domain.entities.missions.MissionTypeEnum +import org.locationtech.jts.geom.MultiPolygon +import java.time.ZonedDateTime + +data class MissionDataOutput( + val id: Int, + val missionTypes: List, + val controlUnits: List? = listOf(), + val openBy: String? = null, + val closedBy: String? = null, + val observationsCacem: String? = null, + val observationsCnsp: String? = null, + val facade: String? = null, + val geom: MultiPolygon? = null, + val startDateTimeUtc: ZonedDateTime, + val endDateTimeUtc: ZonedDateTime? = null, + val envActions: List? = null, + val missionSource: MissionSourceEnum, + val isClosed: Boolean, + val hasMissionOrder: Boolean, + val isUnderJdp: Boolean, + val isGeometryComputedFromControls: Boolean +) { + companion object { + fun fromMission(mission: MissionEntity): MissionDataOutput { + requireNotNull(mission.id) { + "a mission must have an id" + } + + return MissionDataOutput( + id = mission.id, + missionTypes = mission.missionTypes, + controlUnits = mission.controlUnits, + openBy = mission.openBy, + closedBy = mission.closedBy, + observationsCacem = mission.observationsCacem, + observationsCnsp = mission.observationsCnsp, + facade = mission.facade, + geom = mission.geom, + startDateTimeUtc = mission.startDateTimeUtc, + endDateTimeUtc = mission.endDateTimeUtc, + envActions = mission.envActions, + missionSource = mission.missionSource, + isClosed = mission.isClosed, + hasMissionOrder = mission.hasMissionOrder, + isUnderJdp = mission.isUnderJdp, + isGeometryComputedFromControls = mission.isGeometryComputedFromControls + ) + } + } +} diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/AMPsController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/AMPsController.kt index 60d9b5458..7e0966263 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/AMPsController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/AMPsController.kt @@ -2,7 +2,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.bff import com.fasterxml.jackson.databind.ObjectMapper import fr.gouv.cacem.monitorenv.domain.use_cases.amps.GetAMPs -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.AMPDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.AMPDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import org.springframework.web.bind.annotation.GetMapping diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/ControlThemesController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/ControlThemesController.kt index e0c64d3b7..c9f99cbcf 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/ControlThemesController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/ControlThemesController.kt @@ -2,7 +2,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.bff import fr.gouv.cacem.monitorenv.domain.use_cases.controlThemes.GetControlThemeById import fr.gouv.cacem.monitorenv.domain.use_cases.controlThemes.GetControlThemes -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.ControlThemeDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.ControlThemeDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import jakarta.websocket.server.PathParam diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/ControlUnitsController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/ControlUnitsController.kt index 986ecf628..642b4b753 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/ControlUnitsController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/ControlUnitsController.kt @@ -1,7 +1,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.bff import fr.gouv.cacem.monitorenv.domain.use_cases.controlResources.GetControlUnits -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.ControlUnitDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.ControlUnitDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import org.springframework.web.bind.annotation.GetMapping diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/HealthcheckController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/HealthcheckController.kt index a844eaa63..5a8aba9d4 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/HealthcheckController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/HealthcheckController.kt @@ -1,7 +1,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.bff import fr.gouv.cacem.monitorenv.domain.use_cases.healthcheck.GetHealthcheck -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.HealthDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.HealthDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import org.springframework.web.bind.annotation.GetMapping diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsController.kt index 7c855e11f..888fcff69 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsController.kt @@ -5,8 +5,8 @@ import fr.gouv.cacem.monitorenv.domain.use_cases.missions.CreateOrUpdateMission import fr.gouv.cacem.monitorenv.domain.use_cases.missions.DeleteMission import fr.gouv.cacem.monitorenv.domain.use_cases.missions.GetMissionById import fr.gouv.cacem.monitorenv.domain.use_cases.missions.GetMonitorEnvMissions -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.inputs.CreateOrUpdateMissionDataInput -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.MissionDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.inputs.CreateOrUpdateMissionDataInput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.MissionDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.tags.Tag diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/NatinfsController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/NatinfsController.kt index d004ee6c9..86f8b0d92 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/NatinfsController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/NatinfsController.kt @@ -1,7 +1,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.bff import fr.gouv.cacem.monitorenv.domain.use_cases.natinfs.GetNatinfs -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.NatinfDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.NatinfDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import org.springframework.web.bind.annotation.GetMapping diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/RegulatoryAreasController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/RegulatoryAreasController.kt index b96cf8d38..a735570f2 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/RegulatoryAreasController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/RegulatoryAreasController.kt @@ -2,7 +2,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.bff import fr.gouv.cacem.monitorenv.domain.use_cases.regulatoryAreas.GetRegulatoryAreaById import fr.gouv.cacem.monitorenv.domain.use_cases.regulatoryAreas.GetRegulatoryAreas -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.RegulatoryAreaDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.RegulatoryAreaDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import jakarta.websocket.server.PathParam diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/SemaphoresController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/SemaphoresController.kt index 02c9e7071..cd4bcb3b6 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/SemaphoresController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/SemaphoresController.kt @@ -2,7 +2,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.bff import fr.gouv.cacem.monitorenv.domain.use_cases.semaphores.GetSemaphoreById import fr.gouv.cacem.monitorenv.domain.use_cases.semaphores.GetSemaphores -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.SemaphoreDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.SemaphoreDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import jakarta.websocket.server.PathParam diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiControlUnitsController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiControlUnitsController.kt index 81478c9b6..e1362cb4d 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiControlUnitsController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiControlUnitsController.kt @@ -1,7 +1,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.publicapi import fr.gouv.cacem.monitorenv.domain.use_cases.controlResources.GetControlUnits -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.ControlUnitDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.ControlUnitDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import org.springframework.web.bind.annotation.GetMapping diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiHealthcheckController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiHealthcheckController.kt index 80ca7e305..c7999528b 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiHealthcheckController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiHealthcheckController.kt @@ -1,7 +1,7 @@ package fr.gouv.cacem.monitorenv.infrastructure.api.endpoints.publicapi import fr.gouv.cacem.monitorenv.domain.use_cases.healthcheck.GetHealthcheck -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.HealthDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.HealthDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag import org.springframework.web.bind.annotation.GetMapping diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiMissionsController.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiMissionsController.kt index 74888ec2c..d9201278f 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiMissionsController.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiMissionsController.kt @@ -5,8 +5,8 @@ import fr.gouv.cacem.monitorenv.domain.use_cases.missions.CreateOrUpdateMission import fr.gouv.cacem.monitorenv.domain.use_cases.missions.DeleteMission import fr.gouv.cacem.monitorenv.domain.use_cases.missions.GetMissionById import fr.gouv.cacem.monitorenv.domain.use_cases.missions.GetMissions -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.inputs.CreateOrUpdatePublicMissionDataInput -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.outputs.MissionDataOutput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.publicapi.inputs.CreateOrUpdateMissionDataInput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.publicapi.outputs.MissionDataOutput import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.tags.Tag @@ -79,7 +79,7 @@ class ApiMissionsController( @Operation(summary = "Create a new mission") fun createMissionController( @RequestBody - createMissionDataInput: CreateOrUpdatePublicMissionDataInput, + createMissionDataInput: CreateOrUpdateMissionDataInput, ): MissionDataOutput { val newMission = createMissionDataInput.toMissionEntity() val createdMission = createOrUpdateMission.execute(mission = newMission) @@ -105,7 +105,7 @@ class ApiMissionsController( @PathVariable(name = "missionId") missionId: Int, @RequestBody - updateMissionDataInput: CreateOrUpdatePublicMissionDataInput, + updateMissionDataInput: CreateOrUpdateMissionDataInput, ): MissionDataOutput { if ((updateMissionDataInput.id == null) || (missionId != updateMissionDataInput.id)) { throw java.lang.IllegalArgumentException("missionId doesn't match with request param") diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/model/MissionModel.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/model/MissionModel.kt index 8fbcca754..13ac90991 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/model/MissionModel.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/model/MissionModel.kt @@ -80,6 +80,8 @@ data class MissionModel( val missionSource: MissionSourceEnum, @Column(name = "has_mission_order", nullable = false) var hasMissionOrder: Boolean, + @Column(name = "is_geometry_computed_from_controls", nullable = false) + var isGeometryComputedFromControls: Boolean, @Column(name = "is_under_jdp", nullable = false) var isUnderJdp: Boolean, @OneToMany( @@ -124,6 +126,7 @@ data class MissionModel( missionSource = missionSource, hasMissionOrder = hasMissionOrder, isUnderJdp = isUnderJdp, + isGeometryComputedFromControls = isGeometryComputedFromControls, envActions = envActions!!.map { it.toActionEntity(mapper) }, controlUnits = controlUnits?.map { unit -> val savedUnitResources = controlResources @@ -157,6 +160,7 @@ data class MissionModel( missionSource = mission.missionSource, hasMissionOrder = mission.hasMissionOrder, isUnderJdp = mission.isUnderJdp, + isGeometryComputedFromControls = mission.isGeometryComputedFromControls ) mission.envActions?.map { diff --git a/backend/src/main/resources/db/migration/internal/V0.088__update_missions_table.sql b/backend/src/main/resources/db/migration/internal/V0.088__update_missions_table.sql new file mode 100644 index 000000000..a55e6da94 --- /dev/null +++ b/backend/src/main/resources/db/migration/internal/V0.088__update_missions_table.sql @@ -0,0 +1 @@ +ALTER TABLE public.missions ADD COLUMN is_geometry_computed_from_controls boolean NOT NULL default false; \ No newline at end of file diff --git a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/CreateOrUpdateMissionUTests.kt b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/CreateOrUpdateMissionUTests.kt index 62990766d..3e43a6cfd 100644 --- a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/CreateOrUpdateMissionUTests.kt +++ b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/domain/use_cases/CreateOrUpdateMissionUTests.kt @@ -77,7 +77,8 @@ class CreateOrUpdateMissionUTests { id = UUID.fromString("a6c4bd17-eb45-4504-ab15-7a18ea714a10"), observations = "Quelqu'un aurait vu quelque chose quelque part à un certain moment." ) - ) + ), + isGeometryComputedFromControls = false ) val expectedCreatedMission = missionToCreate.copy( diff --git a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsControllerITests.kt b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsControllerITests.kt index 3688be25c..5ee516252 100644 --- a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsControllerITests.kt +++ b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/bff/MissionsControllerITests.kt @@ -14,7 +14,7 @@ import fr.gouv.cacem.monitorenv.domain.use_cases.missions.CreateOrUpdateMission import fr.gouv.cacem.monitorenv.domain.use_cases.missions.DeleteMission import fr.gouv.cacem.monitorenv.domain.use_cases.missions.GetMissionById import fr.gouv.cacem.monitorenv.domain.use_cases.missions.GetMonitorEnvMissions -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.inputs.CreateOrUpdateMissionDataInput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.inputs.CreateOrUpdateMissionDataInput import org.hamcrest.Matchers.equalTo import org.junit.jupiter.api.Test import org.locationtech.jts.geom.MultiPolygon @@ -79,6 +79,7 @@ class MissionsControllerITests { missionSource = MissionSourceEnum.MONITORENV, hasMissionOrder = false, isUnderJdp = false, + isGeometryComputedFromControls = false ) val newMissionRequest = CreateOrUpdateMissionDataInput( missionTypes = listOf(MissionTypeEnum.LAND), @@ -124,6 +125,7 @@ class MissionsControllerITests { missionSource = MissionSourceEnum.MONITORENV, hasMissionOrder = false, isUnderJdp = false, + isGeometryComputedFromControls = false ) given( this.getMonitorEnvMissions.execute( @@ -158,6 +160,7 @@ class MissionsControllerITests { missionSource = MissionSourceEnum.MONITORENV, hasMissionOrder = false, isUnderJdp = false, + isGeometryComputedFromControls = false ) // we test only if the route is called with the right arg given(getMissionById.execute(requestedId)).willReturn(expectedFirstMission) @@ -183,6 +186,7 @@ class MissionsControllerITests { missionSource = MissionSourceEnum.MONITORENV, hasMissionOrder = false, isUnderJdp = false, + isGeometryComputedFromControls = false ) val envAction = EnvActionControlEntity( id = UUID.fromString("bf9f4062-83d3-4a85-b89b-76c0ded6473d"), diff --git a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiMissionsControllerITests.kt b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiMissionsControllerITests.kt index d542984ea..613efaf36 100644 --- a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiMissionsControllerITests.kt +++ b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/api/endpoints/publicapi/ApiMissionsControllerITests.kt @@ -14,7 +14,7 @@ import fr.gouv.cacem.monitorenv.domain.use_cases.missions.CreateOrUpdateMission import fr.gouv.cacem.monitorenv.domain.use_cases.missions.DeleteMission import fr.gouv.cacem.monitorenv.domain.use_cases.missions.GetMissionById import fr.gouv.cacem.monitorenv.domain.use_cases.missions.GetMissions -import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.inputs.CreateOrUpdatePublicMissionDataInput +import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.publicapi.inputs.CreateOrUpdateMissionDataInput import org.hamcrest.Matchers.equalTo import org.junit.jupiter.api.Test import org.locationtech.jts.geom.MultiPolygon @@ -79,8 +79,9 @@ class ApiMissionsControllerITests { missionSource = MissionSourceEnum.MONITORFISH, hasMissionOrder = true, isUnderJdp = true, + isGeometryComputedFromControls = false ) - val newMissionRequest = CreateOrUpdatePublicMissionDataInput( + val newMissionRequest = CreateOrUpdateMissionDataInput( missionTypes = listOf(MissionTypeEnum.LAND), observationsCnsp = null, facade = "Outre-Mer", @@ -91,6 +92,7 @@ class ApiMissionsControllerITests { isClosed = false, hasMissionOrder = true, isUnderJdp = true, + isGeometryComputedFromControls = false ) val requestBody = objectMapper.writeValueAsString(newMissionRequest) given(this.createOrUpdateMission.execute(mission = any())).willReturn(expectedNewMission) @@ -126,6 +128,7 @@ class ApiMissionsControllerITests { isClosed = false, hasMissionOrder = false, isUnderJdp = false, + isGeometryComputedFromControls = false ) given( this.getMissions.execute( @@ -160,6 +163,7 @@ class ApiMissionsControllerITests { isClosed = false, hasMissionOrder = false, isUnderJdp = false, + isGeometryComputedFromControls = false ) // we test only if the route is called with the right arg given(getMissionById.execute(requestedId)).willReturn(expectedFirstMission) @@ -186,6 +190,7 @@ class ApiMissionsControllerITests { missionSource = MissionSourceEnum.MONITORFISH, hasMissionOrder = true, isUnderJdp = true, + isGeometryComputedFromControls = false ) val envAction = EnvActionControlEntity( id = UUID.fromString("bf9f4062-83d3-4a85-b89b-76c0ded6473d"), @@ -193,7 +198,7 @@ class ApiMissionsControllerITests { vehicleType = VehicleTypeEnum.VESSEL, actionNumberOfControls = 4, ) - val requestBody = CreateOrUpdatePublicMissionDataInput( + val requestBody = CreateOrUpdateMissionDataInput( id = 14, missionTypes = listOf(MissionTypeEnum.SEA), observationsCacem = "updated observations", @@ -204,6 +209,7 @@ class ApiMissionsControllerITests { isClosed = false, hasMissionOrder = true, isUnderJdp = true, + isGeometryComputedFromControls = false ) given(this.createOrUpdateMission.execute(any())).willReturn(expectedUpdatedMission) // When diff --git a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaMissionRepositoryITests.kt b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaMissionRepositoryITests.kt index bf76434c6..c978dfd18 100644 --- a/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaMissionRepositoryITests.kt +++ b/backend/src/test/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/JpaMissionRepositoryITests.kt @@ -82,6 +82,7 @@ class JpaMissionRepositoryITests : AbstractDBTests() { resources = listOf(ControlResourceEntity(id = 8, name = "PAM Jeanne Barret")), ), ), + isGeometryComputedFromControls = false ) // When @@ -135,6 +136,7 @@ class JpaMissionRepositoryITests : AbstractDBTests() { resources = listOf(ControlResourceEntity(id = 8, name = "PAM Jeanne Barret")), ), ), + isGeometryComputedFromControls = false ) jpaMissionRepository.save(newMission) @@ -189,6 +191,7 @@ class JpaMissionRepositoryITests : AbstractDBTests() { resources = listOf(ControlResourceEntity(id = 123456, name = "PAM Jeanne Barret")), ), ), + isGeometryComputedFromControls = false ) // When @@ -214,6 +217,7 @@ class JpaMissionRepositoryITests : AbstractDBTests() { hasMissionOrder = false, isUnderJdp = false, controlUnits = listOf(ControlUnitEntity(id = 123456, name = "PAM Jeanne Barret", administration = "", isArchived = false, resources = listOf())), + isGeometryComputedFromControls = false ) // When @@ -459,6 +463,7 @@ class JpaMissionRepositoryITests : AbstractDBTests() { contact = null, ), ), + isGeometryComputedFromControls = false ) val mission = jpaMissionRepository.findMissionById(10) @@ -532,6 +537,7 @@ class JpaMissionRepositoryITests : AbstractDBTests() { missionSource = MissionSourceEnum.MONITORENV, hasMissionOrder = false, isUnderJdp = false, + isGeometryComputedFromControls = false ) // When jpaMissionRepository.save(expectedUpdatedMission) @@ -568,6 +574,7 @@ class JpaMissionRepositoryITests : AbstractDBTests() { missionSource = MissionSourceEnum.MONITORENV, hasMissionOrder = false, isUnderJdp = false, + isGeometryComputedFromControls = false ) // When jpaMissionRepository.save(expectedUpdatedMission)