Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Missions] Récupérer les dates d'actions des deux centres pour le calcul des zones de mission #3041

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

louptheron
Copy link
Collaborator

@louptheron louptheron commented Mar 26, 2024

Linked issues


  • Tests E2E (Cypress)

Summary by CodeRabbit

  • New Features
    • Introduced environmental mission actions in the system, allowing for more detailed tracking and management of environmental missions.
  • Enhancements
    • Updated the mission form to better handle mission data, including improvements to location picking based on environmental action data.
  • Bug Fixes
    • Fixed endpoint path in tests to ensure proper handling of mission data requests.
  • Refactor
    • Updated import paths and references across backend and frontend to align with new package structures, enhancing code maintainability.
  • Tests
    • Adjusted tests to reflect changes in endpoint paths and data structure adjustments.

Copy link
Contributor

coderabbitai bot commented Mar 26, 2024

Walkthrough

The changes revolve around enhancing the system's ability to calculate mission zones more accurately by incorporating environmental mission actions and updating the infrastructure to better manage and utilize mission-related data. This involves adjustments across backend entities and frontend components to ensure that the most recent action dates, whether from fishing or environmental missions, are considered in the automatic calculation of mission zones.

Changes

File Path Change Summary
.../domain/entities/mission/env_mission_action/EnvMissionAction.kt Introduced EnvMissionAction data class.
.../use_cases/infraction/GetAllInfractions.kt
.../database/entities/MissionActionEntity.kt
Updated import statements and types to reflect new package structure. Adjusted methods to accommodate changes.
.../api/bff/PublicMissionActionsControllerITests.kt Updated import paths and references for mission action entities.
.../e2e/side_window/mission_form/main_form.spec.ts Updated endpoint path for GET requests in tests.
.../MissionForm/ActionList/index.tsx
.../MissionForm/MainForm/FormikLocationPicker.tsx
.../MissionForm/formikUsecases.ts
Updated import statements and functionality to align with new data structures and requirements. Added conditional checks and logic for updating mission locations.
.../Mission/envMissionAction.types.ts Made actionStartDateTimeUtc optional and adjusted types for timeline actions.

Assessment against linked issues

Objective Addressed Explanation
Synchro missions – Retrieve action dates from both centers for mission zone calculation (#3024)

Poem

In the digital sea where data waves flow,
A rabbit hopped, with code in tow.
🐾 Across the backend fields, through the frontend gates,
It tweaked and tuned, fixing fates.
🌟 "Let's sync the dates, both fish and env,"
It whispered softly, its resolve firm.
Now missions align, in harmony they dance,
Thanks to the rabbit, who gave them a chance. 🌿

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 4c957b8 and bc89757.
Files selected for processing (102)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/alerts/PendingAlert.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/Mission.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/MissionAndActions.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/EnvMissionAction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/MissionActionType.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/ControlCheck.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/ControlOrigin.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/Controller.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/ControlsSummary.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/FleetSegment.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/FlightGoal.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/GearControl.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/GearInfraction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/Infraction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/InfractionCategory.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/InfractionType.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/LogbookInfraction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/MissionAction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/MissionActionType.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/OtherInfraction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/SpeciesControl.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/SpeciesInfraction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/actrep/ActivityCode.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/actrep/JointDeploymentPlan.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/actrep/species.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/reporting/Reporting.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/InfractionRepository.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/MissionActionsRepository.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/MissionRepository.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/infraction/GetAllInfractions.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetAllMissions.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetMission.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/AddMissionAction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/DeleteMissionAction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetActivityReports.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetMissionAction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetMissionActionFacade.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetMissionActions.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetVesselControls.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/UpdateMissionAction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/dtos/ActivityReport.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/dtos/ActivityReports.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/ControllersExceptionHandler.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionActionsController.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionController.kt (3 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/input/AddMissionActionDataInput.kt (4 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/ActivityReportDataOutput.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/ActivityReportsDataOutput.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/ControlsSummaryDataOutput.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/FullMissionWithActionsDataOutput.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/GearControlDataOutput.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/InfractionDataOutput.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/MissionActionDataOutput.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/PublicMissionActionsController.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/InfractionEntity.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/MissionActionEntity.kt (5 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaInfractionRepository.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaMissionActionsRepository.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/interfaces/DBMissionActionsRepository.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/APIMissionRepository.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/input/EnvMissionActionDataResponse.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/input/MissionDataResponse.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/MissionActionUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/actrep/JointDeploymentPlanUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/GetPendingAlertsUTests.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/GetVesselReportingsUTests.kt (3 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetAllMissionsUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetMissionUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/TestUtils.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/AddMissionActionUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/DeleteMissionActionUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetActivityReportsUTests.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetMissionActionFacadeUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetVesselControlsUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/UpdateMissionActionUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionsControllerITests.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PublicMissionActionsControllerITests.kt (7 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/VesselControllerITests.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/InfractionControllerITests.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/PublicMissionActionsControllerITests.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaInfractionRepositoryITests.kt (3 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaMissionActionRepositoryITests.kt (8 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/TestUtils.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/APIMissionRepositoryITest.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/TestUtils.kt (2 hunks)
  • frontend/cypress/e2e/side_window/mission_form/main_form.spec.ts (3 hunks)
  • frontend/src/domain/entities/mission/index.ts (2 hunks)
  • frontend/src/features/Mission/components/MissionForm/ActionList/index.tsx (1 hunks)
  • frontend/src/features/Mission/components/MissionForm/formikUsecases.ts (3 hunks)
  • frontend/src/features/Mission/components/MissionForm/hooks/useGetMainFormFormikUsecases.ts (3 hunks)
  • frontend/src/features/Mission/components/MissionForm/hooks/useGetMissionActionFormikUsecases.ts (3 hunks)
  • frontend/src/features/Mission/components/MissionForm/utils/getMissionFormInitialValues.ts (1 hunks)
  • frontend/src/features/Mission/components/MissionList/constants.ts (2 hunks)
  • frontend/src/features/Mission/components/MissionList/hooks/useGetFilteredMissionsQuery.ts (4 hunks)
  • frontend/src/features/Mission/components/MissionList/index.tsx (2 hunks)
  • frontend/src/features/Mission/components/MissionList/utils.tsx (2 hunks)
  • frontend/src/features/Mission/mission.types.ts (1 hunks)
  • frontend/src/features/Mission/monitorenvMissionApi.ts (3 hunks)
  • frontend/src/features/Mission/monitorfishMissionApi.ts (3 hunks)
  • frontend/src/features/Mission/useCases/deleteMissionAction.ts (3 hunks)
  • frontend/src/features/Mission/useCases/editMission.ts (2 hunks)
  • frontend/src/features/Mission/useCases/saveMissionAndMissionActionsByDiff.ts (2 hunks)
Files skipped from review due to trivial changes (11)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/ControlOrigin.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/MissionActionType.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/actrep/ActivityCode.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/actrep/JointDeploymentPlan.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetAllMissions.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetMissionActionFacade.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetVesselControls.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/dtos/ActivityReport.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/dtos/ActivityReports.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetAllMissionsUTests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/UpdateMissionActionUTests.kt
Additional comments: 134
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/FleetSegment.kt (1)
  • 1-1: The package declaration has been correctly updated to reflect the new structure. Ensure that all references to FleetSegment throughout the codebase have been updated to match this new package path.
Verification successful

The executed search did not find any references to the old package path for FleetSegment in Kotlin files, suggesting that all references have likely been updated to reflect the new package path. However, it's recommended to manually verify this across the codebase, including in non-Kotlin files or configurations that might not have been covered by the search, to ensure complete consistency.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for old package references that might have been missed.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission_actions.FleetSegment"

Length of output: 88

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/InfractionCategory.kt (1)
  • 1-1: The package declaration has been correctly updated. Ensure that all references to InfractionCategory throughout the codebase have been updated to match this new package path.
Verification successful

The search did not find any references to the old package path for InfractionCategory in Kotlin files, which suggests that the package declaration change has been correctly handled in Kotlin code. However, ensure to check for references in non-Kotlin files or configurations that might not have been covered by this search.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for old package references that might have been missed.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission_actions.InfractionCategory"

Length of output: 94

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/ControlCheck.kt (1)
  • 1-1: The package declaration has been correctly updated. Ensure that all references to ControlCheck throughout the codebase have been updated to match this new package path.
Verification successful

The search for references to the old package path of ControlCheck did not yield any results, indicating that all references have likely been updated to match the new package path. It's advisable to perform a final manual check for any indirect references or configurations that might not have been caught by the search.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for old package references that might have been missed.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission_actions.ControlCheck"

Length of output: 88

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/OtherInfraction.kt (1)
  • 1-1: The package declaration has been correctly updated. Ensure that all references to OtherInfraction throughout the codebase have been updated to match this new package path.
Verification successful

The search for old package references to OtherInfraction did not yield any results, suggesting that the package path update has been correctly propagated throughout the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for old package references that might have been missed.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission_actions.OtherInfraction"

Length of output: 91

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/SpeciesInfraction.kt (1)
  • 1-1: The package declaration has been correctly updated. Ensure that all references to SpeciesInfraction throughout the codebase have been updated to match this new package path.
Verification successful

The search did not find any references to the old package path for SpeciesInfraction in Kotlin files, suggesting that direct references have been updated. It's recommended to manually verify for any indirect references or related updates that might not have been captured by this search.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for old package references that might have been missed.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission_actions.SpeciesInfraction"

Length of output: 93

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/GearInfraction.kt (1)
  • 1-1: The package declaration has been correctly updated. Ensure that all references to GearInfraction throughout the codebase have been updated to match this new package path.
Verification successful

The search for references to GearInfraction under its new package path yielded results, indicating that the class is indeed used across the codebase and that references to it have been updated to reflect the new package path. This confirms that the package declaration change for GearInfraction.kt has been correctly handled, with all necessary updates made to its references throughout the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for old package references that might have been missed.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission_actions.GearInfraction"

Length of output: 90



Script:

#!/bin/bash
# Search for references to GearInfraction under the new package path to verify if it's used and correctly referenced.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission.mission_actions.GearInfraction"

Length of output: 1184

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/InfractionType.kt (1)
  • 1-1: The package declaration has been correctly updated. Ensure that all references to InfractionType throughout the codebase have been updated to match this new package path.
Verification successful

The executed script did not find any references to the old package path of InfractionType, suggesting that there are no lingering references to it in Kotlin files. This is a positive indication that the package path update has been correctly handled. However, ensure that all necessary updates related to the package path change have been made throughout the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for old package references that might have been missed.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission_actions.InfractionType"

Length of output: 90

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/LogbookInfraction.kt (1)
  • 1-1: The package declaration has been correctly updated. Ensure that all references to LogbookInfraction throughout the codebase have been updated to match this new package path.
Verification successful

The search for old package references to LogbookInfraction did not yield any results, indicating that all references throughout the codebase have been successfully updated to match the new package path. This supports the initial approval of the package declaration update.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for old package references that might have been missed.
rg --type kotlin "fr.gouv.cnsp.monitorfish.domain.entities.mission_actions.LogbookInfraction"

Length of output: 93

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/MissionActionType.kt (1)
  • 1-7: The MissionActionType enum is well-defined and follows Kotlin best practices. The naming convention and package structure are appropriate.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/Controller.kt (1)
  • 1-4: The Controller data class is correctly defined. Consider adding KDoc comments to the class and its properties for better clarity and maintainability.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/FlightGoal.kt (1)
  • 1-4: The FlightGoal enum is well-defined and follows Kotlin best practices. The naming convention and package structure are appropriate.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/MissionAndActions.kt (1)
  • 1-3: The update to the import statement and the definition of MissionAndActions are correctly implemented, reflecting the new package structure and domain model requirements.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/Infraction.kt (1)
  • 1-4: The Infraction data class is correctly defined. Consider adding KDoc comments to the class and its properties for better clarity and maintainability.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/InfractionRepository.kt (1)
  • 1-3: The update to the import statement and the definition of InfractionRepository are correctly implemented, reflecting the new package structure and domain model requirements.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/SpeciesControl.kt (1)
  • 1-4: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-5]

The SpeciesControl class is correctly defined. Consider adding KDoc comments to the class and its properties for better clarity and maintainability.

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/EnvMissionAction.kt (1)
  • 1-10: The EnvMissionAction data class is well-defined and follows Kotlin best practices. The use of ZonedDateTime and UUID is appropriate for the domain model. The package structure is correctly aligned with the domain-driven design.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/ControlsSummary.kt (1)
  • 1-1: The package declaration aligns with the intended reorganization. This change should be cross-verified with import statements in other files that use ControlsSummary to ensure they are updated accordingly.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/GearControl.kt (1)
  • 1-1: The package declaration aligns with the intended reorganization. This change should be cross-verified with import statements in other files that use GearControl to ensure they are updated accordingly.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/infraction/GetAllInfractions.kt (2)
  • 4-4: The import statement for Infraction has been correctly updated to reflect its new package structure. This is a good practice to avoid naming conflicts.
  • 9-9: The use of the fully qualified name in the return type of the execute() function is a good practice to ensure clarity, especially in cases where there might be naming conflicts.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/ActivityReportsDataOutput.kt (1)
  • 3-3: The import statement for ActivityReports has been correctly updated to reflect its new package structure. This ensures that the code remains maintainable and easy to navigate.
frontend/src/features/Mission/components/MissionForm/utils/getMissionFormInitialValues.ts (2)
  • 1-1: The import statement has been correctly updated to use Mission instead of MissionWithActions. This change aligns with the PR objectives and should be cross-verified with other parts of the frontend to ensure consistency.
  • 7-7: The function signature of getMissionDraftFromMissionWithActions has been adjusted to reflect the updated import. Ensure that all calls to this function across the frontend are updated accordingly to avoid runtime errors.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/MissionActionsRepository.kt (1)
  • 3-3: The import statement for MissionAction has been correctly updated to reflect its new package structure. This ensures that the code remains maintainable and easy to navigate.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/InfractionDataOutput.kt (1)
  • 3-3: The import statement for Infraction has been correctly updated to reflect its new package structure. This ensures that the code remains maintainable and easy to navigate.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetMissionAction.kt (2)
  • 1-1: The package declaration aligns with the intended reorganization. This change should be cross-verified with import statements in other files that use GetMissionAction to ensure they are updated accordingly.
  • 4-4: The import statement for MissionAction has been correctly updated to reflect its new package structure. This ensures that the code remains maintainable and easy to navigate.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/DeleteMissionAction.kt (1)
  • 1-1: The package declaration change aligns with the PR objectives of reorganizing the package structure for better modularity.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/GearControlDataOutput.kt (1)
  • 3-3: The update to the import path for GearControl aligns with the PR objectives and the reorganization of the package structure.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetMissionActions.kt (1)
  • 1-1: The package declaration change aligns with the PR objectives of reorganizing the package structure for better modularity.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/AddMissionAction.kt (1)
  • 1-1: The package declaration change aligns with the PR objectives of reorganizing the package structure for better modularity.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/alerts/PendingAlert.kt (1)
  • 5-5: The update to the import path for Infraction aligns with the PR objectives and the reorganization of the package structure.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/ControlsSummaryDataOutput.kt (1)
  • 3-3: The update to the import path for ControlsSummary aligns with the PR objectives and the reorganization of the package structure.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/repositories/MissionRepository.kt (1)
  • 26-27: The addition of the findById method to the MissionRepository interface aligns with the PR objectives of enhancing repository functionalities and improving data retrieval.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/interfaces/DBMissionActionsRepository.kt (1)
  • 3-3: The update to the import path for MissionActionType aligns with the PR objectives and the reorganization of the package structure.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/reporting/Reporting.kt (1)
  • 4-4: The import statement for Infraction has been updated to reflect its new package location. This is a good practice for maintaining a clean and organized codebase.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/ActivityReportDataOutput.kt (1)
  • 4-5: The import paths for ActivityCode and ActivityReport have been updated to reflect changes in the package structure. This aligns with the reorganization of the codebase for better modularity.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/UpdateMissionAction.kt (1)
  • 4-4: The import statement for MissionAction has been updated to reflect its new location under the mission subpackage. This change is part of the broader reorganization effort to improve code modularity and readability.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/InfractionEntity.kt (1)
  • 3-4: The import paths for Infraction and InfractionCategory have been updated to reflect their new package structure. This is part of the reorganization to improve code modularity.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/Mission.kt (2)
  • 3-3: The import for EnvMissionAction has been added to support the new envActions field. This aligns with the PR's objective to enhance mission zone calculations.
  • 19-21: New fields createdAtUtc, updatedAtUtc, and envActions have been introduced. These additions are crucial for supporting enhanced mission zone calculations by incorporating action dates. Ensure that these fields are properly handled in all relevant parts of the application.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/PublicMissionActionsController.kt (1)
  • 3-3: The import statement for GetMissionActions has been updated to reflect its new package structure. This is a necessary change to maintain consistency with the reorganization of the codebase.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetMission.kt (2)
  • 3-7: The import statements have been updated to reflect the new package structure and to include necessary entities and use cases. This is part of the effort to enhance the modularity of the codebase.
  • 11-30: The GetMission use case has been implemented to fetch missions and their actions. This aligns with the PR's objective to enhance mission zone calculations. Ensure that error handling and data consistency are adequately addressed throughout the use case.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaInfractionRepository.kt (2)
  • 3-3: The import path for Infraction has been updated to reflect its new location under mission.mission_actions. This change is part of the broader reorganization effort to improve code modularity.
  • 14-14: The methods findAll and findInfractionByNatinfCode correctly use the updated Infraction entity path. This ensures that the repository aligns with the new package structure. Ensure that all references to these methods are updated accordingly.

Also applies to: 21-21

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/input/EnvMissionActionDataResponse.kt (2)
  • 21-25: Consider adding error handling for the date parsing in toEnvMissionAction method. If actionStartDateTimeUtc is not in a valid format, this could lead to runtime exceptions. It might be beneficial to catch parsing errors and handle them gracefully, possibly logging the error or throwing a custom exception that provides more context.
  • 28-37: The implementation of UUIDSerializer is correct and follows the standard practices for custom serializers in kotlinx.serialization. Good job on ensuring UUIDs are properly handled during serialization and deserialization.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/DeleteMissionActionUTests.kt (1)
  • 1-8: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [11-30]

The test method execute Should delete an action is well-structured. However, it would be beneficial to also verify that the save method of missionActionsRepository is called with the correct parameters, ensuring that the action is indeed marked as deleted before being saved. This can be done by checking the properties of the MissionAction object captured by the argumentCaptor.

backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/TestUtils.kt (2)
  • 11-25: The getDummyMissions method uses ZonedDateTime.now() for the startDateTimeUtc field, which introduces non-determinism in tests. Consider using a fixed date/time or allowing it to be passed as a parameter to ensure test consistency.
  • 1-29: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [26-42]

The getDummyMissionActions method introduces non-determinism by using random IDs and ZonedDateTime.now(). Consider using fixed values or allowing them to be passed as parameters. Additionally, simplifying the method could improve readability and maintainability.

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/input/MissionDataResponse.kt (1)
  • 52-60: The toFullMission method lacks error handling for date parsing in createdAtUtc and updatedAtUtc. Consider adding try-catch blocks around ZonedDateTime.parse to handle potential parsing errors gracefully. Additionally, ensure that envActions is not null before attempting to map it to domain entities.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaInfractionRepositoryITests.kt (1)
  • 3-3: The update to the import path for InfractionCategory and the adjustments in the assertions are correct and reflect the reorganization of the domain entities. These changes ensure that the tests remain aligned with the domain model.

Also applies to: 23-25, 53-55

frontend/src/features/Mission/monitorfishMissionApi.ts (1)
  • 37-41: The addition of the getMission query and the implementation of error handling using FrontendApiError are well-executed. Ensure that the integration of this query with the frontend components is thoroughly tested, especially the error handling path.
Verification successful

The integration of the getMission query with frontend components is successfully verified. Its usage across various parts of the Mission feature, including hooks and components, confirms that the query is an integral part of managing mission data within the application. This thorough integration suggests that the error handling and data fetching mechanisms provided by the query are effectively utilized across the frontend.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the integration of getMission query with frontend components
rg --type ts "useGetMissionQuery"

Length of output: 1170

frontend/src/features/Mission/components/MissionList/utils.tsx (1)
  • 24-24: The update to the parameter type in hasSomeOngoingActions to Mission.MissionWithActions is appropriate and improves type safety and clarity. This change ensures consistency with the updated import statement.
frontend/src/features/Mission/components/MissionForm/hooks/useGetMainFormFormikUsecases.ts (1)
  • 53-63: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [18-60]

The integration of useGetMissionQuery with skipToken for conditional data fetching and the update to updateMissionLocation to include envActions data are well-implemented. Ensure that the functionality of updateMissionLocation, especially with the inclusion of envActions, is thoroughly tested in the context of the form's behavior.

Verification successful

Given the critical role of updateMissionLocation across various components and hooks within the Mission feature, it's essential to ensure its robust implementation and thorough testing, especially considering its integration with useGetMissionQuery and the handling of skipToken. To further verify the implementation details and ensure no issues are present, inspecting the updateMissionLocation function directly in formikUsecases.ts is necessary.


The partial context of the updateMissionLocation function in formikUsecases.ts demonstrates a careful approach to parameter validation and early returns when necessary data is not present. This aligns with best practices for ensuring that operations are only performed with complete and valid data. However, the snippet ends before detailing how envActions, ports, and other parameters are utilized to compute and update the mission location. To fully verify the implementation's correctness and robustness, especially in relation to the initial review comment about testing the integration with envActions, additional context is needed.


The extended context for the updateMissionLocation function in formikUsecases.ts provides valuable insights into how environmental actions (envActions) and ports are utilized to determine whether the mission location should be updated. The function checks if there is a more recent environmental action (lastEnvActionDate) compared to the mission action's date (missionAction.actionDatetimeUtc). If an environmental action is newer, it decides not to update the mission location, which is a logical approach to ensure the mission location reflects the most current and relevant data.

Furthermore, the function attempts to compute the next mission geometry by dispatching getLastControlCircleGeometry with ports and the mission action as arguments. This indicates a sophisticated logic to update the mission's geographical data based on the latest control actions and available port data.

Given this detailed examination, the implementation of updateMissionLocation appears to be well-thought-out, with careful consideration given to the use of environmental actions and port data in determining the mission location. This aligns with the initial review comment emphasizing the importance of testing the integration and functionality of updateMissionLocation, especially with the inclusion of envActions.

Based on the provided context and the analysis of the updateMissionLocation function's implementation, it can be concluded that the initial review comment is consistent with the codebase, and the changes made to the useGetMainFormFormikUsecases hook, including the integration of useGetMissionQuery with skipToken and the update to updateMissionLocation to include envActions data, are well-implemented.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the functionality of updateMissionLocation in the form's behavior
rg --type ts "updateMissionLocation"

Length of output: 2273



Script:

#!/bin/bash
# Inspect the implementation of updateMissionLocation in formikUsecases.ts
rg --type ts --context 10 "const updateMissionLocation =" frontend/src/features/Mission/components/MissionForm/formikUsecases.ts

Length of output: 739



Script:

#!/bin/bash
# Request more context around the use of envActions and ports in updateMissionLocation
rg --type ts --context 20 "const updateMissionLocation =" frontend/src/features/Mission/components/MissionForm/formikUsecases.ts

Length of output: 1474

backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/InfractionControllerITests.kt (2)
  • 6-7: The updated import paths align with the new package structure for Infraction and InfractionCategory. This change is consistent with the PR objectives.
  • 36-43: The instantiation of Infraction objects with the updated import paths and parameters is correctly implemented.
frontend/src/features/Mission/useCases/editMission.ts (2)
  • 1-2: The addition of imports for RTK_FORCE_REFETCH_QUERY_OPTIONS and monitorfishMissionApi supports the updated functionality to fetch mission data with forced refetch options.
  • 46-48: The replacement of the mission data fetching method with monitorfishMissionApi.endpoints.getMission.initiate is correctly implemented. Ensure to verify the integration with the frontend and the behavior of the forced refetch option.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/PublicMissionActionsControllerITests.kt (1)
  • 7-9: The updated import paths for MissionAction, MissionActionType, and GetMissionActions correctly reflect the new package structure and align with the PR objectives.
frontend/src/features/Mission/useCases/deleteMissionAction.ts (2)
  • 19-19: The inclusion of getState in the deleteMissionAction thunk signature is correctly implemented and aligns with common Redux patterns for accessing the current state within thunks.
  • 64-72: The introduction of the getEnvActions function to fetch environment actions based on the mission ID is correctly implemented. Ensure to verify the integration with the frontend and the correct fetching and usage of envActions.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/actrep/JointDeploymentPlanUTests.kt (1)
  • 1-1: The updated package declaration correctly reflects the new package structure and aligns with the PR objectives.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/ControllersExceptionHandler.kt (2)
  • 4-4: The consolidation of exception imports makes the code cleaner and more organized.
  • 43-47: The introduction of the handleIllegalArgumentException method to handle multiple exceptions in a generic manner is correctly implemented. Ensure to verify the correct handling of all specified exceptions.
frontend/src/features/Mission/useCases/saveMissionAndMissionActionsByDiff.ts (1)
  • 1-5: The import of RTK_FORCE_REFETCH_QUERY_OPTIONS and the use of monitorfishMissionApi to fetch mission data with forced refetch options are correctly implemented.
frontend/src/features/Mission/monitorenvMissionApi.ts (1)
  • 7-12: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

The removal of the GET_MISSION_ERROR_MESSAGE constant, the getMission query, and the useGetMissionQuery hook aligns with the PR objectives to streamline the API. Ensure to verify the removal of any dependencies on these removed entities.

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/FullMissionWithActionsDataOutput.kt (2)
  • 11-32: The FullMissionWithActionsDataOutput data class is well-defined, covering all necessary fields for representing mission data in an output format. The use of Kotlin's data class features, nullable types, and default values for optional fields is appropriate.
  • 33-56: The companion object's factory method fromMissionAndActions is correctly implemented, providing a clean separation between the domain layer and the API output layer. It ensures that all relevant fields are mapped from the domain object to the DTO.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/GetPendingAlertsUTests.kt (2)
  • 9-10: The updated import paths for Infraction and InfractionCategory are correct, reflecting their new locations within the project structure. This change aligns with the reorganization of the package structure for mission-related entities.
  • 48-51: The modified formatting of the Infraction object initialization improves readability by explicitly setting each property on a separate line. This change makes the test code easier to understand and maintain.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaMissionActionsRepository.kt (2)
  • 4-5: The updated import paths for MissionAction and MissionActionType are correct, reflecting their new locations within the project structure. This change aligns with the reorganization of the package structure for mission-related entities.
  • 21-53: The adjustments to method return types and parameter types, using fully qualified names for MissionAction, are correctly implemented. This ensures clarity and avoids ambiguity, aligning with the reorganization of the package structure for mission-related entities.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/TestUtils.kt (2)
  • 3-3: The updated import path for MissionAction and its related enums and data classes is correct, reflecting their new locations within the project structure. This change aligns with the reorganization of the package structure for mission-related entities.
  • 7-64: The adjustments to the references within the getDummyMissionAction function, using fully qualified names for MissionAction and its related enums and data classes, are correctly implemented. This ensures clarity and avoids ambiguity, aligning with the reorganization of the package structure for mission-related entities.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionController.kt (2)
  • 67-79: The new method getMissionController in the MissionController class is correctly implemented, using the GetMission use case to retrieve a mission by its ID and return a FullMissionWithActionsDataOutput. The use of runBlocking to execute the coroutine-based use case synchronously and the method annotations for REST and OpenAPI documentation are appropriate and follow best practices.
  • 3-11: The added imports for GetMission, FullMissionWithActionsDataOutput, PathParam, and runBlocking in the MissionController class are necessary and correctly used to support the new functionality of the getMissionController method. Each import serves a specific purpose and is appropriately utilized.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/AddMissionActionUTests.kt (1)
  • 8-9: The updated import paths for MissionAction and MissionActionType are correct, reflecting their new locations within the project structure. This change aligns with the reorganization of the package structure for mission-related entities.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetMissionUTests.kt (1)
  • 34-91: The unit tests in GetMissionUTests.kt are well-structured and correctly verify the functionality of the GetMission use case. The tests cover the expected behavior of retrieving a mission with associated actions and handling exceptions when a mission cannot be fetched, following best practices for unit testing.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/GetVesselReportingsUTests.kt (1)
  • 5-6: The updated import paths for Infraction and InfractionCategory are correct, reflecting their new locations within the project structure. This change aligns with the reorganization of the package structure for mission-related entities.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/MissionAction.kt (1)
  • 1-1: The package name change from fr.gouv.cnsp.monitorfish.domain.entities.mission_actions to fr.gouv.cnsp.monitorfish.domain.entities.mission.mission_actions is noted and aligns with the PR's objective for better modularity and organization.
frontend/src/features/Mission/components/MissionForm/hooks/useGetMissionActionFormikUsecases.ts (2)
  • 4-4: The addition of the useGetMissionQuery import from @features/Mission/monitorfishMissionApi is appropriate for fetching mission data, supporting the PR's enhancements to mission zone calculations.
  • 95-99: The modification to include getMissionApiQuery.data?.envActions in the updateMissionLocation function's parameters is a thoughtful addition, ensuring environmental actions are considered when updating mission locations. This aligns well with the PR's objectives.
frontend/src/features/Mission/mission.types.ts (1)
  • 131-133: The modification to have MissionWithActions extend Mission directly, instead of Mission.Mission, simplifies the type hierarchy and aligns with best practices for clarity and consistency in type definitions.
frontend/src/features/Mission/components/MissionList/hooks/useGetFilteredMissionsQuery.ts (1)
  • 1-1: The addition of the Mission import from @features/Mission/mission.types and the updates to type declarations to use Mission.MissionWithActions enhance the clarity and consistency of type usage in the codebase.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/actrep/species.kt (1)
  • 1-1: The package name change to fr.gouv.cnsp.monitorfish.domain.entities.mission.mission_actions.actrep aligns with the PR's objective for better modularity and organization within the codebase.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionsControllerITests.kt (1)
  • 9-10: The updates to import statements for MissionAction and GetAllMissions reflect the new package structure and are necessary for the tests to compile and run correctly. These changes support the PR's objectives.
frontend/src/features/Mission/components/MissionList/constants.ts (1)
  • 42-42: The update to use Mission.MissionWithActions for the type reference within MISSION_LIST_TABLE_OPTIONS enhances consistency and clarity in type usage across the codebase.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetVesselControlsUTests.kt (1)
  • 1-1: The package name change to fr.gouv.cnsp.monitorfish.domain.use_cases.mission.mission_actions aligns with the PR's objective for better modularity and organization within the codebase.
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionActionsController.kt (2)
  • 3-4: The updated import statements correctly reflect the new package structure for mission-related entities and use cases.
  • 1-7: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [3-139]

The controller's implementation and the use of updated import statements appear to be correct and follow best practices for Spring Boot applications.

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetActivityReports.kt (2)
  • 1-13: The updated import statements correctly reflect the new package structure for mission-related entities and use cases.
  • 1-16: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-139]

The implementation of the GetActivityReports use case appears to be correct and follows best practices for domain use cases in Kotlin.

backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/mission_actions/MissionActionUTests.kt (2)
  • 1-1: The updated package declaration correctly reflects the new package structure for mission-related entities.
  • 1-4: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-67]

The unit tests for the MissionAction entity are well-structured and correctly verify the entity's validation logic.

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/APIMissionRepository.kt (3)
  • 127-140: The implementation of the findById method in the APIMissionRepository class is correct and follows best practices for interacting with external services in Kotlin.
  • 7-7: The updated import statement for CouldNotFindException correctly supports the new findById method.
  • 123-141: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-140]

The rest of the APIMissionRepository class is well-implemented and follows best practices for repository classes in Kotlin.

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/input/AddMissionActionDataInput.kt (2)
  • 3-3: The updated import statement correctly reflects the new package structure for mission-related entities.
  • 13-31: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [3-57]

The declarations within the AddMissionActionDataInput data class correctly reference entities under the new package structure and cover a comprehensive set of attributes for mission actions.

backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetMissionActionFacadeUTests.kt (3)
  • 1-1: The updated package declaration correctly reflects the new package structure for mission-related use cases.
  • 7-8: The updated import statements correctly reflect the new package structure for mission-related entities.
  • 1-11: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-92]

The unit tests for the GetMissionActionFacade use case are well-structured and correctly verify the use case's logic for determining the facade for mission actions.

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/outputs/MissionActionDataOutput.kt (2)
  • 4-4: The updated import statement correctly reflects the new package structure for mission-related entities.
  • 1-7: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [4-73]

The declarations within the MissionActionDataOutput data class correctly cover a comprehensive set of attributes for mission actions and include a well-implemented method for converting a MissionAction entity to output data.

frontend/src/features/Mission/components/MissionForm/ActionList/index.tsx (2)
  • 6-6: The updated import statement for useGetMissionQuery correctly reflects the change from monitorenvMissionApi to monitorfishMissionApi, aligning with the project's naming conventions.
  • 3-9: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [6-92]

The implementation of the ActionList component is well-structured and follows React best practices, efficiently handling the display and interaction with mission actions.

frontend/src/domain/entities/mission/index.ts (1)
  • 33-36: The explicit type annotation for the mission parameter in the getMissionFeaturePoint function enhances type safety and clarity. Good practice in TypeScript to ensure the expected parameter type.
frontend/src/features/Mission/components/MissionForm/formikUsecases.ts (2)
  • 4-4: The import of EnvMissionAction supports the new functionality involving environmental actions. Necessary for the updated logic in updateMissionLocation.
  • 153-167: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [147-163]

The enhancements to the updateMissionLocation function, including the addition of the envActions parameter and the logic to compare dates before updating the mission location, significantly improve the functionality. This aligns with the objective to incorporate the most recent action dates from two centers into mission zone calculations.

frontend/src/features/Mission/components/MissionList/index.tsx (2)
  • 20-20: Moving the import statement for Mission to a separate line improves readability and maintainability of the import statements.
  • 38-38: Updating the type reference for MissionWithActions within the useTable function to Mission.MissionWithActions enhances consistency and clarity in type usage.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/APIMissionRepositoryITest.kt (2)
  • 6-6: The import of MissionActionType supports the new test case for the findById function, involving mission action types. Necessary for the test logic.
  • 292-320: The new test case findById Should return a mission effectively verifies the functionality of the findById method in the APIMissionRepository. It ensures that the method correctly retrieves a mission by its ID and asserts various properties of the returned mission, contributing to the robustness of the repository layer tests.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/GetActivityReportsUTests.kt (1)
  • 7-17: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-14]

The changes in the package structure for mission-related entities and actions, as indicated by the updated import statements, contribute to better modularity and clarity of the domain model. This reorganization likely makes the codebase easier to navigate and maintain.

backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/MissionActionEntity.kt (3)
  • 5-5: The import statement has been updated to reflect the new package structure for mission-related entities. This change is consistent with the PR objectives of reorganizing the package structure for better modularity.
  • 51-51: The properties emitsVms, emitsAis, logbookMatchesActivity, licencesMatchActivity, separateStowageOfPreservedSpecies, and vesselTargeted have been updated to use fully qualified class names from the new package structure. This change ensures that the entity class aligns with the updated domain model.

Also applies to: 54-54, 57-57, 60-60, 67-67, 111-111

  • 141-144: The methods fromMissionAction and toMissionAction have been updated to reflect the changes in the domain model and package structure. These methods are crucial for converting between the entity and the domain model, ensuring data consistency across different layers of the application. The changes appear to be correctly implemented, maintaining the integrity of the data transformation process.

Also applies to: 200-273

backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaMissionActionRepositoryITests.kt (3)
  • 3-6: The import statements have been updated to reflect the new package structure for mission-related entities. This change is necessary to ensure that the tests are aligned with the updated domain model.
  • 51-59: Assertions in the test methods have been updated to use fully qualified class names from the new package structure. This ensures that the tests are correctly referencing the updated domain entities and their properties. The changes are consistent with the PR objectives and contribute to maintaining the integrity of the test suite.

Also applies to: 62-64, 69-71, 80-82, 86-88, 94-96, 113-115

  • 210-217: The test method save Should update another mission action When findById is not used to find the existing entity has been updated to use the new domain model for creating a MissionAction instance. This change is necessary for the test to accurately reflect the updated domain entities and their relationships. The modifications appear to be correctly implemented, ensuring the test remains valid and relevant.

Also applies to: 231-233, 244-244, 254-254

backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/TestUtils.kt (1)
  • 5-44: The method getDummyMission has been added to generate a JSON string representing a mission with detailed information, including envActions. This utility method is useful for creating mock data for testing purposes, ensuring that tests can simulate realistic scenarios with environmental actions. The JSON structure appears to be correctly formatted and includes all necessary fields to represent a mission comprehensively.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PublicMissionActionsControllerITests.kt (6)
  • 10-16: The imports have been restructured to reflect the new package structure for mission-related entities. This change is consistent with the PR objectives to enhance mission zone calculations by incorporating the most recent action dates from two centers. Ensure that all references to these entities within the test cases have been updated accordingly to prevent any import-related issues.
  • 74-80: The usage of ControlsSummary and MissionAction from the new package structure in the test case Should get all controls for a vessel is correct and aligns with the PR's objectives. This ensures that the test is using the updated domain entities for mission actions.
  • 114-114: The instantiation of MissionAction within the test case Should get all mission actions for a mission correctly utilizes the updated entity from the new package structure. This change is necessary to reflect the enhancements made to mission zone calculations.
  • 158-176: In the test case Should create a mission action with a bad facade, the creation of LogbookInfraction, FleetSegment, and GearInfraction entities using the new package structure is correctly implemented. This ensures that the test accurately reflects the changes made to the domain entities related to mission actions.
  • 206-206: The use of argumentCaptor for capturing MissionAction in the test case Should create a mission action with a bad facade is appropriate. It verifies that the action created matches the expected properties, including the action date time. This is crucial for ensuring that the logic for handling mission actions remains correct after the changes.
  • 233-257: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [220-254]

The test case Should update a mission action correctly demonstrates the update functionality using the new domain entities. The creation of a GearControl instance and its inclusion in the AddMissionActionDataInput payload is a good practice for testing the update logic comprehensively.

frontend/cypress/e2e/side_window/mission_form/main_form.spec.ts (3)
  • 43-43: The update of the endpoint path in the intercept for GET requests from /api/v1/missions/1 to /bff/v1/missions/1 is correct and aligns with the PR's objectives to enhance the backend infrastructure. This change ensures that the tests are targeting the correct, updated API endpoint.
  • 102-102: The repetition of the endpoint path update in another test case further confirms the consistency of changes across the test suite. This consistency is crucial for ensuring that all relevant tests are aligned with the new API endpoint structure.
  • 175-175: Again, the endpoint path update is correctly applied in a different test scenario. This demonstrates thoroughness in updating the test suite to reflect changes in the API endpoint paths, ensuring that the tests remain valid and effective.
backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/VesselControllerITests.kt (2)
  • 17-18: The import paths for Infraction and InfractionCategory have been updated to reflect the new package structure. This change aligns with the PR objectives related to reorganizing the package structure for better modularity.
  • 552-554: The usage of Infraction and InfractionCategory within the test method for vessel reporting is consistent with their intended purpose. The test correctly constructs an Infraction instance with a natinfCode and an infractionCategory, which aligns with the domain logic for handling infractions in vessel reporting.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between bc89757 and 2b6ca1b.
Files selected for processing (10)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/alerts/PendingAlert.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/reporting/Reporting.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/DeleteMissionAction.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionActionsController.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetMissionUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionsControllerITests.kt (3 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PublicMissionActionsControllerITests.kt (7 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/Utils.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/PublicMissionActionsControllerITests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/TestUtils.kt (2 hunks)
Files skipped from review as they are similar to previous changes (9)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/alerts/PendingAlert.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/reporting/Reporting.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/mission_actions/DeleteMissionAction.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionActionsController.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetMissionUTests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/MissionsControllerITests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PublicMissionActionsControllerITests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/PublicMissionActionsControllerITests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/TestUtils.kt

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2b6ca1b and 727bace.
Files selected for processing (16)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/EnvMissionAction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/EnvMissionActionType.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/input/AddMissionActionDataInput.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/InfractionEntity.kt (2 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/MissionActionEntity.kt (3 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaInfractionRepository.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaMissionActionsRepository.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/input/EnvMissionActionDataResponse.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetMissionUTests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PublicMissionActionsControllerITests.kt (4 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/VesselControllerITests.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/InfractionControllerITests.kt (2 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaInfractionRepositoryITests.kt (3 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaMissionActionRepositoryITests.kt (4 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/TestUtils.kt (1 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/APIMissionRepositoryITest.kt (2 hunks)
Files skipped from review as they are similar to previous changes (15)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/EnvMissionAction.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/input/AddMissionActionDataInput.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/InfractionEntity.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/MissionActionEntity.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaInfractionRepository.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaMissionActionsRepository.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/input/EnvMissionActionDataResponse.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/mission/GetMissionUTests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PublicMissionActionsControllerITests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/VesselControllerITests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/public_api/InfractionControllerITests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaInfractionRepositoryITests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/JpaMissionActionRepositoryITests.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/repositories/TestUtils.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/APIMissionRepositoryITest.kt

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 727bace and 94a6111.
Files selected for processing (3)
  • frontend/cypress/e2e/side_window/mission_form/sea_control_edition.spec.ts (2 hunks)
  • frontend/src/features/Mission/components/MissionForm/MainForm/FormikLocationPicker.tsx (1 hunks)
  • frontend/src/features/Mission/components/MissionForm/formikUsecases.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • frontend/src/features/Mission/components/MissionForm/formikUsecases.ts
Additional comments: 3
frontend/src/features/Mission/components/MissionForm/MainForm/FormikLocationPicker.tsx (1)
  • 120-128: The addition of a conditional check before dispatching a notification event based on the length of geometryComputedFromControls.coordinates is a logical enhancement. It ensures that notifications are only dispatched when there are actual coordinates to report on, which can help in avoiding unnecessary notifications or errors in cases where the geometry is not set or is empty.

However, it's important to ensure that the management and update mechanisms for geometryComputedFromControls are robust and align with the expected behavior throughout the application lifecycle. This includes verifying that coordinates are correctly updated or cleared as needed, to prevent stale or incorrect data from triggering misleading notifications.

Verification successful

The verification process has revealed that geometryComputedFromControls is managed in a structured manner within the application. It is part of the MissionFormState and is manipulated through specific actions for initializing, updating, and resetting this state. This management approach ensures that geometryComputedFromControls is handled appropriately across the application lifecycle, aligning with the concerns raised in the original review comment.

The addition of a conditional check before dispatching a notification event, as observed in FormikLocationPicker.tsx, is logically sound and benefits from the robust state management practices observed. It's crucial that these practices continue to be followed to ensure the application behaves as expected, especially in relation to managing mission geometry data.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that `geometryComputedFromControls` is managed correctly across the application
# This script is a placeholder and should be adapted to the specific verification needs
echo "Ensure that geometryComputedFromControls is updated and cleared appropriately in all relevant parts of the application."

Length of output: 248



Script:

#!/bin/bash
# Search for references to `geometryComputedFromControls` across the application to understand how it's managed and updated
rg "geometryComputedFromControls" --context 5

Length of output: 11990

frontend/cypress/e2e/side_window/mission_form/sea_control_edition.spec.ts (2)
  • 2-2: The addition of the import statement for SeaFrontGroup from src/domain/entities/seaFront/constants is correctly implemented and necessary for the new test case that checks the mission zone update logic under specific conditions.
  • 269-295: The new test case "Should not update the mission zone When a CACEM control is newer" is well-structured and effectively simulates the scenario where a newer CACEM control should not trigger an update to the mission zone. This is crucial for ensuring the application behaves as expected in scenarios where control data might come in asynchronously or out of order.

It's recommended to verify the integration with the backend and ensure that the logic for determining the "newness" of a control and its impact on mission zone updates is correctly implemented and tested across various edge cases.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 94a6111 and ce6cb3a.
Files selected for processing (6)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/EnvMissionAction.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/input/EnvMissionActionDataResponse.kt (1 hunks)
  • frontend/cypress/e2e/side_window/mission_form/main_form.spec.ts (4 hunks)
  • frontend/src/features/Mission/components/MissionForm/ActionList/index.tsx (2 hunks)
  • frontend/src/features/Mission/components/MissionForm/formikUsecases.ts (3 hunks)
  • frontend/src/features/Mission/envMissionAction.types.ts (2 hunks)
Files skipped from review as they are similar to previous changes (5)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/mission/env_mission_action/EnvMissionAction.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/monitorenv/input/EnvMissionActionDataResponse.kt
  • frontend/cypress/e2e/side_window/mission_form/main_form.spec.ts
  • frontend/src/features/Mission/components/MissionForm/ActionList/index.tsx
  • frontend/src/features/Mission/components/MissionForm/formikUsecases.ts
Additional comments: 1
frontend/src/features/Mission/envMissionAction.types.ts (1)
  • 5-5: The change to make actionStartDateTimeUtc optional in the MissionAction interface could have significant implications on how instances of MissionAction are created and used. Ensure that all usages of MissionAction throughout the application are reviewed to handle the potential absence of actionStartDateTimeUtc correctly.

Copy link

sonarcloud bot commented Mar 27, 2024

Quality Gate Passed Quality Gate passed

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ce6cb3a and 838cee4.
Files selected for processing (3)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/infraction/GetAllInfractions.kt (1 hunks)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/MissionActionEntity.kt (3 hunks)
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PublicMissionActionsControllerITests.kt (3 hunks)
Files skipped from review as they are similar to previous changes (3)
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/infraction/GetAllInfractions.kt
  • backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/database/entities/MissionActionEntity.kt
  • backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/PublicMissionActionsControllerITests.kt

@louptheron louptheron merged commit f7a2c19 into master Mar 27, 2024
25 checks passed
@louptheron louptheron deleted the loup/add-check-of-recent-cacem-actions branch March 27, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synchro missions – Récupérer les dates d'actions des deux centres pour le calcul des zones de mission
2 participants