Skip to main content
Version: 12.10.0

WIP: Notification Service API

The Notification Service api stores consent corresponding to user, creates and saves message, send all waiting message to external provider.

There are two scenarios for using the Notification service:

  1. Entering/query of consents The user wants to give his consent for at least one module (e.g. for the PensionCompass in german VorsorgeKompass). For this the MicroService is called with the parameters UserID, DeviceID and ModuleName. The MS enters this combination into the database. If another user has already given a consent on the same device (regardless of which module), an error is thrown because a unique key is in the device column in the Database. So only one user per device can activate the push messages. To keep it simple, the first user wins and there is no way to manage it.

  2. Sending push messages In the first step, push messages are sent only from the backend. Each module of NAVIDA that uses a backend can send push messages to the MS PushNotification. For example, the backend PensionCompass has a cron job that checks every night if users have birthdays and therefore new examinations are possible for them. If a user is found, the MS PensionCompass sends to the MS PushNotification via API an object with UserID, ModuleName, Message and scheduled sending time. The MS PushNotification checks on the basis of the UserID whether a device is registered for this user and whether this device has a valid consent for the module. If so, the MS PushNotification stores the message and sends it to WonderPush at the scheduled time.

Database schema (ER diagram)

Process diagram

REST endpoints

DescriptionHTTP METHODHEADERURL(for root /api/v1)PAYLOADRESPONSE (SUCCESS)RESPONSE (ERROR)
Create messagePOST/pushnotification/user/UserID/notificationObject<Message>Object<Message> (with updated messageID)Object<Error>
Send all waiting messagesGETWITHOUT BEARER TOKENprivate/pushnotification/cronjob/sendwaitingmessages200 OKnone
Cleanup wonderpushGETWITHOUT BEARER TOKENprivate/pushnotification/cronjob/cleanup-wonderpush200 OKnone

Class Diagram

Error handling

    Error {
"statusCode": <ERROR CODE>,
"message":String
}
CaseHTTP CodeError CodeError Message
No user consent existing in DB404102Consent for User ID: < UserID > Not Found
Authentification error401
No message with MessageID existing for User with UserID in DB404104Message with ID: < MessageID > Not Found for User with ID: < UserID >
No messages existing for User with UserID in DB404105Messages Not Found for User with ID: < UserID >
No device content existing in DB404106Consent for Device ID: < DeviceID > Not Found
No module exists with this name404107Module name does not exists
An other user is registered with same device already409108An other user is registered with same device: < DeviceID >

Flow diagram Notification service