-
Notifications
You must be signed in to change notification settings - Fork 1
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
Thomas/backend env actions attached to reportings #887
Thomas/backend env actions attached to reportings #887
Conversation
@@ -1,4 +1,4 @@ | |||
package fr.gouv.cacem.monitorenv.domain.entities.mission | |||
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction | |
package fr.gouv.cacem.monitorenv.domain.entities.mission.action |
J'avoue que depuis le début je ne suis pas super fan de ce nommage, une action
dans ce repo est pas définition une action Env, car il n'y en a aucune autre.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il me semble qu'au début on n'était pas sûrs de ce qu'allait stocker la base monitorEnv, et j'imaginais qu'il pouvait y avoir d'autres types d'actions. Ok pour renommer en envAction
en action
. Est ce qu'on renomme aussi la table en db ? (je dirais plutot non)
@@ -0,0 +1,7 @@ | |||
package fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.envActionControl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ici, le envActionControl
fait déjà partie du package envAction
donc ça me semble une répétition de naming de package
reportingRepository.attachReportingsToMission( | ||
attachedReportingIds ?: listOf(), | ||
savedMission.mission.id, | ||
) | ||
|
||
return missionRepository.findById(savedMission.mission.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi ce findBy
avec que save
renvoie la mission ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c'est une confusion de ma part entre le useCase et la couche JPA.
private val departmentRepository: IDepartmentAreaRepository, | ||
private val facadeRepository: IFacadeAreasRepository, | ||
private val missionRepository: IMissionRepository, | ||
private val reportingRepository: IReportingRepository, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private val reportingRepository: IReportingRepository, | |
private val reportingRepository: IReportingRepository, | |
private val createOrUpdateMission: CreateOrUpdateMission, |
Je pense que CreateOrUpdateMissionWithAttachedReporting
devrait utiliser le use-case CreateOrUpdateMission
en dépendance injectée, pour éviter de répéter du code et pour faciliter le refacto par la suite.
Ce use-case deviendra plus simple, avec seulement les l.96 à l.106.
@@ -290,11 +298,14 @@ class MissionsControllerITests { | |||
isGeometryComputedFromControls = false, | |||
), | |||
) | |||
val envAction = EnvActionControlEntity( | |||
val envAction = MissionEnvActionDataInput( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans ce test j'aurais bien testé le when
de MissionEnvActionDataInput
(avec un Mockito.verify()
ici ou alors un test unitaire de MissionEnvActionDataInput
), c'est fréquent d'oublier des propriétés dans ce type de mapper
…porting in form when user attach a reporting to a control
…and detached mission date in back
…is linked to a reporting
580ed2f
to
f147a0a
Compare
…porting in form when user attach a reporting to a control
…and detached mission date in back
97e6e7d
to
e352bbc
Compare
ee5f2b2
to
414fc52
Compare
4695f31
to
c127f7a
Compare
b1593ea
to
7e314a8
Compare
Cherrypicked in claire/attach-reporting-to-mission |
No description provided.