Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ EDITION_SUIVI_ENABLE=1
DELAY_SUIVI_EDITABLE_IN_MINUTES=20
TRUSTED_PROXIES=0.0.0.0/0
MESSENGER_ALERT_THRESHOLD='3 HOUR'
FEATURE_SISH_REPUSH_MESSAGE=0
### signal-logement ###

### metabase ###
Expand Down
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ INJONCTION_PERIOD_THRESHOLD='3 weeks'
MESSENGER_ALERT_THRESHOLD='3 HOUR'
EDITION_SUIVI_ENABLE=1
DELAY_SUIVI_EDITABLE_IN_MINUTES=20
FEATURE_SISH_REPUSH_MESSAGE=0
###> knplabs/knp-snappy-bundle ###
WKHTMLTOPDF_PATH=wkhtmltopdf
WKHTMLTOIMAGE_PATH=wkhtmltoimage
Expand Down
9 changes: 9 additions & 0 deletions src/DataFixtures/Files/Affectation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ affectations:
affected_by: "admin-territoire-13-01@signal-logement.fr"
motif_cloture: ""
territory: "Bouches-du-Rhône"
-
signalement: 2023-13
partner: "partenaire-13-06@signal-logement.fr"
statut: "NOUVEAU"
answered_by: ""
affected_by: "admin-territoire-13-01@signal-logement.fr"
motif_cloture: ""
territory: "Bouches-du-Rhône"
is_synchronized: true
-
signalement: 2023-14
partner: "partenaire-13-05@signal-logement.fr"
Expand Down
19 changes: 15 additions & 4 deletions src/Service/Interconnection/Esabora/EsaboraManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public function __construct(
#[Autowire(service: 'state_machine.intervention_planning')]
private readonly WorkflowInterface $workflow,
private readonly UserSignalementSubscriptionManager $userSignalementSubscriptionManager,
#[Autowire(env: 'FEATURE_SISH_REPUSH_MESSAGE')]
private readonly bool $featureSishRepushMessage,
) {
$this->adminUser = $this->userManager->getSystemUser();
}
Expand Down Expand Up @@ -139,10 +141,19 @@ public function updateStatusFor(
partner: $affectation->getPartner(),
dispatchAffectationAnsweredEvent: false
);
$description = \sprintf(
'refusé via '.$dossierResponse->getNameSI().' pour motif suivant: %s',
$dossierResponse->getSasCauseRefus()
);
if ($this->featureSishRepushMessage) {
$note = '<i>NOTE : vous pourrez,si besoin, renvoyer ce signalement après mise à jour dans les 24 heures</i>';
$description = \sprintf(
'refusé via '.$dossierResponse->getNameSI().' pour motif suivant: %s<br>%s',
$dossierResponse->getSasCauseRefus(),
$note
);
} else {
$description = \sprintf(
'refusé via '.$dossierResponse->getNameSI().' pour motif suivant: %s',
$dossierResponse->getSasCauseRefus()
);
}
}
break;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/Functional/Manager/Esabora/EsaboraManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public function testAffectationSynchronizedWith(
$this->htmlSanitizerInterface,
$this->workflow,
$this->userSignalementSubscriptionManager,
true,
);

$esaboraManager->synchronizeAffectationFrom($dossierResponse, $affectation);
Expand Down Expand Up @@ -244,6 +245,7 @@ public function testAffectationSynchronizedTwoTimesWithoutChanges(
$this->htmlSanitizerInterface,
$this->workflow,
$this->userSignalementSubscriptionManager,
true,
);

$esaboraManager->synchronizeAffectationFrom($dossierResponse, $affectation);
Expand Down Expand Up @@ -296,6 +298,7 @@ public function testCreateVisiteWithPastDateAppliesConfirmTransition(): void
$this->htmlSanitizerInterface,
$this->workflow,
$this->userSignalementSubscriptionManager,
true,
);

$dossierVisite = $this->getDossierVisiteSISHCollectionResponse()->getCollection()[0];
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Repository/AffectationRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testFindAffectationSubscribedToEsabora(): void
/** @var AffectationRepository $affectationRepository */
$affectationRepository = $this->entityManager->getRepository(Affectation::class);
$affectationsSubscribedToEsabora = $affectationRepository->findAffectationSubscribedToEsabora(PartnerType::ARS);
$this->assertCount(3, $affectationsSubscribedToEsabora);
$this->assertCount(4, $affectationsSubscribedToEsabora);
foreach ($affectationsSubscribedToEsabora as $row) {
$affectationSubscribedToEsabora = $row['affectation'];
$this->assertCount(2, $affectationSubscribedToEsabora->getPartner()->getEsaboraCredential());
Expand Down
12 changes: 8 additions & 4 deletions tests/Unit/Service/Esabora/EsaboraManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public function testFailureCreateVisite(): void
$this->signalementQualificationUpdater,
$this->htmlSanitizer,
$this->workflow,
$this->userSignalementSubscriptionManager
$this->userSignalementSubscriptionManager,
true,
);
$esaboraManager->createOrUpdateVisite($this->getAffectation(PartnerType::ARS), $dossierVisite);
}
Expand Down Expand Up @@ -215,7 +216,8 @@ public function provideEsaboraManagerForIntervention(string $action, Interventio
$this->signalementQualificationUpdater,
$this->htmlSanitizer,
$this->workflow,
$this->userSignalementSubscriptionManager
$this->userSignalementSubscriptionManager,
true,
);
}

Expand Down Expand Up @@ -268,7 +270,8 @@ public function testUpdateFromDossierVisiteReturnsTrueWhenDataChanges(): void
$this->signalementQualificationUpdater,
$this->htmlSanitizer,
$this->workflow,
$this->userSignalementSubscriptionManager
$this->userSignalementSubscriptionManager,
true,
);

$reflector = new \ReflectionClass($esaboraManager);
Expand Down Expand Up @@ -329,7 +332,8 @@ public function testUpdateFromDossierVisiteReturnsFalseWhenNoChanges(): void
$this->signalementQualificationUpdater,
$this->htmlSanitizer,
$this->workflow,
$this->userSignalementSubscriptionManager
$this->userSignalementSubscriptionManager,
true,
);

$reflector = new \ReflectionClass($esaboraManager);
Expand Down
Loading
Loading