Altinn / altinn-notifications

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

Add logic for generating notifications based on organisation number #456

Closed SandGrainOne closed 3 months ago

SandGrainOne commented 6 months ago

Description

Add logic to the service logic of notification to support recipient of type organisation number. Use the services already implemented and rewire the logic to include contact information lookup of both official and personal contact information. Make sure the notifications are stored with identified contact information.

Tasks

Acceptance criteria

acn-sbuad commented 4 months ago

testing in AT22. Looking at the notification details for a sent order, I believe orgNo should be included in the recipient field. For service owner to know which org the email address and sent email is linked to.

    "notifications": [
        {
            "id": "68758e07-05b6-490b-b065-89f231000e75",
            "succeeded": false,
            "recipient": {
                "emailAddress": "4tw8bgez@jei5wp6wx.no"
            },
            "sendStatus": {
                "status": "New",
                "description": "The email has been created, but has not been picked up for processing yet.",
                "lastUpdate": "2024-05-07T15:37:02.193146Z"
            }
        }
    ]
SandGrainOne commented 3 months ago

Testing sending in the future with missing contact information at the send time: OrderId: "152ce64b-fdcf-4d82-bf78-d2e74faac88e" RequestedSendTime: "2024-05-28T14:30:00+02:00" Organization: 312508729

Manually deleted the contact information after placing the order. Send time a little bit more than 1 hour into the future when placing the order. Placing a new order fails because of missing contact information.

Test result: Success

SandGrainOne commented 3 months ago

AT24

Something weird with order: 5b3c624f-a868-4e51-8d5f-928179669155

{{BasePath}}{{PortNumber}}/notifications/api/v1/orders/{{NotificationOrderId}}/status Reports succeeded: 0 while {{BasePath}}{{PortNumber}}/notifications/api/v1/orders/{{NotificationOrderId}}/notifications/email Reports succeeded: 1 This would be the expected number. Why is it different?

SandGrainOne commented 3 months ago

Testing completed