-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Paramétrage diffusion préavis – Créer la liste des unités recevant de…
…s préavis (#3794) ## Linked issues - Resolve #3768 - Changements dans `VesselSearch`: - On passe de uncontrolled à controlled value en utilisant useFieldControl() ce qui retire les useEffect du composant (et le remplacent donc par l'unique useEffect interne à useFieldControl()) - Plus d'appels aux slices Redux dans le composant interne - Les navires "cachés" en local (sur la carte pour l'instant) sont maintenant à passer via la prop cachedVesselIdentities - On ne manipule plus que des VesselIdentity à l'intérieur de ce composant, aucun autre type similaire ou dérivé (=> Plus de transformation via getOnlyVesselIdentityProperties) ---- - [x] Tests E2E (Cypress)
- Loading branch information
Showing
161 changed files
with
4,912 additions
and
6,362 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
7 changes: 7 additions & 0 deletions
7
...src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/administration/Administration.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.cnsp.monitorfish.domain.entities.administration | ||
|
||
data class Administration( | ||
val id: Int, | ||
val isArchived: Boolean, | ||
val name: String, | ||
) |
11 changes: 11 additions & 0 deletions
11
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/control_unit/ControlUnit.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,11 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.control_unit | ||
|
||
data class ControlUnit( | ||
val id: Int, | ||
val areaNote: String?, | ||
val administrationId: Int, | ||
val departmentAreaInseeCode: String?, | ||
val isArchived: Boolean, | ||
val name: String, | ||
val termsNote: String?, | ||
) |
11 changes: 11 additions & 0 deletions
11
...c/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/control_unit/ControlUnitContact.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,11 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.control_unit | ||
|
||
data class ControlUnitContact( | ||
val id: Int, | ||
val controlUnitId: Int, | ||
val email: String?, | ||
val isEmailSubscriptionContact: Boolean, | ||
val isSmsSubscriptionContact: Boolean, | ||
val name: String, | ||
val phone: String?, | ||
) |
8 changes: 8 additions & 0 deletions
8
...kotlin/fr/gouv/cnsp/monitorfish/domain/entities/control_unit/ControlUnitDepartmentArea.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,8 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.control_unit | ||
|
||
// TODO Maybe merge `districts` from MonitorFish into MonitorEnv `departmentAreas`? | ||
data class ControlUnitDepartmentArea( | ||
/** `inseeCode` is the ID. */ | ||
val inseeCode: String, | ||
val name: String, | ||
) |
32 changes: 32 additions & 0 deletions
32
...n/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/control_unit/ControlUnitResourceType.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,32 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.control_unit | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
enum class ControlUnitResourceType(val label: String) { | ||
AIRPLANE("Avion"), | ||
BARGE("Barge"), | ||
CAR("Voiture"), | ||
DRONE("Drône"), | ||
EQUESTRIAN("Équestre"), | ||
FAST_BOAT("Vedette"), | ||
FRIGATE("Frégate"), | ||
HELICOPTER("Hélicoptère"), | ||
HYDROGRAPHIC_SHIP("Bâtiment hydrographique"), | ||
KAYAK("Kayak"), | ||
LIGHT_FAST_BOAT("Vedette légère"), | ||
MINE_DIVER("Plongeur démineur"), | ||
MOTORCYCLE("Moto"), | ||
NET_LIFTER("Remonte-filets"), | ||
NO_RESOURCE("Aucun moyen"), | ||
OTHER("Autre"), | ||
PATROL_BOAT("Patrouilleur"), | ||
PEDESTRIAN("Piéton"), | ||
PIROGUE("Pirogue"), | ||
RIGID_HULL("Coque rigide"), | ||
SEA_SCOOTER("Scooter de mer"), | ||
SEMI_RIGID("Semi-rigide"), | ||
SUPPORT_SHIP("Bâtiment de soutien"), | ||
TRAINING_SHIP("Bâtiment-école"), | ||
TUGBOAT("Remorqueur"), | ||
} |
7 changes: 3 additions & 4 deletions
7
...sh/domain/entities/mission/ControlUnit.kt → ...ntities/control_unit/LegacyControlUnit.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
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
...nitorfish/domain/entities/prior_notification/PriorNotificationFleetSegmentSubscription.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.cnsp.monitorfish.domain.entities.prior_notification | ||
|
||
data class PriorNotificationFleetSegmentSubscription( | ||
val controlUnitId: Int, | ||
val segmentCode: String, | ||
val segmentName: String?, | ||
) |
8 changes: 8 additions & 0 deletions
8
.../cnsp/monitorfish/domain/entities/prior_notification/PriorNotificationPortSubscription.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,8 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.prior_notification | ||
|
||
data class PriorNotificationPortSubscription( | ||
val controlUnitId: Int, | ||
val portLocode: String, | ||
val portName: String?, | ||
val hasSubscribedToAllPriorNotifications: Boolean, | ||
) |
11 changes: 11 additions & 0 deletions
11
...nsp/monitorfish/domain/entities/prior_notification/PriorNotificationVesselSubscription.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,11 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.prior_notification | ||
|
||
data class PriorNotificationVesselSubscription( | ||
val controlUnitId: Int, | ||
val vesselId: Int, | ||
val vesselCallSign: String?, | ||
val vesselCfr: String?, | ||
val vesselExternalMarking: String?, | ||
val vesselMmsi: String?, | ||
val vesselName: String?, | ||
) |
7 changes: 7 additions & 0 deletions
7
...itorfish/domain/entities/prior_notification/filters/PriorNotificationSubscribersFilter.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.cnsp.monitorfish.domain.entities.prior_notification.filters | ||
|
||
data class PriorNotificationSubscribersFilter( | ||
val administrationId: Int? = null, | ||
val portLocode: String? = null, | ||
val searchQuery: String? = null, | ||
) |
5 changes: 5 additions & 0 deletions
5
...fish/domain/entities/prior_notification/sorters/PriorNotificationSubscribersSortColumn.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,5 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.prior_notification.sorters | ||
|
||
enum class PriorNotificationSubscribersSortColumn { | ||
CONTROL_UNIT_NAME, | ||
} |
4 changes: 2 additions & 2 deletions
4
...main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/reporting/ReportingAndOccurrences.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,9 +1,9 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.reporting | ||
|
||
import fr.gouv.cnsp.monitorfish.domain.entities.mission.ControlUnit | ||
import fr.gouv.cnsp.monitorfish.domain.entities.control_unit.LegacyControlUnit | ||
|
||
data class ReportingAndOccurrences( | ||
val otherOccurrencesOfSameAlert: List<Reporting>, | ||
val reporting: Reporting, | ||
val controlUnit: ControlUnit?, | ||
val controlUnit: LegacyControlUnit?, | ||
) |
8 changes: 8 additions & 0 deletions
8
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/station/Station.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,8 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.station | ||
|
||
data class Station( | ||
val id: Int, | ||
val latitude: Double, | ||
val longitude: Double, | ||
val name: String, | ||
) |
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
4 changes: 2 additions & 2 deletions
4
...end/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/ControlUnitRepository.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,7 +1,7 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.repositories | ||
|
||
import fr.gouv.cnsp.monitorfish.domain.entities.mission.ControlUnit | ||
import fr.gouv.cnsp.monitorfish.domain.use_cases.control_units.dtos.FullControlUnit | ||
|
||
interface ControlUnitRepository { | ||
fun findAll(): List<ControlUnit> | ||
fun findAll(): List<FullControlUnit> | ||
} |
7 changes: 7 additions & 0 deletions
7
...c/main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/LegacyControlUnitRepository.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.cnsp.monitorfish.domain.repositories | ||
|
||
import fr.gouv.cnsp.monitorfish.domain.entities.control_unit.LegacyControlUnit | ||
|
||
interface LegacyControlUnitRepository { | ||
fun findAll(): List<LegacyControlUnit> | ||
} |
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
20 changes: 20 additions & 0 deletions
20
...lin/fr/gouv/cnsp/monitorfish/domain/repositories/PnoFleetSegmentSubscriptionRepository.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,20 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.repositories | ||
|
||
import fr.gouv.cnsp.monitorfish.domain.entities.prior_notification.PriorNotificationFleetSegmentSubscription | ||
|
||
interface PnoFleetSegmentSubscriptionRepository { | ||
fun deleteByControlUnitId(controlUnitId: Int) | ||
|
||
fun findAll(): List<PriorNotificationFleetSegmentSubscription> | ||
|
||
fun findByControlUnitId(controlUnitId: Int): List<PriorNotificationFleetSegmentSubscription> | ||
|
||
fun has( | ||
portLocode: String, | ||
segmentCodes: List<String>, | ||
): Boolean | ||
|
||
fun saveAll( | ||
priorNotificationFleetSegmentSubscriptions: List<PriorNotificationFleetSegmentSubscription>, | ||
): List<PriorNotificationFleetSegmentSubscription> | ||
} |
12 changes: 12 additions & 0 deletions
12
...main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/PnoPortSubscriptionRepository.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,5 +1,17 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.repositories | ||
|
||
import fr.gouv.cnsp.monitorfish.domain.entities.prior_notification.PriorNotificationPortSubscription | ||
|
||
interface PnoPortSubscriptionRepository { | ||
fun deleteByControlUnitId(controlUnitId: Int) | ||
|
||
fun findAll(): List<PriorNotificationPortSubscription> | ||
|
||
fun findByControlUnitId(controlUnitId: Int): List<PriorNotificationPortSubscription> | ||
|
||
fun has(portLocode: String): Boolean | ||
|
||
fun saveAll( | ||
priorNotificationPortSubscriptions: List<PriorNotificationPortSubscription>, | ||
): List<PriorNotificationPortSubscription> | ||
} |
8 changes: 0 additions & 8 deletions
8
...n/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/PnoSegmentSubscriptionRepository.kt
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...in/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/PnoVesselSubscriptionRepository.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,5 +1,17 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.repositories | ||
|
||
import fr.gouv.cnsp.monitorfish.domain.entities.prior_notification.PriorNotificationVesselSubscription | ||
|
||
interface PnoVesselSubscriptionRepository { | ||
fun deleteByControlUnitId(controlUnitId: Int) | ||
|
||
fun findAll(): List<PriorNotificationVesselSubscription> | ||
|
||
fun findByControlUnitId(controlUnitId: Int): List<PriorNotificationVesselSubscription> | ||
|
||
fun has(vesselId: Int): Boolean | ||
|
||
fun saveAll( | ||
priorNotificationVesselSubscriptions: List<PriorNotificationVesselSubscription>, | ||
): List<PriorNotificationVesselSubscription> | ||
} |
8 changes: 2 additions & 6 deletions
8
...main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/control_units/GetAllControlUnits.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,18 +1,14 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.use_cases.control_units | ||
|
||
import fr.gouv.cnsp.monitorfish.config.UseCase | ||
import fr.gouv.cnsp.monitorfish.domain.entities.mission.ControlUnit | ||
import fr.gouv.cnsp.monitorfish.domain.repositories.ControlUnitRepository | ||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
import fr.gouv.cnsp.monitorfish.domain.use_cases.control_units.dtos.FullControlUnit | ||
|
||
@UseCase | ||
class GetAllControlUnits( | ||
private val controlUnitsRepository: ControlUnitRepository, | ||
) { | ||
private val logger: Logger = LoggerFactory.getLogger(GetAllControlUnits::class.java) | ||
|
||
fun execute(): List<ControlUnit> { | ||
fun execute(): List<FullControlUnit> { | ||
return controlUnitsRepository.findAll() | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...otlin/fr/gouv/cnsp/monitorfish/domain/use_cases/control_units/GetAllLegacyControlUnits.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,14 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.use_cases.control_units | ||
|
||
import fr.gouv.cnsp.monitorfish.config.UseCase | ||
import fr.gouv.cnsp.monitorfish.domain.entities.control_unit.LegacyControlUnit | ||
import fr.gouv.cnsp.monitorfish.domain.repositories.LegacyControlUnitRepository | ||
|
||
@UseCase | ||
class GetAllLegacyControlUnits( | ||
private val legacyControlUnitsRepository: LegacyControlUnitRepository, | ||
) { | ||
fun execute(): List<LegacyControlUnit> { | ||
return legacyControlUnitsRepository.findAll() | ||
} | ||
} |
Oops, something went wrong.