-
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.
- Loading branch information
1 parent
2153184
commit c9ee998
Showing
11 changed files
with
401 additions
and
115 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
44 changes: 43 additions & 1 deletion
44
...monitorenv/infrastructure/api/adapters/bff/outputs/missions/MissionEnvActionDataOutput.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 |
---|---|---|
@@ -1,3 +1,45 @@ | ||
package fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.missions | ||
|
||
data class MissionEnvActionDataOutput() | ||
import com.fasterxml.jackson.annotation.JsonSubTypes | ||
import com.fasterxml.jackson.annotation.JsonTypeInfo | ||
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.EnvActionNoteEntity | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.EnvActionSurveillanceEntity | ||
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl.EnvActionControlEntity | ||
import org.locationtech.jts.geom.Geometry | ||
import java.time.ZonedDateTime | ||
import java.util.UUID | ||
|
||
@JsonTypeInfo( | ||
use = JsonTypeInfo.Id.NAME, | ||
include = JsonTypeInfo.As.PROPERTY, | ||
property = "actionType", | ||
visible = true, | ||
) | ||
@JsonSubTypes( | ||
JsonSubTypes.Type(EnvActionControlEntity::class, name = "CONTROL"), | ||
JsonSubTypes.Type(EnvActionSurveillanceEntity::class, name = "SURVEILLANCE"), | ||
JsonSubTypes.Type(EnvActionNoteEntity::class, name = "NOTE"), | ||
) | ||
data class MissionEnvActionDataOutput( | ||
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, | ||
) { | ||
companion object { | ||
fun fromEnvActionEntity(envActionEntity: EnvActionEntity) = MissionEnvActionDataOutput( | ||
id = envActionEntity.id, | ||
actionType = envActionEntity.actionType, | ||
actionStartDateTimeUtc = envActionEntity.actionStartDateTimeUtc, | ||
actionEndDateTimeUtc = envActionEntity.actionEndDateTimeUtc, | ||
department = envActionEntity.department, | ||
facade = envActionEntity.facade, | ||
geom = envActionEntity.geom, | ||
) | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
...acem/monitorenv/infrastructure/database/repositories/interfaces/IDBEnvActionRepository.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,7 @@ | ||
package fr.gouv.cacem.monitorenv.infrastructure.database.repositories.interfaces | ||
|
||
import fr.gouv.cacem.monitorenv.infrastructure.database.model.EnvActionModel | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import java.util.UUID | ||
|
||
interface IDBEnvActionRepository : JpaRepository<EnvActionModel, UUID> |
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.