Skip to content

Store motebehov formSnapshot and V4 controllers #411

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

Merged
merged 29 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2395787
Move motebehov field IDs to sepearate file, and convert motebehovLega…
haakomol Mar 7, 2025
ea8b8af
WIP - Store motebehov fillout and values inside
haakomol Mar 7, 2025
6e1f6e1
Read out form snapshot from database JSON to object
haakomol Mar 9, 2025
ff70352
More renaming and fix sql queries and add index
haakomol Mar 10, 2025
b5dde7c
Fix detekt errors
haakomol Mar 10, 2025
a088a4e
Fix SQL syntax error
haakomol Mar 10, 2025
d4c1ae4
Fix error in MotebehovDAO
haakomol Mar 10, 2025
479591e
Fix more error in MotebehovDAO
haakomol Mar 10, 2025
f78e80b
Change foreign key relation between tables
haakomol Mar 12, 2025
52f7211
WIP new tests for new motehehov formSnapshot and formValues
haakomol Mar 12, 2025
1acec74
Add functionality and tests for converting FormSnapshot to JSON and back
haakomol Mar 24, 2025
b7564ef
Add tests for storing and retrieving motebehov in MotebehovDAOTest an…
haakomol Mar 24, 2025
8ee43ab
Move form identifier constants to own file
haakomol Mar 26, 2025
da8ad39
Store form values in DB without reading them out
haakomol Mar 30, 2025
848efa6
Add VeilederControllerV4 and renaming
haakomol Mar 31, 2025
a27c3b4
Add tests for V4 controllers, modified from tests for V3 controllers
haakomol Apr 1, 2025
8ddbc34
Uncomment Flyway script for new table
haakomol Apr 1, 2025
4d3a651
Fix detekt
haakomol Apr 1, 2025
d563be3
Simplify some DTO class names
haakomol Apr 1, 2025
782da57
Rename flyway migration file to v1.12 name
haakomol Apr 3, 2025
2d40c9b
Return legacy MotebehovStatus DTOs from controllers
haakomol Apr 4, 2025
b353454
Remove use of non null assertion operator
haakomol Apr 6, 2025
b4a4ecb
Rename FieldSnapshot.fieldID to fieldId
haakomol Apr 7, 2025
79d2fb6
Change FieldSnapshot property names for value
haakomol Apr 11, 2025
1dbf738
Change `wasOptional` to `wasRequired` in FieldSnapshot types.
haakomol Apr 11, 2025
77f258d
Add db check constraint for the form_identifier column
haakomol Apr 12, 2025
4782e99
Add DROP TABLE IF EXISTS statement to MOTEBEHOV_FORM_VALUES flyway sc…
haakomol Apr 12, 2025
b1c6b1f
Remove comment from flyway migration script and add comment to Motebe…
haakomol Apr 14, 2025
66b010c
Add deserializer annotation to fieldSnapshots DTO field
haakomol Apr 7, 2025
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
2 changes: 2 additions & 0 deletions detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<SmellBaseline>
<ManuallySuppressedIssues>
<ID>TooManyFunctions:MotebehovService.kt$MotebehovService</ID>
<ID>LongParameterList:MotebehovVeilederADControllerV4.kt$MotebehovVeilederADControllerV4$( private val contextHolder: TokenValidationContextHolder, private val metric: Metric, private val historikkService: HistorikkService, private val motebehovService: MotebehovService, private val pdlConsumer: PdlConsumer, private val veilederTilgangConsumer: VeilederTilgangConsumer, private val esyfovarselService: EsyfovarselService, )</ID>
<ID>LongParameterList:MotebehovArbeidstakerControllerV4.kt$MotebehovArbeidstakerControllerV4$( private val contextHolder: TokenValidationContextHolder, private val metric: Metric, private val motebehovStatusServiceV2: MotebehovStatusServiceV2, private val motebehovOppfolgingstilfelleServiceV2: MotebehovOppfolgingstilfelleServiceV2, @Value("\${dialogmote.frontend.client.id}") val dialogmoteClientId: String, @Value("\${ditt.sykefravaer.frontend.client.id}") val dittSykefravaerClientId: String, @Value("\${esyfo-proxy.client.id}") val esyfoProxyClientId: String, )</ID>
</ManuallySuppressedIssues>
<CurrentIssues>
<ID>AnnotationOnSeparateLine:MotebehovArbeidsgiverControllerV3.kt$MotebehovArbeidsgiverControllerV3$@Pattern(regexp = "^[0-9]{11}$")</ID>
Expand Down
20 changes: 12 additions & 8 deletions src/main/kotlin/no/nav/syfo/metric/Metric.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package no.nav.syfo.metric

import io.micrometer.core.instrument.MeterRegistry
import io.micrometer.core.instrument.Tags
import no.nav.syfo.motebehov.MotebehovSvar
import no.nav.syfo.motebehov.MotebehovFormSubmissionCombinedDTO
import no.nav.syfo.motebehov.motebehovstatus.MotebehovSkjemaType
import no.nav.syfo.oppfolgingstilfelle.database.PersonOppfolgingstilfelle
import org.springframework.stereotype.Controller
Expand Down Expand Up @@ -150,28 +150,32 @@ class Metric @Inject constructor(
fun tellBesvarMotebehov(
activeOppfolgingstilfelle: PersonOppfolgingstilfelle,
motebehovSkjemaType: MotebehovSkjemaType?,
motebehovSvar: MotebehovSvar,
formSubmission: MotebehovFormSubmissionCombinedDTO,
erInnloggetBrukerArbeidstaker: Boolean
) {
val harForklaring = motebehovSvar.forklaring?.isNotBlank() ?: false
val harForklaring = formSubmission.forklaring?.isNotBlank() ?: false

tellMotebehovBesvart(
activeOppfolgingstilfelle,
motebehovSkjemaType,
motebehovSvar.harMotebehov,
formSubmission.harMotebehov,
erInnloggetBrukerArbeidstaker
)
countDayInOppfolgingstilfelleMotebehovCreated(
activeOppfolgingstilfelle,
motebehovSkjemaType,
motebehovSvar.harMotebehov,
formSubmission.harMotebehov,
harForklaring,
erInnloggetBrukerArbeidstaker
)
if (!motebehovSvar.harMotebehov) {
tellMotebehovBesvartNeiAntallTegn(motebehovSvar.forklaring!!.length, erInnloggetBrukerArbeidstaker)

if (!formSubmission.harMotebehov && formSubmission.forklaring !== null) {
tellMotebehovBesvartNeiAntallTegn(formSubmission.forklaring.length, erInnloggetBrukerArbeidstaker)
} else if (harForklaring) {
tellMotebehovBesvartJaMedForklaringTegn(motebehovSvar.forklaring!!.length, erInnloggetBrukerArbeidstaker)
tellMotebehovBesvartJaMedForklaringTegn(
formSubmission.forklaring!!.length,
erInnloggetBrukerArbeidstaker
)
tellMotebehovBesvartJaMedForklaringAntall(erInnloggetBrukerArbeidstaker)
}
}
Expand Down

This file was deleted.

Loading