Skip to content
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

Cronjob for outdated dialogmotekandidater #138

Merged
merged 2 commits into from
Sep 20, 2023
Merged

Conversation

andersrognstad
Copy link
Contributor

Tanken er at jobben finner siste DialogmotekandidatEndring for alle personer. Sjekker så om den er laget før 1.6.2023 og om kandidat=true.
For disse personene lages det en ny DialogmotekandidatEndring med kandidat=false og årsak=LUKKET.

@andersrognstad andersrognstad marked this pull request as ready for review September 18, 2023 06:54
@andersrognstad andersrognstad requested a review from a team as a code owner September 18, 2023 06:54
@@ -14,6 +14,7 @@ enum class DialogmotekandidatEndringArsak {
STOPPUNKT,
DIALOGMOTE_FERDIGSTILT,
UNNTAK,
LUKKET, // TODO: Konsumenter må støtte denne
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const val queryFindOutdatedDialogmotekandidater =
"""
select * from dialogmotekandidat_endring d
where d.created_at = (select max(d2.created_at) from dialogmotekandidat_endring d2 where d2.personident = d.personident group by d.personident)
Copy link
Contributor

@geir-waagboe geir-waagboe Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gjøre det noen forskjell å gjøre "group by d.personident" her? For meg ser det redundant ut.

Hadde det vært bedre (og er det mulig) å sjekke at endringene relaterer seg til samme oppfølgingstilfelle?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gjøre det noen forskjell å gjøre "group by d.personident" her? For meg ser det redundant ut.

Nei, det er visst redundant ja 😅

Hadde det vært bedre (og er det mulig) å sjekke at endringene relaterer seg til samme oppfølgingstilfelle?

Usikker på hvordan det blir bedre. Da måtte vi jo i så fall gjort kall til isoppfolgingstilfelle her i tillegg siden vi ikke har lagret oppfolgingstilfellene.

Copy link
Contributor

@eirikdahlen eirikdahlen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gode tester! 🏆

@andersrognstad andersrognstad merged commit 5983fae into master Sep 20, 2023
3 checks passed
@andersrognstad andersrognstad deleted the hostdugnad branch September 20, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants