본문으로 건너뛰기
cccskills
무료GitHub에 공개

statistikk

Expert knowledge of A1 statistics publishing to data warehouse in melosys-api. Use when: (1) Understanding utstedt A1 Kafka publishing, (2) Debugging UtstedtA1Service or Kafka producer issues, (3) Understanding DVH/data warehouse integration, (4) Investigating A1 statistics message format and schema.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md7.8 KB
  • references/debugging.md6.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Statistikk Skill

Expert knowledge of statistics publishing for issued A1 certificates to the data warehouse.

Quick Reference

Key Components

ComponentLocationPurpose
UtstedtA1Servicestatistikk/src/main/java/.../utstedt_a1/service/Creates and sends A1 statistics messages
UtstedtA1EventListenerstatistikk/src/main/java/.../utstedt_a1/service/Listens for vedtak events
UtstedtA1AivenProducerstatistikk/src/main/java/.../utstedt_a1/integrasjon/Kafka producer for Aiven
UtstedtA1AdminControllerstatistikk/src/main/java/.../utstedt_a1/api/Admin endpoint for republishing
UtstedtA1Meldingstatistikk/src/main/java/.../utstedt_a1/integrasjon/dto/Kafka message DTO

Kafka Topics

TopicEnvironmentPurpose
teammelosys.melosys-utstedt-a1.v1prod-gcpA1 issued statistics
teammelosys.melosys-utstedt-a1.v1-q1dev-gcp (q1)A1 issued statistics
teammelosys.melosys-utstedt-a1.v1-q2dev-gcp (q2)A1 issued statistics
teammelosys.melosys-utstedt-a1.v1-locallocalA1 issued statistics

Processing Flow

1. VedtakMetadata is saved → VedtakMetadataLagretEvent published
   ↓
2. UtstedtA1EventListener receives event (@Async, @TransactionalEventListener)
   ↓
3. UtstedtA1Service.sendMeldingOmUtstedtA1(behandlingID) called
   ↓
4. Check if a1Produseres(behandlingsresultat) is true
   ↓
5. Build UtstedtA1Melding with:
   - Serienummer: saksnummer + behandlingId
   - Artikkel: Mapped from LovvalgBestemmelse
   - Periode: From lovvalgsperiode
   - UtsendtTilLand: From trygdemyndighetsland
   - TypeUtstedelse: FØRSTEGANG, ENDRING, or ANNULLERING
   ↓
6. Validate against JSON schema (a1-utstedt-schema.json)
   ↓
7. UtstedtA1AivenProducer publishes to Kafka topic

Debugging

For symptom-by-symptom troubleshooting (message not published, wrong article, missing utsendtTilLand, schema validation failures), diagnostic SQL queries, log strings to grep for, and curl/Kafka console-consumer commands for republishing and inspecting the topic, see references/debugging.md.

UtstedtA1Melding Schema

Message Structure

{
  "serienummer": "MEL-123456",
  "saksnummer": "MEL-123",
  "behandlingId": 456,
  "aktorId": "1234567891234",
  "artikkel": "12.1",
  "periode": {
    "fom": "2024-01-01",
    "tom": "2024-12-31"
  },
  "utsendtTilLand": "SE",
  "datoUtstedelse": "2024-01-15",
  "typeUtstedelse": "FØRSTEGANG",
  "meldingOpprettetTidspunkt": "2024-01-15T10:30:00.000Z"
}

Field Descriptions

FieldTypeRequiredDescription
serienummerStringYesUnique ID: saksnummer + behandlingId
saksnummerStringYesFagsak saksnummer (MEL-*)
behandlingIdLongYesTreatment ID
aktorIdStringYesPerson's aktør-ID (13 chars)
artikkelStringYesEU regulation article. On the Java side this is a Lovvalgsbestemmelse value object that serializes (via @JsonValue on getKode()) to the string code on the wire
periodeObjectYesA1 validity period (fom/tom)
utsendtTilLandStringConditionalISO-2 country code (for Art. 12)
datoUtstedelseDateYesDate of issuance/annulment
typeUtstedelseStringYesFØRSTEGANG, ENDRING, ANNULLERING
meldingOpprettetTidspunktDateTimeYesMessage creation timestamp

Artikkel Values

Mapped from EU Regulation 883/2004:

ValueDescription
11.3aWork in one member state (employed or self-employed)
11.3bCivil servant (tjenestemann)
11.4Work on a ship under a member state's flag (flaggstatsprinsippet)
11.5Flight or cabin crew (flyvende/kabinpersonell)
12.1Posted workers (employees)
12.2Posted workers (self-employed)
13.1Work in two or more states (employee)
13.2Work in two or more states (self-employed)
13.3Work in two or more states (mixed)
13.4Civil servants in multiple states
16Exceptions/agreements

The JSON schema enum (a1-utstedt-schema.json) accepts all values above, including 11.5. The Java Lovvalgsbestemmelse value object (see below) currently only maps 11.3a, 11.3b, 11.4, 12.1, 12.2, 13.1-13.4, and 16 — so a 11.5 value would need to be added to the enum before it can be produced on the wire.

TypeUtstedelse Values

ValueDescription
FØRSTEGANGFirst-time issuance
ENDRINGModification of existing A1
ANNULLERINGAnnulment of existing A1

Special Handling

UK/Great Britain Cases

For UK-related cases (EFTA Storbritannia convention), messages are sent twice:

  1. Once with the GB-specific bestemmelse
  2. Once with the standard 883/2004 equivalent

The gate is whether the lovvalgsperiode's bestemmelse is one of the Lovvalgbestemmelser_konv_efta_storbritannia values. When it is, lagMelding builds the article via Lovvalgsbestemmelse.avKonvensjonEftaStorbritannia(...); otherwise via Lovvalgsbestemmelse.av(...). Actual UtstedtA1Service source:

var erStorbritannia = Arrays.stream(Lovvalgbestemmelser_konv_efta_storbritannia.values())
    .anyMatch(bestemmelse -> bestemmelse == lovvalgsbestemmelse);

if (erStorbritannia) {
    sendMeldingOmUtstedtA1(behandlingsresultat); // GB-specific article (avKonvensjonEftaStorbritannia)
}
sendMeldingOmUtstedtA1(behandlingsresultat);     // standard 883/2004 article (av)

UtsendtTilLand Logic

Land is only included for certain articles:

// Land should NOT be sent for:
// - Article 13 (multiple countries, no single destination)
// - Article 11 (unless also 12 - edge case)
private boolean landSkalIkkeSendes(Lovvalgsperiode lovvalgsperiode) {
    return lovvalgsperiode.erArtikkel13()
        || (lovvalgsperiode.erArtikkel11() && !lovvalgsperiode.erArtikkel12());
}

Admin API

Republish Single Treatment

POST /admin/utstedtA1/{behandlingID}/publiserMelding
Authorization: Bearer {token}

Republish Multiple Treatments

POST /admin/utstedtA1/publiserMelding/eksisterendeBehandlinger?fom=2024-01-01
Authorization: Bearer {token}

Response:
{
  "sendteBehandlinger": [123, 456],
  "feiledeBehandlinger": [789]
}

Configuration

Kafka Configuration

kafka:
  aiven:
    a1-utstedt:
      topic: ${KAFKA_AIVEN_UTSTEDT_A1_TOPIC:teammelosys.melosys-utstedt-a1.v1}

Producer Configuration

@Bean
@Qualifier("aivenUtstedtA1")
KafkaTemplate<String, UtstedtA1Melding> aivenKafkaTemplate

JSON Schema Validation

Messages are validated against: utstedt_a1/a1-utstedt-schema.json

Schema enforces:

  • Required fields presence
  • Field types and formats
  • Valid enum values for artikkel and typeUtstedelse
  • Date formats (ISO-8601)
  • String length limits

Integration Points

Event Source

Triggered by: VedtakMetadataLagretEvent

  • Published when vedtak metadata is saved
  • Event contains behandlingID

Dependencies

ServicePurpose
BehandlingsresultatServiceFetch behandlingsresultat
LandvelgerServiceGet trygdemyndighetsland
VedtakMetadataRepositoryQuery existing vedtak for republishing

Related Skills

  • vedtak: VedtakMetadata triggers statistics
  • behandlingsresultat: Source of A1 data
  • lovvalg: Lovvalgsperiode and articles
  • kodeverk: Land_iso2, Lovvalgbestemmelser enums

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

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".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

brev

무료

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

navikt의 스킬 모두 보기

이 스킬의 문제 신고