Skip to content

Commit 1e83b44

Browse files
committed
Feature: Refactor status fields in Bestillinger and Dashboard components
1 parent 56a4606 commit 1e83b44

4 files changed

Lines changed: 20 additions & 23 deletions

File tree

apps/dolly-backend/src/main/java/no/nav/dolly/domain/dto/DashboardDTO.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
public class DashboardDTO {
1515

1616
private LocalDate dato;
17-
private Long personer;
18-
private Long nyePersoner;
19-
private Long gjenopprettinger;
17+
private Long personerTotalt;
18+
private Long nye;
19+
private Long gjenopprettede;
2020
private Long pdlFeil;
21-
private Long aaregFeil;
22-
private Long penFeil;
21+
private Long annenFeil;
2322
}

apps/dolly-backend/src/main/java/no/nav/dolly/domain/projection/BestillingerFragment.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ public class BestillingerFragment {
1717
private Long personer;
1818
private String gjenopprettstatus;
1919
private String pdlstatus;
20-
private String aaregstatus;
21-
private String penstatus;
20+
private String annenstatus;
2221
}

apps/dolly-backend/src/main/java/no/nav/dolly/repository/BestillingRepository.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,21 @@ when lower(bp.pdl_forvalter_status) like '%feil%' then 'FEIL'
148148
when lower(bp.pdl_ordre_status) like '%feil%' then 'FEIL'
149149
else 'OK'
150150
end as pdlStatus,
151-
case
152-
when lower(bp.aareg_status) like '%feil%' then 'FEIL'
153-
else 'OK'
154-
end as aaregStatus,
155151
case
156152
when lower(bp.pensjonforvalter_status) like '%feil%' then 'FEIL'
153+
when lower(bp.aareg_status) like '%feil%' then 'FEIL'
154+
when lower(bp.arenaforvalter_status) like '%feil%' then 'FEIL'
155+
when lower(bp.instdata_status) like '%feil%' then 'FEIL'
156+
when lower(bp.inntektsstub_status) like '%feil%' then 'FEIL'
157+
when lower(bp.inntektsmelding_status) like '%feil%' then 'FEIL'
158+
when lower(bp.sigrunstub_status) like '%feil%' then 'FEIL'
159+
when lower(bp.dokarkiv_status) like '%feil%' then 'FEIL'
160+
when lower(bp.feil) like '%feil%' then 'FEIL'
157161
else 'OK'
158-
end as penStatus
162+
end as annenStatus
159163
from bestilling b
160164
join bestilling_progress bp on b.id = bp.bestilling_id
161-
group by dato, gjenopprettStatus, pdlStatus, aaregStatus, penStatus
165+
group by dato, gjenopprettStatus, pdlStatus, annenStatus
162166
order by dato desc
163167
""")
164168
Flux<BestillingerFragment> findBestillingerOrderBySistOppdatert();

apps/dolly-backend/src/main/java/no/nav/dolly/service/DashboardService.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ public Flux<DashboardDTO> getBestillingStatus() {
2727
.dato(fragmentliste.stream()
2828
.map(BestillingerFragment::getDato)
2929
.findAny().orElse(null))
30-
.personer(fragmentliste.stream()
30+
.personerTotalt(fragmentliste.stream()
3131
.map(BestillingerFragment::getPersoner)
3232
.reduce(0L, Long::sum))
33-
.nyePersoner(fragmentliste.stream()
33+
.nye(fragmentliste.stream()
3434
.filter(fragment -> "NYBESTILLING".equals(fragment.getGjenopprettstatus()))
3535
.map(BestillingerFragment::getPersoner)
3636
.reduce(0L, Long::sum))
37-
.gjenopprettinger(fragmentliste.stream()
37+
.gjenopprettede(fragmentliste.stream()
3838
.filter(fragment -> "GJENOPPRETTING".equals(fragment.getGjenopprettstatus()))
3939
.map(BestillingerFragment::getPersoner)
4040
.reduce(0L, Long::sum))
@@ -43,14 +43,9 @@ public Flux<DashboardDTO> getBestillingStatus() {
4343
"FEIL".equals(fragment.getPdlstatus()))
4444
.map(BestillingerFragment::getPersoner)
4545
.reduce(0L, Long::sum))
46-
.aaregFeil(fragmentliste.stream()
46+
.annenFeil(fragmentliste.stream()
4747
.filter(fragment ->
48-
"FEIL".equals(fragment.getAaregstatus()))
49-
.map(BestillingerFragment::getPersoner)
50-
.reduce(0L, Long::sum))
51-
.penFeil(fragmentliste.stream()
52-
.filter(fragment ->
53-
"FEIL".equals(fragment.getPenstatus()))
48+
"FEIL".equals(fragment.getAnnenstatus()))
5449
.map(BestillingerFragment::getPersoner)
5550
.reduce(0L, Long::sum))
5651
.build())

0 commit comments

Comments
 (0)