-
Notifications
You must be signed in to change notification settings - Fork 9
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-2884: Move unntak-arsaker to ikke-aktuell #1621
Conversation
5e23aac
to
830a986
Compare
@@ -7,6 +7,28 @@ export enum UnntakArsak { | |||
ARBEIDSFORHOLD_OPPHORT = "ARBEIDSFORHOLD_OPPHORT", | |||
} | |||
|
|||
export enum CreateUnntakArsak { |
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.
Kunne man delt det opp på en måte som gjør det enda mer tydelig at noe har skjedd her?:
CreateUnntakArsak { ... }
sånn som her, og så en DepricatedUnntakArsak
, og så heller ha UnntakArsak = CreateUnntakArsak & DepricatedUnntakArsak
eller noe sånt?
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.
union / intersection typer er ganske hårete med enums i typescript. Måtte eventuelt endret til å bruke vanlig string literal type:
eks:
type CreateUnntakArsak = "MEDISINSKE_GRUNNER" | "INNLEGGELSE_INSTITUSJON" | "FORVENTET_FRISKMELDING_INNEN_28UKER" | "DOKUMENTERT_TILTAK_FRISKMELDING"
type DeprecatedUnntakArsak = "FRISKMELDT" | "ARBEIDSFORHOLD_OPPHORT"
type UnntakArsak = CreateUnntakArsak | DeprecatedUnntakArsak
Da bruker man bare stringen (eks "FRISKMELDT"
) der hvor den brukes i stedet for UnntakArsak.FRISKMELDT
, så det er litt mindre eksplisitt i bruk, men synes kanskje det er bedre likevel i dette tilfellet 🤔
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 okey, da kan vi beholde det sånn 👍🏼
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.
Ble også litt forvirret av slik det er nå. Går dette?👇😊 Fikk ikke testet det, men får ingen kjørefeil i alle fall
export enum ValidUnntakArsak {
MEDISINSKE_GRUNNER = "MEDISINSKE_GRUNNER",
INNLEGGELSE_INSTITUSJON = "INNLEGGELSE_INSTITUSJON",
FORVENTET_FRISKMELDING_INNEN_28UKER = "FORVENTET_FRISKMELDING_INNEN_28UKER",
DOKUMENTERT_TILTAK_FRISKMELDING = "DOKUMENTERT_TILTAK_FRISKMELDING",
}
export enum DeprecatedUnntakArsak {
FRISKMELDT = "FRISKMELDT",
ARBEIDSFORHOLD_OPPHORT = "ARBEIDSFORHOLD_OPPHORT",
}
export type UnntakArsak = ValidUnntakArsak | DeprecatedUnntakArsak;
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.
Ser ut som det funka 😍
830a986
to
45cf5ce
Compare
45cf5ce
to
72f55dd
Compare
Kan merge denne på mandag etter å ha gitt Lars og evt dvh en heads up. |
* IS-2884: Move unntak-arsaker to ikke-aktuell * Improve types
Hva har blitt lagt til✨🌈
Flytter årsakene "friskmeldt" og "arbeidsforhold opphørt" fra unntak til ikke aktuell. Årsakene må fortsatt ligge der for å kunne vise historiske unntak.
Screenshots 📸✨
Unntak nå:


Ikke aktuell nå: