-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMissionFishActionDataInput.kt
48 lines (43 loc) · 2.18 KB
/
MissionFishActionDataInput.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package fr.gouv.dgampa.rapportnav.infrastructure.api.bff.adapters.v2
import fr.gouv.dgampa.rapportnav.domain.entities.mission.fish.fishActions.MissionActionType
import fr.gouv.dgampa.rapportnav.domain.entities.mission.nav.control.ControlAdministrativeEntity
import fr.gouv.dgampa.rapportnav.domain.entities.mission.nav.control.ControlGensDeMerEntity
import fr.gouv.dgampa.rapportnav.domain.entities.mission.nav.control.ControlNavigationEntity
import fr.gouv.dgampa.rapportnav.domain.entities.mission.nav.control.ControlSecurityEntity
import fr.gouv.dgampa.rapportnav.domain.entities.mission.v2.MissionFishActionEntity
import java.time.Instant
class MissionFishActionDataInput(
override val startDateTimeUtc: Instant,
override val endDateTimeUtc: Instant? = null,
override val observations: String? = null,
override val controlSecurity: ControlSecurityEntity? = null,
override val controlGensDeMer: ControlGensDeMerEntity? = null,
override val controlNavigation: ControlNavigationEntity? = null,
override val controlAdministrative: ControlAdministrativeEntity? = null,
) : MissionActionDataInput(
startDateTimeUtc = startDateTimeUtc,
endDateTimeUtc = endDateTimeUtc,
controlSecurity = controlSecurity,
controlGensDeMer = controlGensDeMer,
controlNavigation = controlNavigation,
controlAdministrative = controlAdministrative
){
companion object {
fun toMissionFishActionEntity(input: MissionActionInput): MissionFishActionEntity {
val data = input.fish
val action = MissionFishActionEntity(
id = Integer.parseInt(input.id),
missionId = input.missionId,
fishActionType = MissionActionType.AIR_CONTROL,
observationsByUnit = data?.observations,
actionDatetimeUtc = data?.startDateTimeUtc,
actionEndDatetimeUtc = data?.endDateTimeUtc
)
action.controlSecurity = data?.controlSecurity
action.controlGensDeMer = data?.controlGensDeMer
action.controlNavigation = data?.controlNavigation
action.controlAdministrative = data?.controlAdministrative
return action
}
}
}