Skip to content

Commit

Permalink
EY-4663 - Åpne opp for å la selvbetjening sjekke om bruker har sak (#…
Browse files Browse the repository at this point in the history
…6241)

* Åpne opp for å la selvbetjening sjekke om bruker har sak

* Oppdater rolle til å være mer spesifik for bruken

* Forenkle logikk i route
  • Loading branch information
perkynades authored Nov 7, 2024
1 parent b3a2b68 commit 85277e6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions apps/etterlatte-api/.nais/dev-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ spec:
accessPolicy:
inbound:
rules:
- application: selvbetjening-backend
namespace: etterlatte
cluster: dev-gcp
permissions:
roles:
- les-oms-sak-for-person
- application: arbeid-og-inntekt
namespace: team-inntekt
cluster: dev-fss
Expand Down
6 changes: 6 additions & 0 deletions apps/etterlatte-api/.nais/prod-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ spec:
accessPolicy:
inbound:
rules:
- application: selvbetjening-backend
namespace: etterlatte
cluster: prod-gcp
permissions:
roles:
- les-oms-sak-for-person
- application: arbeid-og-inntekt
namespace: team-inntekt
cluster: prod-fss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,17 @@ fun Route.behandlingSakRoutes(
accessPolicyRolesEllerAdGrupper = generateRoles(config)
issuers = setOf(Issuer.AZURE.issuerName)
}

get("/har_sak") {
val foedselsnummer = call.receive<FoedselsnummerDTO>()
val saker = behandlingService.hentSakforPerson(foedselsnummer)

call.respond(HarOMSSakIGjenny(saker.isNotEmpty()))
}

post("/person/sak") {
val fnrOgSaktype = call.receive<FoedselsnummerDTO>()
call.respond(behandlingService.hentSakforPerson(fnrOgSaktype))
val foedselsnummer = call.receive<FoedselsnummerDTO>()
call.respond(behandlingService.hentSakforPerson(foedselsnummer))
}
}

Expand All @@ -62,3 +70,7 @@ fun Route.behandlingSakRoutes(
}
}
}

data class HarOMSSakIGjenny(
val harOMSSak: Boolean,
)

0 comments on commit 85277e6

Please sign in to comment.