Skip to content
cccskills
FreePublished on GitHub

oppgave

Expert knowledge of Oppgave (task management) integration in melosys-api. Use when: (1) Creating, updating, or closing oppgaver (tasks), (2) Understanding task types (BEH_SAK_MK, VUR, JFR) and priorities, (3) Debugging task assignment or reuse logic, (4) Working with saga steps for oppgave handling, (5) Understanding sensitive case routing (NAV Viken vs Melosys unit).

The English summary is being prepared. Showing the original description.

See how to install

Files included (4)

  • SKILL.md10.5 KB
  • references/debugging.md5.9 KB
  • references/mapping.md5.5 KB
  • references/task-types.md3.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Oppgave Integration

Oppgave is NAV's task management system. Melosys creates tasks for saksbehandlere to work on when behandlinger are created or need attention.

Quick Reference

Module Structure

service/oppgave/                # Kotlin
├── OppgaveService.kt           # Service facade orchestrating operations
├── OppgaveFactory.kt           # Builds tasks with correct metadata
├── OppgaveGosysMapping.kt      # Complex mapping table for task properties
├── OppgaveBehandlingstema.kt   # ab-code enum (EU_EOS_YRKESAKTIV = "ab0483", …)
├── OppgaveBehandlingstemaUtleder.kt
├── OppgaveBeskrivelseUtleder.kt
├── OppgaveTemaUtleder.kt
├── OppgavetypeUtleder.kt
├── Oppgaveplukker.kt
├── OppgaveSoekFilter.kt
└── migrering/                  # Oppgave-ID backfill jobs

integrasjon/oppgave/            # Java
├── OppgaveFasade.java          # Integration interface (calls Oppgave REST API)
├── OppgaveFasadeImpl.java      # Fasade implementation
├── OppgaveOppdatering.java     # Builder DTO for updates
└── konsument/
    └── OppgaveClient.java      # REST client for the Oppgave API

domain/oppgave/                 # Java
└── Oppgave.java                # Immutable task entity (Builder)

There are two layers: OppgaveService (service-module facade exposing domain-friendly operations) delegates to OppgaveFasade/OppgaveFasadeImpl (integration layer that calls the external Oppgave REST API via konsument/OppgaveClient).

Key Operations

OppgaveService (service layer) and OppgaveFasade (integration layer) expose different method names. Use OppgaveService from business code; it delegates to the fasade.

OperationOppgaveService methodDescription
CreateopprettOppgave(oppgave)Create standard task
FetchhentOppgaveMedOppgaveID(oppgaveID)Get task by ID
UpdateoppdaterOppgave(oppgaveID, oppdatering)Update task properties
CompleteferdigstillOppgave(oppgaveID)Mark task as done
ReturnleggTilbakeBehandlingsoppgaveMedSaksnummer(saksnummer)Unassign task on a case
AssigntildelOppgave(oppgaveID, saksbehandler)Assign to saksbehandler
ReuseopprettEllerGjenbrukBehandlingsoppgave(...)Create or reuse existing
Find openfinnÅpneBehandlingsoppgaverMedFagsaksnummer(saksnummer)Open tasks for case

OppgaveFasade exposes the raw integration calls used by the service, including opprettSensitivOppgave(oppgave) (routes to NAV Viken), hentOppgave(oppgaveId), leggTilbakeOppgave(oppgaveId), finnOppgaverMedAktørId(aktørID, oppgavetyper), finnUtildelteOppgaverEtterFrist(behandlingstema) and finnÅpneBehandlingsoppgaverMedSaksnummer(saksnummer).

Task Types (Oppgavetyper)

TypeNameDescription
BEH_SAK_MKBehandle sakMain treatment task
VURVurder dokumentDocument evaluation
JFRJournalføringDocument filing
BEH_SEDBehandle SEDSED document handling
VURD_HENVVurder henvendelseEvaluate inquiry
VURD_MAN_INNBManglende innbetalingMissing payment
BEH_ARSAVREGÅrsavregningAnnual settlement

Priorities (PrioritetType)

PriorityName
LAVLow
NORMNormal (default)
HOYHigh

Tema Values

TemaDescription
MEDMedlemskap (membership)
UFMUnntak fra medlemskap
TRYTrygdeavgift (social insurance charge)

Entity Relationships

Fagsak (saksnummer)
├── Behandling
│   ├── oppgaveId ──────────► Oppgave
│   ├── tema                   ├── saksnummer
│   ├── type                   ├── journalpostId
│   └── fristDato              ├── oppgavetype
│                              ├── tema
└── Multiple Oppgaver          ├── behandlingstema
    (over time)                ├── prioritet
                               ├── tilordnetRessurs
                               └── fristFerdigstillelse

Common Operations

Create or Reuse Task

// Most common pattern - creates new or reuses existing
oppgaveService.opprettEllerGjenbrukBehandlingsoppgave(
    behandling = behandling,
    journalpostId = journalpostId,
    aktørId = aktørId,
    tilordnetRessurs = saksbehandlerId,  // Optional
    orgnr = orgnr
)

Update Task

val oppdatering = OppgaveOppdatering.builder()
    .beskrivelse("Anmodning om unntak er sendt")
    .fristFerdigstillelse(dokumentasjonSvarfrist)
    .build()

oppgaveService.oppdaterOppgave(oppgaveId, oppdatering)

Complete Task

oppgaveService.ferdigstillOppgave(oppgaveId)

Find Tasks

// Open tasks for case (service layer)
val åpne = oppgaveService.finnÅpneBehandlingsoppgaverMedFagsaksnummer(saksnummer)

// Tasks by actor (integration fasade)
val oppgaver = oppgaveFasade.finnOppgaverMedAktørId(aktørId, oppgavetyper)

// Unassigned past deadline (integration fasade)
val forfalt = oppgaveFasade.finnUtildelteOppgaverEtterFrist(behandlingstema)

Task Reuse Logic

Tasks are reused to avoid duplicates:

// Reuse allowed when:
// 1. Existing open task for same saksnummer
// 2. behandling.type != ÅRSAVREGNING (always new task)

if (harEksisterendeÅpenOppgave && !erÅrsavregning) {
    // Reuse existing task, update if needed
} else {
    // Create new task
}

Sensitive Case Handling

Tasks for protected persons route to NAV Viken (NAV_VIKEN_ENHET_ID = 2103) instead of Melosys / NAV Medlemskap og avgift (MELOSYS_ENHET_ID = 4530). Both are defined in integrasjon/Konstanter.java; OppgaveFasadeImpl picks the enhet via erSensitiv ? NAV_VIKEN_ENHET_ID : MELOSYS_ENHET_ID.

// Sensitive when:
// - bruker.harStrengtFortroligAdresse() == true
// - OR child has Diskresjonskode.STRENGT_FORTROLIG

if (erSensitiv) {
    oppgaveFasade.opprettSensitivOppgave(oppgave)  // Routes to NAV Viken (2103)
} else {
    oppgaveFasade.opprettOppgave(oppgave)          // Routes to Melosys (4530)
}

Unit IDs

UnitIDConstantUsage
Melosys (NAV Medlemskap og avgift)4530Konstanter.MELOSYS_ENHET_IDStandard tasks
NAV Viken2103Konstanter.NAV_VIKEN_ENHET_IDSensitive/protected persons

Saga Steps

StepDescription
OPPRETT_OPPGAVECreates or reuses task
GJENBRUK_OPPGAVEReuses task from prior treatment
OPPDATER_OPPGAVE_ANMODNING_UNNTAK_SENDTUpdates task when Art. 16 request sent

Saga Step Flow

OPPRETT_FAGSAK_OG_BEHANDLING
         │
         ▼
   OPPRETT_OPPGAVE  ──► Creates/reuses task
         │                    │
         ▼                    ▼
   (treatment work)     oppgaveId stored
         │              on behandling
         ▼
  IVERKSETT_VEDTAK
         │
         ▼
   ferdigstillOppgave()

OppgaveGosysMapping

A lookup table (rows: List<TableRow>) maps the behandling context to a Gosys oppgave. finnOppgave(sakstype, sakstema, behandlingstema, behandlingstype) returns an internal Oppgave(oppgaveBehandlingstema, tema, oppgaveType, beskrivelsefelt) and throws if no row matches. finnOppgaveOrNull falls back through finnOppgaveFraTabell → finnOppgaveVedBehandlingstypeHenvendelseOgVirksomhet → finnOppgaveVedBehandlingstypeHenvendelse.

Input (TableRow match)Output (Oppgave)
Sakstyper→ oppgaveType (Oppgavetyper)
Sakstemaer→ tema (MED / UFM / TRY)
Set<Behandlingstema>→ oppgaveBehandlingstema (ab-code)
Set<Behandlingstyper>→ beskrivelsefelt

Location: service/oppgave/OppgaveGosysMapping.kt; rows mirror the Confluence "Oppgaver i Gosys" table and are generated by OppgaveGosysMappingCodeGenerator.

Common Issues

1. Multiple Open Tasks

Symptom: TekniskException: "Fant flere åpne oppgaver for sak"

Cause: Data quality issue, duplicate tasks created

Investigation: Oppgave data lives in the external Oppgave system, not in a local table (the only local oppgave-related table is oppgave_tilbakelegging). Query via the service:

val åpne = oppgaveService.finnÅpneBehandlingsoppgaverMedFagsaksnummer("MEL-12345")
log.info("Fant ${åpne.size} åpne oppgaver: ${åpne.map { it.oppgaveId }}")

2. Task Not Found

Symptom: IkkeFunnetException when fetching task

Cause: Wrong oppgaveId or task deleted

Investigation:

// Check behandling has oppgaveId
val oppgaveId = behandling.oppgaveId
// Verify in Oppgave API

3. Sensitive Case Not Routed

Symptom: Protected person's task visible to wrong unit

Investigation:

// Check PDL data
val harFortrolig = pdlService.harStrengtFortroligAdresse(aktørId)
// Check children protection
val barnMedBeskyttelse = // query dependent children

4. Missing Deadline

Symptom: FunksjonellException: "Mangler fristFerdigstillelse"

Cause: Behandling doesn't have deadline set

Resolution: Set behandling.behandlingsfrist before creating task

Debugging

Find Task for Behandling

-- behandling joins fagsak via the saksnummer FK (no fagsak_saksnummer column)
SELECT b.id, b.oppgave_id, b.status, f.saksnummer
FROM behandling b
JOIN fagsak f ON f.saksnummer = b.saksnummer
WHERE b.id = :behandlingId;

Check Task Status in Oppgave System

val oppgave = oppgaveService.hentOppgaveMedOppgaveID(oppgaveId)
log.info("Status: ${oppgave.status}, tilordnet: ${oppgave.tilordnetRessurs}")

Find All Tasks for Person

// Via Oppgave API search (integration fasade)
oppgaveFasade.finnOppgaverMedAktørId(aktørId, arrayOf("BEH_SAK_MK", "VUR"))

Detailed Documentation

  • Task Types: Complete oppgavetype reference
  • Mapping: OppgaveGosysMapping details
  • Debugging: SQL queries, log patterns, and common-issue recipes

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Expert knowledge of Altinn A1 application processing for posted workers in melosys-api. Use when: (1) Understanding Altinn søknad/skjema processing, (2) Debugging MedlemskapArbeidEOS form mapping, (3) Understanding SoeknadMapper transformations, (4) Investigating posted worker application issues, (5) Understanding the MOTTAK_SOKNAD_ALTINN saga flow.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

Expert knowledge of Employer/Employment integration (EREG/AAREG) in melosys-api. Use when: (1) Working with organization data from EREG (Enhetsregisteret), (2) Working with employment data from AAREG (Arbeidsforhold), (3) Understanding employer/organization lookup, (4) Debugging employer or employment issues, (5) Understanding the mapping between register data and domain models. Triggers: orgnummer, arbeidsforhold, EREG, AAREG, Enhetsregisteret, registeropplysninger, ansettelsesperiode, saksopplysning.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

Modular monolith architecture overview for melosys-api. Use when needing to understand module structure, dependencies between modules, where to place new code, or when changes in one module might affect others. Triggers: "architecture", "module dependencies", "where should I put", "which modules", "dependency graph".

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

Expert knowledge of Behandling (case treatment) domain in melosys-api. Use when: (1) Understanding the behandling lifecycle and status transitions, (2) Debugging issues with behandling creation, status changes, or closure, (3) Understanding relationships between Fagsak, Behandling, and Behandlingsresultat, (4) Investigating why a behandling is stuck or has wrong status, (5) Understanding Behandlingstyper, Behandlingstema, Behandlingsstatus enums, (6) Debugging journalføring or SED-triggered behandling creation, (7) Understanding behandling creation via saksflyt sagas.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

Expert knowledge of Behandlingsresultat (treatment result) domain in melosys-api. Use when: (1) Understanding result types and their meaning (FASTSATT_LOVVALGSLAND, MEDLEM_I_FOLKETRYGDEN, etc.), (2) Working with periods - Lovvalgsperiode, Medlemskapsperiode, Anmodningsperiode, Utpekingsperiode, (3) Debugging vedtak/decision metadata, criteria evaluation, or social insurance charges, (4) Understanding EU/EEA coordination logic and Article 16 exception handling, (5) Working with trygdeavgift (social insurance charge) calculations.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

brev

Free

Expert knowledge of Brev (letter generation) in melosys-api. Use when: (1) Producing letters and decision documents (vedtaksbrev), (2) Understanding Dokgen templates and mapping, (3) Configuring letter recipients and distribution, (4) Debugging letter generation issues, (5) Adding new letter types or templates.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

See all skills by navikt

Report a problem with this skill