Skip to content

Commit

Permalink
[Signalements] Rattachement des actions de contrôle au signalement (#916
Browse files Browse the repository at this point in the history
)

## Related Pull Requests & Issues

- Resolve #799
  • Loading branch information
claire2212 authored Oct 26, 2023
2 parents ad8916f + 7c997cb commit b2d1126
Show file tree
Hide file tree
Showing 75 changed files with 3,245 additions and 1,638 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission

import fr.gouv.cacem.monitorenv.domain.entities.controlUnit.LegacyControlUnitEntity
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.EnvActionEntity
import org.locationtech.jts.geom.MultiPolygon
import java.time.ZonedDateTime

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction

enum class ActionTypeEnum {
SURVEILLANCE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction

import com.fasterxml.jackson.annotation.JsonSubTypes
import com.fasterxml.jackson.annotation.JsonTypeInfo
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl.EnvActionControlEntity
import org.locationtech.jts.geom.Geometry
import java.time.ZonedDateTime
import java.util.*
import java.util.UUID

@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction

import java.time.ZonedDateTime
import java.util.UUID
Expand All @@ -8,7 +8,8 @@ data class EnvActionNoteEntity(
override val actionStartDateTimeUtc: ZonedDateTime? = null,
override val actionEndDateTimeUtc: ZonedDateTime? = null,
val observations: String? = null,
) : EnvActionEntity(
actionType = ActionTypeEnum.NOTE,
id = id,
)
) :
EnvActionEntity(
actionType = ActionTypeEnum.NOTE,
id = id,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction

import java.time.ZonedDateTime
import java.util.*

data class EnvActionNoteProperties(
val observations: String? = null,
) {
fun toEnvActionNoteEntity(
id: UUID,
actionStartDateTimeUtc: ZonedDateTime?,
actionEndDateTimeUtc: ZonedDateTime?,
) =
EnvActionNoteEntity(
id = id,
actionStartDateTimeUtc = actionStartDateTimeUtc,
actionEndDateTimeUtc = actionEndDateTimeUtc,
observations = observations,
)
companion object {
fun fromEnvActionNoteEntity(envAction: EnvActionNoteEntity) =
EnvActionNoteProperties(
envAction.observations,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction

import org.locationtech.jts.geom.Geometry
import java.time.ZonedDateTime
Expand All @@ -14,7 +14,8 @@ data class EnvActionSurveillanceEntity(
val themes: List<ThemeEntity>? = listOf(),
val observations: String? = null,
val coverMissionZone: Boolean? = null,
) : EnvActionEntity(
actionType = ActionTypeEnum.SURVEILLANCE,
id = id,
)
) :
EnvActionEntity(
actionType = ActionTypeEnum.SURVEILLANCE,
id = id,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction

import org.locationtech.jts.geom.Geometry
import java.time.ZonedDateTime
import java.util.*

data class EnvActionSurveillanceProperties(
val themes: List<ThemeEntity>? = listOf(),
val observations: String? = null,
val coverMissionZone: Boolean? = null,
) {
fun toEnvActionSurveillanceEntity(
id: UUID,
actionStartDateTimeUtc: ZonedDateTime?,
actionEndDateTimeUtc: ZonedDateTime?,
facade: String?,
department: String?,
geom: Geometry?,
) =
EnvActionSurveillanceEntity(
id = id,
actionStartDateTimeUtc = actionStartDateTimeUtc,
actionEndDateTimeUtc = actionEndDateTimeUtc,
facade = facade,
department = department,
geom = geom,
themes = themes,
observations = observations,
coverMissionZone = coverMissionZone,
)
companion object {
fun fromEnvActionSurveillanceEntity(envAction: EnvActionSurveillanceEntity) =
EnvActionSurveillanceProperties(
themes = envAction.themes,
observations = envAction.observations,
coverMissionZone = envAction.coverMissionZone,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction

data class ThemeEntity(
val theme: String? = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl

enum class ActionTargetTypeEnum {
VEHICLE,
COMPANY,
INDIVIDUAL,
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl

import fr.gouv.cacem.monitorenv.domain.entities.VehicleTypeEnum
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.ActionTypeEnum
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.EnvActionEntity
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.ThemeEntity
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl.infraction.InfractionEntity
import org.locationtech.jts.geom.Geometry
import java.time.ZonedDateTime
import java.util.*
import java.util.UUID

data class EnvActionControlEntity(
override val id: UUID,
Expand All @@ -22,7 +26,8 @@ data class EnvActionControlEntity(
val actionTargetType: ActionTargetTypeEnum? = null,
val vehicleType: VehicleTypeEnum? = null,
val infractions: List<InfractionEntity>? = listOf(),
) : EnvActionEntity(
id = id,
actionType = ActionTypeEnum.CONTROL,
)
) :
EnvActionEntity(
id = id,
actionType = ActionTypeEnum.CONTROL,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl

import fr.gouv.cacem.monitorenv.domain.entities.VehicleTypeEnum
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.ThemeEntity
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl.infraction.InfractionEntity
import org.locationtech.jts.geom.Geometry
import java.time.ZonedDateTime
import java.util.UUID

data class EnvActionControlProperties(
val themes: List<ThemeEntity>? = listOf(),
val observations: String? = null,
val actionNumberOfControls: Int? = null,
val actionTargetType: ActionTargetTypeEnum? = null,
val vehicleType: VehicleTypeEnum? = null,
val infractions: List<InfractionEntity>? = listOf(),
) {
fun toEnvActionControlEntity(
id: UUID,
actionStartDateTimeUtc: ZonedDateTime?,
actionEndDateTimeUtc: ZonedDateTime?,
facade: String?,
department: String?,
geom: Geometry?,
isAdministrativeControl: Boolean?,
isComplianceWithWaterRegulationsControl: Boolean?,
isSafetyEquipmentAndStandardsComplianceControl: Boolean?,
isSeafarersControl: Boolean?,
) =
EnvActionControlEntity(
id = id,
actionStartDateTimeUtc = actionStartDateTimeUtc,
actionEndDateTimeUtc = actionEndDateTimeUtc,
facade = facade,
department = department,
geom = geom,
themes = themes,
observations = observations,
actionNumberOfControls = actionNumberOfControls,
actionTargetType = actionTargetType,
vehicleType = vehicleType,
infractions = infractions,
isAdministrativeControl = isAdministrativeControl,
isComplianceWithWaterRegulationsControl =
isComplianceWithWaterRegulationsControl,
isSafetyEquipmentAndStandardsComplianceControl =
isSafetyEquipmentAndStandardsComplianceControl,
isSeafarersControl = isSeafarersControl,
)

companion object {
fun fromEnvActionControlEntity(envAction: EnvActionControlEntity) =
EnvActionControlProperties(
themes = envAction.themes,
observations = envAction.observations,
actionNumberOfControls = envAction.actionNumberOfControls,
actionTargetType = envAction.actionTargetType,
vehicleType = envAction.vehicleType,
infractions = envAction.infractions,
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl.infraction

enum class FormalNoticeEnum {
YES,
NO,
PENDING,
}
Loading

0 comments on commit b2d1126

Please sign in to comment.