digdir / dialogporten

Dialogporten - common API and and metadata state store for digital dialogs
https://docs.altinn.studio/dialogporten
MIT License
1 stars 3 forks source link

Introduce "transmissions" #860

Closed elsand closed 3 months ago

elsand commented 5 months ago

Introduction

This is the main issue tracking the work associated with removing "dialog elements" and introducing "transmissions". See other related issues in the tracking epic (#836)

Description

See https://gist.github.com/elsand/ef205ad479b3377aea98506808d9a84f for a summary of all planned changes.

The transmissions entity will contain information about

Sender

Will use the same "actor" entity as defined in #851

Authorization Attribute

Like on dialog elements, a authorization attribute can be set, which will describe a authorization (sub)resource that the reader will have to have "read" (or "transmission-read" if subresource)

Type of transmission

Should indicate what kind of transmission this is, used for visualization purposes and potentially EUS logic. These should not be service specific (use extendedType for those). Preliminary list:

Type Description Sent by
Information For general information, not related to any submissions Service owner
Acceptance Feedback/receipt accepting a previous submission Service owner
Rejection Feedback/error message rejecting a previous submission Service owner
Request Question/request for more information Service owner
Alert Critical information about the process Service owner
Decision Information about a formal decision ("vedtak") Service owner
Submission A normal submission of some information/form User
Correction A submission correcting/overriding some previously submitted information User

Extended type

An optional service specific URI set by the service owner indicating to EUSs a specific subtype of this transmission. Not used in AF.

Content

The same content structure as used in dialogs, but limited to "Title" and "Summary".

Attachments

A list of attachments as described in #857

Related transmission

An optional other related transmission by id. This allows for building tree-like structures.

Implementation

Example:

{
            // Varsel om tvangsmulkt
            "id": "{{transmissionId-utsending-4}}",
            "type": "Critical",
            "extendedType": "urn:ske:varsel:tvangsmulkt",
            // Den innloggede brukeren har ikke tilgang til å lese dette (har ikke "read" på
            // "urn:altinn:resource:ske_tvangsmulkt" for denne organisasjonen), men får se metadata
            // Arbeidsflate vil vise dette grået ut el.l.
            "isAuthorized": false, 
            // knyttet til purring 
            "relatedtransmissionId": "{{transmissionId-utsending-3}}", 
            // overstyrt ressurs som legges til grunn for tilgangsstyring
            "authorizationAttribute": "urn:altinn:resource:ske_tvangsmulkt", 
            "createdAt": "2024-03-01T08:01:03.6301023",
            "sender": {
                "actorType": "serviceOwner"
            },
            "content": [
                { "type": "Title", "value": [ { "cultureCode": "nb_NO", "value": "Varsel om tvangsmulkt" } ] },
                { "type": "Summary", "value": [ { "cultureCode": "nb_NO", "value": "Korrigering ble ikke sendt innenfor frist." } ] }
            ],
            "attachments": [
                {
                    "displayName": [ { "value": "Varsel om tvangsmulkt", "cultureCode": "nb-no" } ],
                    "urls": [
                        { "consumerType": "Gui", "url": "https://someexternalsite.com/utsending-4-attachment-1.pdf", "mimeType": "application/pdf" },
                        { "consumerType": "Api", "url": "https://someexternalsite.com/utsending-4-attachment-1.json",  "mimeType": "application/json" }
                    ]
                }
            ]
        }
### Tasks
- [ ] #851
- [ ] #857
- [x] Change transmissions validations (content)
- [x] Add sender property
- [x] Add attachments property
- [x] Add transmissionType enum
- [x] Add extendedType
- [x] Add transmission endpoints
- [x] Implement auth
- [x] Update documentation
- [x] Add e2e-test (if relevant)
### Threat modelling
- [x] Does this change introduce any potential security issues?

Acceptance criteria

GIVEN ... WHEN .... THEN ...

GIVEN ... WHEN .... THEN ...

sigurof commented 4 months ago

Hei, Sigurd fra Born Digital-prosjektet her. Vår PoC-applikasjon bruker Dialogporten-API-et i tt02. Vil dere slippe endringene relatert til transmissions i én større deploy, eller vil dere deploye til testmiljøet etterhvert som oppgavene blir løst?

arealmaas commented 4 months ago

Blir deployed i testmiljøet etterhvert som oppgavene blir løst, og så kommer det en større update i tt02 etterhvert. Før vi slipper den vil vi si fra i #dialogporten-arbeidsflate-dev i Altinn. :)