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

IS-2884: Move unntak-arsaker to ikke-aktuell #1621

Merged
merged 2 commits into from
Jan 27, 2025
Merged

Conversation

andersrognstad
Copy link
Contributor

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å:
image
Ikke aktuell nå:
image

@andersrognstad andersrognstad requested a review from a team as a code owner January 24, 2025 07:50
@@ -7,6 +7,28 @@ export enum UnntakArsak {
ARBEIDSFORHOLD_OPPHORT = "ARBEIDSFORHOLD_OPPHORT",
}

export enum CreateUnntakArsak {
Copy link
Contributor

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?

Copy link
Contributor Author

@andersrognstad andersrognstad Jan 24, 2025

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 🤔

Copy link
Contributor

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 👍🏼

Copy link
Contributor

@vetlesolgaard vetlesolgaard Jan 24, 2025

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;

Copy link
Contributor Author

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 😍

@andersrognstad
Copy link
Contributor Author

andersrognstad commented Jan 24, 2025

Kan merge denne på mandag etter å ha gitt Lars og evt dvh en heads up.

@andersrognstad andersrognstad merged commit eddf300 into master Jan 27, 2025
3 checks passed
@andersrognstad andersrognstad deleted the IS-2884- branch January 27, 2025 09:08
vetlesolgaard pushed a commit that referenced this pull request Jan 29, 2025
* IS-2884: Move unntak-arsaker to ikke-aktuell

* Improve types
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.

4 participants