Skip to content

Commit

Permalink
[Mission] Résolution du bug de l'api /missions qui renvoyait les miss…
Browse files Browse the repository at this point in the history
…ions Poseidon (#1334)
  • Loading branch information
claire2212 authored Apr 23, 2024
2 parents e160d0a + 7bbfb33 commit ab4d5ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface IMissionRepository {

fun findAllFullMissions(
controlUnitIds: List<Int>? = null,
missionSources: List<MissionSourceEnum>? = null,
missionStatuses: List<String>?,
missionTypes: List<MissionTypeEnum>?,
pageNumber: Int?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package fr.gouv.cacem.monitorenv.domain.use_cases.missions

import fr.gouv.cacem.monitorenv.config.UseCase
import fr.gouv.cacem.monitorenv.domain.entities.mission.MissionSourceEnum
import fr.gouv.cacem.monitorenv.domain.entities.mission.MissionTypeEnum
import fr.gouv.cacem.monitorenv.domain.repositories.IMissionRepository
import fr.gouv.cacem.monitorenv.domain.repositories.IMonitorFishMissionActionsRepository
Expand Down Expand Up @@ -30,6 +31,11 @@ class GetFullMissions(
startedAfter = startedAfterDateTime?.toInstant()
?: ZonedDateTime.now().minusDays(30).toInstant(),
startedBefore = startedBeforeDateTime?.toInstant(),
missionSources =
listOf(
MissionSourceEnum.MONITORENV,
MissionSourceEnum.MONITORFISH,
),
missionTypes = missionTypes,
missionStatuses = missionStatuses,
seaFronts = seaFronts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class JpaMissionRepository(
@Transactional
override fun findAllFullMissions(
controlUnitIds: List<Int>?,
missionSources: List<MissionSourceEnum>?,
missionStatuses: List<String>?,
missionTypes: List<MissionTypeEnum>?,
pageNumber: Int?,
Expand All @@ -59,7 +60,7 @@ class JpaMissionRepository(
missionTypeAIR = MissionTypeEnum.AIR in missionTypes.orEmpty(),
missionTypeLAND = MissionTypeEnum.LAND in missionTypes.orEmpty(),
missionTypeSEA = MissionTypeEnum.SEA in missionTypes.orEmpty(),
missionSources = null,
missionSources = missionSources,
pageable = pageable,
seaFronts = seaFronts,
startedAfter = startedAfter,
Expand Down

0 comments on commit ab4d5ff

Please sign in to comment.