-
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.
[Missions] Ajout des autres actions de contrôle en lien avec RapportN…
- Loading branch information
Showing
23 changed files
with
398 additions
and
48 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
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
86 changes: 86 additions & 0 deletions
86
...cem/monitorenv/infrastructure/api/adapters/bff/inputs/CreateOrUpdateEnvActionDataInput.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,86 @@ | ||
package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.inputs | ||
|
||
import fr.gouv.cacem.monitorenv.domain.entities.VehicleTypeEnum | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.ActionTargetTypeEnum | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.ActionTypeEnum | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.EnvActionControlEntity | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.EnvActionEntity | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.EnvActionNoteEntity | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.EnvActionSurveillanceEntity | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.InfractionEntity | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.ThemeEntity | ||
import org.locationtech.jts.geom.Geometry | ||
import java.time.ZonedDateTime | ||
import java.util.UUID | ||
|
||
data class CreateOrUpdateEnvActionDataInput( | ||
val id: UUID, | ||
val actionType: ActionTypeEnum, | ||
val actionStartDateTimeUtc: ZonedDateTime? = null, | ||
val actionEndDateTimeUtc: ZonedDateTime? = null, | ||
val department: String? = null, | ||
val facade: String? = null, | ||
val geom: Geometry? = null, | ||
val observations: String? = null, | ||
val isAdministrativeControl: Boolean? = false, | ||
val isComplianceWithWaterRegulationsControl: Boolean? = false, | ||
val isSafetyEquipmentAndStandardsComplianceControl: Boolean? = false, | ||
val isSeafarersControl: Boolean? = false, | ||
val themes: List<ThemeEntity>? = listOf(), | ||
val actionNumberOfControls: Int? = null, | ||
val actionTargetType: ActionTargetTypeEnum? = null, | ||
val vehicleType: VehicleTypeEnum? = null, | ||
val infractions: List<InfractionEntity>? = listOf(), | ||
val coverMissionZone: Boolean? = null, | ||
) { | ||
fun toEnvActionEntity(): EnvActionEntity { | ||
if (this.actionType == null) throw IllegalArgumentException("actionType is required") | ||
|
||
when (actionType) { | ||
ActionTypeEnum.CONTROL -> { | ||
return EnvActionControlEntity( | ||
id = id, | ||
actionStartDateTimeUtc = actionStartDateTimeUtc, | ||
actionEndDateTimeUtc = actionEndDateTimeUtc, | ||
department = department, | ||
facade = facade, | ||
geom = geom, | ||
isAdministrativeControl = isAdministrativeControl ?: false, | ||
isComplianceWithWaterRegulationsControl = isComplianceWithWaterRegulationsControl ?: false, | ||
isSafetyEquipmentAndStandardsComplianceControl = isSafetyEquipmentAndStandardsComplianceControl ?: false, | ||
isSeafarersControl = isSeafarersControl ?: false, | ||
themes = themes, | ||
observations = observations, | ||
actionNumberOfControls = actionNumberOfControls, | ||
actionTargetType = actionTargetType, | ||
vehicleType = vehicleType, | ||
infractions = infractions, | ||
) | ||
} | ||
ActionTypeEnum.SURVEILLANCE -> { | ||
return EnvActionSurveillanceEntity( | ||
id = id, | ||
actionStartDateTimeUtc = actionStartDateTimeUtc, | ||
actionEndDateTimeUtc = actionEndDateTimeUtc, | ||
department = department, | ||
facade = facade, | ||
geom = geom, | ||
themes = themes, | ||
observations = observations, | ||
coverMissionZone = coverMissionZone, | ||
) | ||
} | ||
ActionTypeEnum.NOTE -> { | ||
return EnvActionNoteEntity( | ||
id = id, | ||
actionStartDateTimeUtc = actionStartDateTimeUtc, | ||
actionEndDateTimeUtc = actionEndDateTimeUtc, | ||
observations = observations, | ||
) | ||
} | ||
else -> { | ||
throw IllegalArgumentException("actionType $actionType is not valid") | ||
} | ||
} | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
...d/src/main/resources/db/migration/internal/V0.099__add_other_control_types_rapportnav.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,5 @@ | ||
ALTER TABLE env_actions | ||
ADD COLUMN is_administrative_control boolean, | ||
ADD COLUMN is_compliance_with_water_regulations_control boolean, | ||
ADD COLUMN is_safety_equipment_and_standards_compliance_control boolean, | ||
ADD COLUMN is_seafarers_control boolean; |
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
Oops, something went wrong.