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

Change activity model and types #858

Closed elsand closed 2 months ago

elsand commented 3 months ago

Introduction

The activity model should be changed to reflect the new dialog aggregate version

Description

Some renames and validation changes should be performed on the dialog activity model. This includes using the model in #851 as performedBy, changing the valid types and chaning the validations

Implementation

The model should look something like this

{
    "createdAt": "2024-01-21T16:41:24.8475550", 
    "performedBy": {
        "actorType": "enduser",
        "actorName": "Ola Nordmann",
        "actorId": "urn:altinn:person:identifier-ephemeral:0676ad6bdf"
    },
    "type": "transmissionOpened",
    "transmissionId": "{{transmissionId-utsending-3}}"
}

Valid types should be:

The "description" (localizationtext) property should still be available, but only allowed (and required) if type is "information". The other types should not allow for a textual override, as the type itself should provide a non-ambiguous semantic.

See #851 for performedBy model.

### Tasks
- [ ] #851
- [x] Rename fields and fix relations
- [x] Update type values
- [x] Update validations
- [x] Prepare documentation (if relevant - either update working document, or add a new file in `docs`)
- [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 ...