Skip to content

Commit

Permalink
Bigquery (#317)
Browse files Browse the repository at this point in the history
* Bigquery events for forhåndsvarsler

---------

Co-authored-by: sigurdgroneng <[email protected]>
  • Loading branch information
johatr and tu55eladd authored Oct 31, 2024
1 parent ec0b96e commit e2c4990
Show file tree
Hide file tree
Showing 18 changed files with 326 additions and 190 deletions.
4 changes: 4 additions & 0 deletions nais/nais-dev-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ spec:
envVarPrefix: DB
users:
- name: datastream
bigQueryDatasets:
- description: Funksjonelle metrikker for arbeidsrettet dialog
name: dialog_metrikker
permission: READWRITE
env:
- name: APP_CLUSTER_NAME
value: dev-gcp
Expand Down
4 changes: 4 additions & 0 deletions nais/nais-prod-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ spec:
envVarPrefix: DB
users:
- name: datastream
bigQueryDatasets:
- description: Funksjonelle metrikker for arbeidsrettet dialog
name: dialog_metrikker
permission: READWRITE
env:
- name: APP_CLUSTER_NAME
value: prod-gcp
Expand Down
39 changes: 39 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-lombok</artifactId>
<version>${kotlin.version}</version>
</dependency>

<!-- Kafka NB hvis vi drar inn common-java-modules:kafka kan vi ta bort denne -->
<dependency>
Expand All @@ -283,6 +288,18 @@
<version>${kotlin.version}</version>
</dependency>

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>2.43.2</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.49.0</version>
<type>pom</type>
</dependency>


<!-- test dependencies -->
<dependency>
Expand Down Expand Up @@ -379,6 +396,27 @@
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<compilerPlugins>
<plugin>lombok</plugin>
</compilerPlugins>
<pluginOptions>
<option>lombok:config=${project.basedir}/lombok.config</option>
</pluginOptions>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-lombok</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>compile</scope>
</dependency>
</dependencies>
<extensions>true</extensions> <!-- You can set this option
to automatically take information about lifecycles -->
<executions>
Expand Down Expand Up @@ -448,6 +486,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
</plugin>
<plugin>
<groupId>org.openapitools</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class EskaleringsvarselController {
@OnlyInternBruker
public EskaleringsvarselDto start(@RequestBody StartEskaleringDto startEskaleringDto) {
authService.sjekkTilgangTilPerson(startEskaleringDto.fnr());
EskaleringsvarselEntity eskaleringsvarselEntity = eskaleringsvarselService.start(startEskaleringDto.fnr(), startEskaleringDto.begrunnelse(), startEskaleringDto.overskrift(), startEskaleringDto.tekst());
EskaleringsvarselEntity eskaleringsvarselEntity = eskaleringsvarselService.start(startEskaleringDto);
return EskaleringsvarselDto.fromEntity(eskaleringsvarselEntity);
}

Expand All @@ -48,7 +48,7 @@ public void stop(@RequestBody StopEskaleringDto stopEskaleringDto) {
authService.sjekkTilgangTilPerson(stopEskaleringDto.fnr());
NavIdent navIdent = authService.getInnloggetVeilederIdent();

Optional<EskaleringsvarselEntity> eskaleringsvarselEntity = eskaleringsvarselService.stop(stopEskaleringDto.fnr(), stopEskaleringDto.begrunnelse(), stopEskaleringDto.skalSendeHenvendelse(), navIdent);
Optional<EskaleringsvarselEntity> eskaleringsvarselEntity = eskaleringsvarselService.stop(stopEskaleringDto, navIdent);
if (eskaleringsvarselEntity.isEmpty()) {
throw new ResponseStatusException(HttpStatus.CONFLICT, "Ingen gjeldende eskaleringsvarsel");
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public record StartEskaleringDto(
Fnr fnr,
String begrunnelse,
String overskrift,
String tekst
String tekst,
String begrunnelseType
) {
}
11 changes: 0 additions & 11 deletions src/main/java/no/nav/fo/veilarbdialog/service/ServiceConfig.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
package no.nav.fo.veilarbdialog.service;

import lombok.Getter;
import no.nav.common.token_client.builder.AzureAdTokenClientBuilder;
import no.nav.common.token_client.builder.TokenXTokenClientBuilder;
import no.nav.common.token_client.client.AzureAdMachineToMachineTokenClient;
import no.nav.common.token_client.client.AzureAdOnBehalfOfTokenClient;
import no.nav.common.token_client.client.TokenXOnBehalfOfTokenClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import static lombok.AccessLevel.PACKAGE;

@Configuration
@Getter(PACKAGE)
public class ServiceConfig {

@Value("${application.dialog.url}")
private String arbeidsrettetDialogUrl;

@Value("${spring.application.name}")
private String applicationName;

@Bean
@Profile("!local")
public AzureAdMachineToMachineTokenClient azureAdMachineToMachineTokenClient() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package no.nav.fo.veilarbdialog.eskaleringsvarsel

enum class StansVarselBegrunnelseType(
val tekst: String // Ikke bruk denne til noe, den er bare forklaring av enumen
) {
dagpenger("Dagpenger: Stans og tidsbegrenset bortfall"),
dagpenger_vesentlig_avvik_fra_oppleringsplanen("Dagpenger: Vesentlig avvik fra opplæringsplanen."),
dagpenger_fortsatt_utdanning_etter_opphort_utdanning("Dagpenger: Fortsatt utdanning etter opphørt utdanning."),
ikke_mott_mote("Arbeidsavklaringspenger: Ikke møtt til møte"),
ikke_deltatt_aktivitet("Arbeidsavklaringspenger: Ikke deltatt på planlagt aktivitet eller bidrar ikke for å komme i arbeid"),
ikke_deltatt_tiltak("Arbeidsavklaringspenger: Ikke deltatt på tiltak"),
ikke_lenger_nedsatt_arbeidsevne("Arbeidsavklaringspenger: Ikke lenger nedsatt arbeidsevne"),
uutnyttet_arbeidsevne("Arbeidsavklaringspenger: Reduksjon i utbetaling på grunn av arbeidsevne som ikke er utnyttet"),
stans_aap_i_periode("Arbeidsavklaringspenger: Stans av AAP i perioden som arbeidssøker"),
overgangsstonad("Overgangsstønad"),
sykepenger("Sykepenger")
}

Loading

0 comments on commit e2c4990

Please sign in to comment.