-
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
[BO - Teamnet] Intégrer interfaçage à iDoss #2571
Conversation
@@ -41,6 +41,8 @@ partners: | |||
is_esabora_active: 1 | |||
type: "COMMUNE_SCHS" | |||
competence: "VISITES" | |||
is_idoss_active: 1 | |||
idoss_url: "https://idoss-dev.portail-familles.com/" |
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 faudrait peut-être un mock comme pour Esabora ?
Sinon on est tributaire de la disponibilité d'idoss pour notre CI :)
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.
également pour le dev comme c'est arrivé lors de la coupure du web-service
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.
En l'état cette URL c'est pour pouvoir tester à la main mais ce n'est pas utilisé par la CI (ceci dit je vais retravailler la partie test auto, mais on ne dépendra pas du service externe)
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.
Comme évoqué mais pas d'urgence il faudra être capable de travailler en local (peut être fait plus tard)
Ex => http://histologe_wiremock:8080/ARS/ws/rest
Genre => http://histologe_wiremock:8080/idoss/ws/rest
src/Factory/Interconnection/Esabora/DossierMessageSCHSFactory.php
Outdated
Show resolved
Hide resolved
src/Factory/Interconnection/Esabora/DossierMessageSISHFactory.php
Outdated
Show resolved
Hide resolved
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. Je n'ai pas encore testé.
Mais peut-être que ça manque de test ? (expiration du token, tester des cas qui ne sont pas censés marcher...?)
J'ai testé le cas que tu as cité, et il est OK. Mais je pense qu'il faudrait un peu plus de TNR sur les autres interfaçages, et tester aussi les cas en erreur pour vérifier qu'on reçoit les erreurs convenablement. |
@@ -41,6 +41,8 @@ partners: | |||
is_esabora_active: 1 | |||
type: "COMMUNE_SCHS" | |||
competence: "VISITES" | |||
is_idoss_active: 1 | |||
idoss_url: "https://idoss-dev.portail-familles.com/" |
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.
également pour le dev comme c'est arrivé lors de la coupure du web-service
src/Factory/Interconnection/Esabora/DossierMessageSCHSFactory.php
Outdated
Show resolved
Hide resolved
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.
Proposition d'évolution pour éviter de s'appuyer sur le statut des affectations
Introduction d'événements explicites
Faudrait introduire des événements explicites pour éviter la dépendance au statut d'affectation et rendre le code plus lisible sur les conditions d'envoi
Stockage des événements en base
Dans le champ de type JSON discuté en PR event_name peut être ajouté pour stocker le type d'événement (acceptation ou affectation).
En constante dans le dossierMessageFactories ça sera plus simple
Modification du contrôleur
Le contrôleur doit être capable de différencier si l'événement est une acceptation ou une affectation.
$this->interconnectionBus->dispatch($affectation, $event);
Mise à jour du bus d'interconnexion
La méthode dispatch du InterconnectionBus doit être mise à jour pour inclure l'événement en tant que paramètre.
public function dispatch(Affectation $affectation, string $event): void
{
/** @var DossierMessageFactoryInterface $dossierMessageFactory */
foreach ($this->dossierMessageFactories as $dossierMessageFactory) {
if ($dossierMessageFactory->supports($affectation, $event) {
$this->messageBus->dispatch($dossierMessageFactory->createInstance($affectation));
}
}
}
Les dossierMessageFactories doivent supporter ce nouveau paramètre
public function supports(Affectation $affectation, string $event): bool
{
return $event === $dossierMessageFactory->getEvent()
&& $this->isEsaboraPartnerActive($affectation)
&& PartnerType::ARS === $affectation->getPartner()->getType();
}
Faire évoluer l'interface pour forcer la déclaration d’événement pour chaque dossier factory
#[AutoconfigureTag('app.dossier_message_factory')]
interface DossierMessageFactoryInterface
{
public function getEvent() : string;
public function supports(Affectation $affectation, string $event): bool;
public function createInstance(Affectation $affectation): DossierMessageInterface;
}
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.
J'ai laissé 3 com mais lecture et test OK
} catch (\Exception $e) { | ||
$responseContent = $e->getMessage(); | ||
$status = JobEvent::STATUS_FAILED; | ||
$statusCode = 9999; |
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.
restons sur les codes erreur http (500 fera l'affaire)
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 préfère garder un code à part en cas d'exception pour justement savoir que ce n'est pas un retour erreur serveur
private ?string $idossToken = null; | ||
|
||
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)] | ||
private ?\DateTimeInterface $idossTokenExpirationDate = null; |
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.
@@ -41,6 +41,8 @@ partners: | |||
is_esabora_active: 1 | |||
type: "COMMUNE_SCHS" | |||
competence: "VISITES" | |||
is_idoss_active: 1 | |||
idoss_url: "https://idoss-dev.portail-familles.com/" |
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.
Comme évoqué mais pas d'urgence il faudra être capable de travailler en local (peut être fait plus tard)
Ex => http://histologe_wiremock:8080/ARS/ws/rest
Genre => http://histologe_wiremock:8080/idoss/ws/rest
17d6b85
to
ec1fc60
Compare
6f37b75
to
b8d2e70
Compare
Quality Gate failedFailed conditions |
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.
Relecture et retests OK pour moi
Ticket
#2515
Description
Interfaçage avec iDoss pour la création de dossier
Changements apportés
Pré-requis
Ajout dans
env.dev
(voir user et pass dans la collection postman dispo ici https://drive.google.com/drive/folders/1oH6EfN8raeA_-2iBNAX5LD0-j2M1aX_x?usp=drive_link)make load-fixtures
make worker-start
Tests
job_event
de serviceidoss
avec un statutsuccess