Altinn / altinn-notifications

Altinn platform microservice for handling notifications (mail, sms, etc)
MIT License
2 stars 3 forks source link

Implement a condition client for checking send conditions #548

Closed acn-sbuad closed 2 months ago

acn-sbuad commented 3 months ago

Description

547 convers the epic of supporting send conditions in notifications. A part of this is to send requests to the provided send condition endpoint through an API client evaluate the send condition using the condition client before generating a notification (?) / before sending a notification

Client should use maskin porten with scope altinn:system/notifications.condition.check to authenticate towards the endpoints

Consideration

Specification

Maskinporten integration scope: altinn:system/notifications.condition.check integration name: notifications condition check

REST client and formats Client request format: GET to endpoint specified in order. Authorization header with bearer token (maskinporten token representing digdir with scope: altinn:system/notifications.condition.check)

Expected response format :SendConditionResponse

{
    "sendNotification" : true
}

Client should return a Result--object. Result<bool, clientError>. Client error object will need to be defined. And service can decide on how to handle the error.

ConditionClientError

{
    "resultCode": "",
    "errorMessage": ""
}

Tasks

Acceptance Criterias

elsand commented 3 months ago

We're tracking the work related to this in Dialogporten at https://github.com/digdir/dialogporten/issues/859