-
Notifications
You must be signed in to change notification settings - Fork 0
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
[API] Mise à jour affectation #3655
base: develop
Are you sure you want to change the base?
Conversation
9592304
to
cb21afe
Compare
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.
Quelques commentaires dans le code (pas grand choses)
Quelques test KO :
- Si j'envoie un payload sans valeur
{
"statut": null,
"motifCloture": null,
"motifRefus": null,
"message": null,
"notifyUsager": null
}
J'ai un crash erreur 500 (si possible et pas trop compliqué à corriger en erreur propre)
{
"statut": "EN_COURS",
"motifCloture": "DEPART_OCCUPANT",
"motifRefus": "EN_COURS",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"notifyUsager": "true"
}
Le payload d'exemple génère des erreurs (notifyUsager, motifRefus)
Difficile d'être exhaustif dans les tests
Signalement $signalement, | ||
Affectation $affectation, | ||
User $user, | ||
Request $request, | ||
FirstAffectationAcceptedSpecification $firstAcceptedAffectationSpecification, | ||
DossierMessageFactory $dossierMessageFactory, | ||
MessageBusInterface $bus, | ||
): Response { | ||
$this->denyAccessUnlessGranted(AffectationVoter::ANSWER, $affectation); |
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.
Est-ce qu'on ne devrait pas ici ajouter un check du statut existant pour autoriser uniquement si STATUS_WAIT
?
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.
Je pourrais à la place appliquer le nouveau voter la ou il est applicable ? (Je voudrais le faire valider avant et faire un autre ticket)
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.
Pour ce cas précis le workflow me parait pas assez restrictif, on veux uniquement que ce soit possible si le statut est STATUS_WAIT (mais ca peux en effet attendre le ticket dédié d'application du voter)
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.
@numew
Erreur 500 sur une payload avec des propriétés null corrigé
OK j'ai mis à jour la doc avec des vrai exemples de payload
c75a78a
to
53d478c
Compare
53d478c
to
cc4e5fc
Compare
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.
tests OK
); | ||
|
||
$signalement->addSuivi($suivi); | ||
$this->sendMailToPartner( |
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 le dispatch de SuiviCreatedEvent dans le SuiviManager ne suffit pas ?
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.
ça fait planter les tests, il faudrait faire un tour sur ce qui reste comme envoi de mail après création de suivi je crée un ticket
@@ -61,22 +57,6 @@ public function onSignalementClosed(SignalementClosedEvent $event): void | |||
$this->sendMailToPartners($signalement); |
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.
idem
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.
Y'a des conditions dans le SuiviCreatedEventSubscriber pour ignorer les signalement cloturés.
Faudrait une suite au ticket refacto suppression ActivityListener mais dans l'absolu je suis d'accord de tout centraliser. Mais pas dans cette PR
|
Ticket
#3619
Description
Mise à jour des affectations selon le workflow de l'application
Changements apportés
Affectation
poursignalementResponse
uuid
sur la tableaffectation
AffectationVoter::VALID_WORKFLOW_STATUT
dans le voter afin de restreindre les mises à jour aux seules transitions valides.SecurityApiExceptionListener
affectation.closed
Pré-requis
Configuration
Tests
http://localhost:8080/api/doc#tag/Affectations/operation/patch_api_affectations_update
/api/affectations/{{affectation_uuid}}
avec un workflow valide (Même comportement que sur l'app)Tests TNR