-
Notifications
You must be signed in to change notification settings - Fork 1
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
IS-1867: Add eksternReferanseId to dokarkiv body #480
Conversation
@@ -107,6 +107,7 @@ fun Referat.toJournalforingRequestArbeidstaker( | |||
dokumentName = this.toJournalpostTittel(moteTidspunkt), | |||
brevkodeType = BrevkodeType.DIALOGMOTE_REFERAT_AT, | |||
dokumentPdf = pdf, | |||
varselUuid = UUID.randomUUID(), |
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.
Burde vi egentlig bruke en referanse som er unik for dette spesifikke referatet til arbeidstaker (og tilvarende til behandler, arbeidsgiver) i stedet for å generere en random uuid? I teorien vil jo det samme referatet kunne journalføres flere ganger når man lager ny referanse hver gang.
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.
Da må vi vel i så fall gjøre større endringer? Alt er jo samme referat, så det er samme uuid. Alternativt må vi generere en uuid som blir lik for hver gang men unik for hver mottaker/referat 🤔
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.
Ja, lurer på om det går an å generere en uuid basert på en string - feks. referat.uuid og et eller annet som er unikt for mottaker som du sier.
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.
Java sin UUID godtar bare string som er på riktig format da. Jeg finner ikke en metode som genererer uuid basert på en seed 🤷♂️
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.
Ny versjon nå, etter slack-samtale 👍
f2a3af7
to
e845876
Compare
@@ -40,10 +41,16 @@ class DokarkivMock { | |||
post(JOURNALPOST_PATH) { | |||
val journalpostRequest = call.receive<JournalpostRequest>() | |||
if (journalpostRequest.bruker?.id == ARBEIDSTAKER_NO_JOURNALFORING.value) { | |||
println("No journalføring for bruker") |
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.
Skal alle printene med?
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.
Ja, det synes jeg 😬 🙈
1cfb287
to
ae92b29
Compare
This will be required by dokarkiv 20. december. If api receives an eksternReferanseId that is already stored, it will return 409 Conflict with the existing JournalPost as body. We want to fail when we get 409 becuase we don't want to journalføre the same varsel more than once. Since 409 gives clientException, the existing client returns null, which is then handled by the cron jobs. In referat create UUID for eksternReferanseId based on uuid and recipient, to make sure it's unique for each journalfort version, and also the same each time the same document is journalfort.
ae92b29
to
907a4de
Compare
This will be required by dokarkiv 20. december.
If api receives an eksternReferanseId that is already stored, it will return 409 Conflict with the existing JournalPost as body. We want to fail when we get 409 becuase we don't want to journalføre the same varsel more than once. Since 409 gives clientException, the existing client returns null, which is then handled by the cron jobs.