-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4689 from navikt/feature/gjennomforing-status
endre fra avbrutt_tidspunkt til avsluttet_tidspunkt
Showing
16 changed files
with
388 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
mulighetsrommet-api/src/main/resources/db/migration/V208__gjennomforing_status.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
alter table tiltaksgjennomforing | ||
rename column avbrutt_tidspunkt to avsluttet_tidspunkt; | ||
|
||
alter table tiltaksgjennomforing | ||
drop constraint ck_avbrutttidspunktaarsak; | ||
|
||
update tiltaksgjennomforing | ||
set avsluttet_tidspunkt = slutt_dato + interval '1' day | ||
where avsluttet_tidspunkt is null | ||
and (slutt_dato + interval '1' day) < now(); | ||
|
||
create or replace function tiltaksgjennomforing_status( | ||
start_dato date, | ||
slutt_dato date, | ||
avbrutt_tidspunkt timestamp | ||
) | ||
returns varchar | ||
language plpgsql | ||
as | ||
$$ | ||
begin | ||
return case | ||
when avbrutt_tidspunkt is null then 'GJENNOMFORES' | ||
when avbrutt_tidspunkt < start_dato then 'AVLYST' | ||
when slutt_dato is null or avbrutt_tidspunkt < slutt_dato + interval '1' day then 'AVBRUTT' | ||
else 'AVSLUTTET' | ||
end; | ||
end; | ||
$$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
319 changes: 193 additions & 126 deletions
319
...lin/no/nav/mulighetsrommet/api/gjennomforing/task/UpdateTiltaksgjennomforingStatusTest.kt
Large diffs are not rendered by default.
Oops, something went wrong.