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

EY-4798 Vis advarsel hvis det er gjeldende unntak i saken #6474

Merged
merged 5 commits into from
Nov 28, 2024

Conversation

oyvindsh
Copy link
Contributor

som brevmalen ikke tar høyde for

som brevmalen ikke tar høyde for
@oyvindsh oyvindsh requested a review from a team as a code owner November 27, 2024 17:31
@oyvindsh oyvindsh merged commit afafee5 into main Nov 28, 2024
5 checks passed
@oyvindsh oyvindsh deleted the ey-4798-advarsel-ved-unntak branch November 28, 2024 13:33
import { IAktivitetspliktVurderingNyDto } from '~shared/types/Aktivitetsplikt'

function loeperUnntakEtterSisteVurdering(vurdering: IAktivitetspliktVurderingNyDto): boolean {
const nyesteVurdering = [...vurdering.aktivitet]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trenger vi å lage en ny array her egentlig, kan du ikke bare returnere siste element? :D

import { useAktivitetspliktOppgaveVurdering } from '~components/aktivitetsplikt/OppgaveVurderingRoute'
import { IAktivitetspliktVurderingNyDto } from '~shared/types/Aktivitetsplikt'

function loeperUnntakEtterSisteVurdering(vurdering: IAktivitetspliktVurderingNyDto): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vi kaller vel "vurdering" her både for aktivitet og unntak, så kanskje loeperUnntakEtterSisteAktivitet?

const nyesteFom = new Date(nyesteVurdering.fom)

const harUnntakSomLoeper = vurdering.unntak.some((unntak) => !unntak.tom || new Date(unntak.tom) >= nyesteFom)
return harUnntakSomLoeper
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return in place

Copy link
Contributor

@sebassonav sebassonav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicks

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.

3 participants