-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add isGeometryComputedFromControls property to mission model
- Loading branch information
1 parent
858e7ee
commit b204dec
Showing
11 changed files
with
94 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...n/fr/gouv/cacem/monitorenv/infrastructure/api/adapters/outputs/PublicMissionDataOutput.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.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 PublicMissionDataOutput( | ||
val id: Int, | ||
val missionTypes: List<MissionTypeEnum>, | ||
val controlUnits: List<ControlUnitEntity>? = 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<EnvActionEntity>? = null, | ||
val missionSource: MissionSourceEnum, | ||
val isClosed: Boolean, | ||
val hasMissionOrder: Boolean, | ||
val isUnderJdp: Boolean, | ||
val isGeometryComputedFromControls: Boolean | ||
) { | ||
companion object { | ||
fun fromMission(mission: MissionEntity): PublicMissionDataOutput { | ||
requireNotNull(mission.id) { | ||
"a mission must have an id" | ||
} | ||
|
||
return PublicMissionDataOutput( | ||
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 | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
backend/src/main/resources/db/migration/internal/V0.088__update_missions_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE public.missions ADD COLUMN is_geometry_computed_from_controls boolean NOT NULL default false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters