-
Notifications
You must be signed in to change notification settings - Fork 2
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
Endepunkt for oppslag av fagsak utbetalt 13 mnd #1021
base: main
Are you sure you want to change the base?
Endepunkt for oppslag av fagsak utbetalt 13 mnd #1021
Conversation
…åned som barn startet i fulltid barnehageplass
…åned som barn startet i fulltid barnehageplass
Refaktorering Refaktorering
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.
LGTM, så igjennom en del av sakene, og de stemte! 🌟
""", | ||
nativeQuery = true, | ||
) | ||
fun finnFagsakerSomHarSistIverksattBehandlingMedUtbetalingSomStopperMellomAugOgDes2024(): List<Fagsak> |
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.
Man bruker kun fagsakId videre, så denne kan returnere en liste med Long. Lista er nok ikke så stor, men da sparer man både minne og alle joinsa som hibernate må gjøre mot Aktør. For store lister er man i fare for å få OOM
val fagsaker = fagsakRepository.finnFagsakerSomHarSistIverksattBehandlingMedUtbetalingSomStopperMellomAugOgDes2024() | ||
|
||
// Henter sist iverksatte behandling igjen for fagsaker. Dette bare for å være 100% sikker, slik at vi ikke lener oss for mye på selve SQL spørringen. | ||
val sistIverksatteBehandlinger = fagsaker.mapNotNull { behandlingService.hentSisteBehandlingSomErIverksatt(it.id) } |
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.
Sparer også en del minne hvis man f.eks. mapper til .map { Pair(it.behandlingId, it.fagsak.id) }
|
||
barnSomFårSisteUtbetaling.any { barn -> | ||
val person = personOpplysningGrunnlag.personer.singleOrNull { it.aktør == barn } | ||
val fødselsdato = person?.fødselsdato ?: error("Finner ikke fødselsdato på barn med aktør id ${barn.aktørId}") |
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.
Vil jo anta at man har fødselsdato, men hvis man ikke har det så vil hele uttrekket feile.
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.
Synes dette så knallbra ut. Par kommentarer om optimaliseringer som kan gjøres for å unngå evt OOM, og som nok burde gjøres hvis datasettet hadde vært like stort som i BA, men som sannsynligvis går bra her.
Favrokort: https://favro.com/organization/98c34fb974ce445eac854de0/1844bbac3b6605eacc8f5543?card=NAV-23713
Vi må lage et uttrekk på hvilke saker i perioden aug-des 2024 der barn ble 13 mnd i måned august, september, november og desember 2024 + startet fulltid i bhg i samme måned + fikk utbetalt KS i samme måned.
Her har jeg ikke prioritert kodekvalitet da eneste hensikten er å kunne hente uttrekket, også slette denne koden.
Den er kjørt en gang i produksjon, det resulterte i 764 fagsak.