feat(SCHUL-611): Notificatie Allegro status update#380
feat(SCHUL-611): Notificatie Allegro status update#380RubenSibon wants to merge 29 commits intomainfrom
Conversation
* feat: enable proxy usage * build(release): file w/ tag * build(Make): re-add node versions * build(xdebug): client host * feat: missing files :-) * feat: make import schuldeisers command working from local * build(make): add command to enter pod * refactor(allegro): move duplicate code to helper function * feat(allegro): implement proxy in more services * refactor(allegro): make it more DRY * refactor(allegrohelper): make code more consistent * build(docker): pull and restart policies * chore(cleanup): unused imports and spacing --------- Co-authored-by: jmassink <j.massink@amsterdam.nl>
…ossier into release/SCHUL_sprint-7
* build(release): file w/ tag * build(Make): re-add node versions * build(xdebug): client host * build(deps): composer upgrade * build(deps): npm update * build(deps): bump webpack-dev-server from 4.15.2 to removed in the npm_and_yarn group across 1 directory (#372) * build(deps): bump webpack-dev-server Bumps the npm_and_yarn group with 1 update in the / directory: [webpack-dev-server](https://github.com/webpack/webpack-dev-server). Removes `webpack-dev-server` --- updated-dependencies: - dependency-name: webpack-dev-server dependency-version: dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): upgrade symfony webpack encore And related pacakges. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ruben Sibon <r.sibon@amsterdam.nl> * build(deps): upgrade jspdf majorly --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ossier into release/SCHUL_sprint-7
style(editorconfig): update linelength
…ossier into feat/SCHUL-611_notificatie-allegro-status-update
feat(dossierDasboard.html.twig): don't show export button to normal users
tvanoort85
left a comment
There was a problem hiding this comment.
So far lijkt dit wel ok te zijn :-) heb het niet getest maar codewise heb ik geen mededelingen anders dan die die al gedaan zijn
…ossier into feat/SCHUL-611_notificatie-allegro-status-update
| $io->info('Looking up allegro credentials'); | ||
|
|
||
| /** @var OrganisatieRepository $organisatieRepository */ | ||
| $organisatieRepository = $this->em->getRepository(Organisatie::class); |
There was a problem hiding this comment.
Het is beter om de repository te laten injecten ipv deze via de entity manager op te vragen.
| /** @var OrganisatieRepository $organisatieRepository */ | ||
| $organisatieRepository = $this->em->getRepository(Organisatie::class); | ||
|
|
||
| /** @var Organisatie $allegroId */ |
There was a problem hiding this comment.
De type hint hier stelt dat het om een Organisatie gaat, maar de variabele naam geeft aan dat het om slechts een id gaat.
There was a problem hiding this comment.
Ja inderdaad, ik had het overgenomen uit een ander Command. Ik pas het overal aan.
| return Command::SUCCESS; | ||
| } | ||
|
|
||
| $dossierRepository = $this->em->getRepository(Dossier::class); |
There was a problem hiding this comment.
Het is beter om de repo to injecten in de constructor.
|
|
||
| foreach ($dossiers as $dossier) { | ||
| $header = null; | ||
| try { |
There was a problem hiding this comment.
De indentatie loopt hier verkeerd.
| 'tokenStorage' => $this->tokenStorage | ||
| ]); | ||
| } else { | ||
| $this->logger->notice('Kan geen notifificatie sturen omdat er geen organisatie opgegeven is of er is voor de medewerker van dit dossier geen e-mailadres ingevuld', ['dossierId' => $dossier->getId(), 'gebruikerId' => $dossier->getMedewerkerOrganisatie() ? $dossier->getMedewerkerOrganisatie()->getId() : 'n/a']); |
There was a problem hiding this comment.
We weten op dit punt al dat er null komt uit getMedewerkerOriganisatie() toch? Waar dient deze conditie dan nog voor?
There was a problem hiding this comment.
De code formatter heeft hier alleen de identatie aangepast. Ik raak deze functie verder niet aan.
| 'dossier' => $dossier | ||
| ]); | ||
| } else { | ||
| $this->logger->notice('Kan geen notifificatie sturen omdat er geen organisatie opgegeven is of er is voor de medewerker van dit dossier geen e-mailadres ingevuld', ['dossierId' => $dossier->getId(), 'gebruikerId' => $dossier->getMedewerkerOrganisatie() ? $dossier->getMedewerkerOrganisatie()->getId() : 'n/a']); |
There was a problem hiding this comment.
We weten op dit punt al dat er null komt uit getMedewerkerOriganisatie() toch? Waar dient deze conditie dan nog voor?
There was a problem hiding this comment.
Dit is een kopie van de bovenstaande functies. Ik zal kijken hoe ik het kan aanpassen.
src/Service/AllegroService.php
Outdated
| * @throws \Exception | ||
| */ | ||
| public function updateDossier(Dossier $dossier) | ||
| public function updateDossier(Dossier $dossier, TSRVAanvraagHeader $header = null) |
There was a problem hiding this comment.
Dit kan niet, je specificeert dat $header een object is van het type TSRVAanvraagHeader en daarna wijs je er null aan toe. Met die default value zou de type hint ?TSRVAanvraagHeader moeten zijn.
src/Service/AllegroService.php
Outdated
| * @param Dossier $dossier | ||
| * @throws \Exception | ||
| */ | ||
| public function isDossierInSyncWithAllegro(Dossier $dossier, TSRVAanvraagHeader $header = null) |
There was a problem hiding this comment.
Dit kan niet, je specificeert dat $header een object is van het type TSRVAanvraagHeader en daarna wijs je er null aan toe. Met die default value zou de type hint ?TSRVAanvraagHeader moeten zijn.
src/Service/AllegroService.php
Outdated
| )) | ||
| )->getResult(); | ||
|
|
||
| // TODO: event dispatchen waar de `MailNotificationSubscriber` naar luistert. |
There was a problem hiding this comment.
Aub de todo implementeren of de comment verwijderen.
This PR adds an additional file action button for pdf files. This button opens a pdf inside the browser in a new tab. This button is only visible for PDF files HTML and CSS architecture is refactored. Instead of nested div with relative and absolut positions, the buttons are nested files action list container, which works with flexbox The CSS is made a bit more DRY by introducing mixin's and variables A new 'full-screen' icon is added
feat(db): drop legacy thumbnail table
…ossier into feat/SCHUL-611_notificatie-allegro-status-update
| 'dossier' => $dossier | ||
| ]); | ||
| } else { | ||
| $this->logger->notice('Kan geen notifificatie sturen omdat er geen organisatie opgegeven is of er is voor de medewerker van dit dossier geen e-mailadres ingevuld', ['dossierId' => $dossier->getId(), 'gebruikerId' => $dossier->getMedewerkerOrganisatie() ? $dossier->getMedewerkerOrganisatie()->getId() : 'n/a']); |
There was a problem hiding this comment.
| $this->logger->notice('Kan geen notifificatie sturen omdat er geen organisatie opgegeven is of er is voor de medewerker van dit dossier geen e-mailadres ingevuld', ['dossierId' => $dossier->getId(), 'gebruikerId' => $dossier->getMedewerkerOrganisatie() ? $dossier->getMedewerkerOrganisatie()->getId() : 'n/a']); | |
| $this->logger->notice('Kan geen notifificatie sturen omdat er geen organisatie opgegeven is of er is voor de medewerker van dit dossier geen e-mailadres ingevuld', ['dossierId' => $dossier->getId(), 'gebruikerId' => 'n/a']); |
--------- Co-authored-by: jmassink <j.massink@amsterdam.nl>
…ossier into feat/SCHUL-611_notificatie-allegro-status-update
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <p>Hallo {{ dossier.getMedewerkerOrganisatie.getNaam }},</p> | ||
| <p>Een door jouw beheerd dossier heeft een statuswijziging gekregen vanuit de GKA.</p> | ||
| <p> </p> | ||
| <p><a href="{{ url('gemeenteamsterdam_fixxxschuldhulp_allegro_allegrosrveisers', {'dossierId': dossier.getId}) }}">Open dossier</a> |
There was a problem hiding this comment.
Corrected spelling of 'allegrosrveisers' to 'allegrosrvеisers' (assuming this is a typo in the route name).
| <p>Hallo {{ dossier.getMedewerkerOrganisatie.getNaam }},</p> | ||
| <p>Een door jouw beheerd dossier heeft een statuswijziging gekregen vanuit de GKA.</p> | ||
| <p> </p> | ||
| <p><a href="{{ url('gemeenteamsterdam_fixxxschuldhulp_allegro_allegrosrveisers', {'dossierId': dossier.getId}) }}">Open dossier</a> |
There was a problem hiding this comment.
Inconsistent method call syntax between HTML and text blocks. Line 12 uses property access without parentheses while line 21 uses method calls with parentheses. They should match for consistency and correctness.
| <p>Hallo {{ dossier.getMedewerkerOrganisatie.getNaam }},</p> | |
| <p>Een door jouw beheerd dossier heeft een statuswijziging gekregen vanuit de GKA.</p> | |
| <p> </p> | |
| <p><a href="{{ url('gemeenteamsterdam_fixxxschuldhulp_allegro_allegrosrveisers', {'dossierId': dossier.getId}) }}">Open dossier</a> | |
| <p>Hallo {{ dossier.getMedewerkerOrganisatie().getNaam() }},</p> | |
| <p>Een door jouw beheerd dossier heeft een statuswijziging gekregen vanuit de GKA.</p> | |
| <p> </p> | |
| <p><a href="{{ url('gemeenteamsterdam_fixxxschuldhulp_allegro_allegrosrveisers', {'dossierId': dossier.getId()}) }}">Open dossier</a> |
| $incomingStatus = $header?->getStatus(); | ||
| $incomingExtraStatus = $header?->getExtraStatus(); | ||
|
|
||
| return $currentStatus !== $incomingStatus || $currentExtraStatus !== $incomingExtraStatus; |
There was a problem hiding this comment.
The method name isDossierInSyncWithAllegro is misleading as it returns true when the dossier is NOT in sync (statuses differ). Consider renaming to isDossierOutOfSyncWithAllegro or hasDossierStatusChanged.
| return $currentStatus !== $incomingStatus || $currentExtraStatus !== $incomingExtraStatus; | |
| return $currentStatus === $incomingStatus && $currentExtraStatus === $incomingExtraStatus; |
| $allegroUser = $this->allegroCommandHelper->getAllegroUserFromAnyOrg(); | ||
|
|
||
| if (!isset($allegroUser)) { | ||
| $io->info('No organistation found whith a complete set of Allegro login data'); |
There was a problem hiding this comment.
Corrected spelling of 'organistation' to 'organisation' and 'whith' to 'with'.
| $io->info('No organistation found whith a complete set of Allegro login data'); | |
| $io->info('No organisation found with a complete set of Allegro login data'); |
|
|
||
| if (null === $allegroId) { | ||
| if (!isset($allegroUser)) { | ||
| $io->info('No organistation found whith a complete set of Allegro login data'); |
There was a problem hiding this comment.
Corrected spelling of 'organistation' to 'organisation' and 'whith' to 'with'.
| $io->info('No organistation found whith a complete set of Allegro login data'); | |
| $io->info('No organisation found with a complete set of Allegro login data'); |
| public function __construct( | ||
| private EntityManagerInterface $em, | ||
| ) { | ||
| $this->em = $em; |
There was a problem hiding this comment.
The assignment $this->em = $em on line 14 is redundant since the parameter is already promoted to a property using private EntityManagerInterface $em in the constructor parameter list.
| $this->em = $em; |
| $this->service = $service; | ||
| $this->allegroCommandHelper = $allegroCommandHelper; | ||
| $this->eventDispatcher = $eventDispatcher; |
There was a problem hiding this comment.
Lines 36-38 contain redundant assignments since the parameters are already promoted to properties using constructor property promotion. Only line 35 is needed.
| $this->service = $service; | |
| $this->allegroCommandHelper = $allegroCommandHelper; | |
| $this->eventDispatcher = $eventDispatcher; |
| } | ||
| } | ||
|
|
||
| public function notifyDossierSyncedWithAllegro(DossierChangedEvent $event) |
There was a problem hiding this comment.
The parameter type should be DossierSyncedWithAllegroEvent instead of DossierChangedEvent to properly match the event being dispatched and maintain type safety.
| public function notifyDossierSyncedWithAllegro(DossierChangedEvent $event) | |
| public function notifyDossierSyncedWithAllegro(DossierSyncedWithAllegroEvent $event) |
No description provided.