Skip to content

Commit

Permalink
chore(concept): #521 include review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Rehm committed Jan 29, 2024
1 parent 010b587 commit cc8aee4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,42 @@
| Author | ds-crehm |
| Creation date | 24.01.2024 |
| Ticket Id | #521 https://github.com/eclipse-tractusx/traceability-foss/issues/521 |
| State | WIP |
| State | DRAFT |

# Table of Contents
1. [Overview](#overview)
2. [Summary](#summary)
3. [Problem Statement](#problem-statement)
4. [Requirements](#requirements)
5. [NFR](#nfr)
6. [Out of scope](#out-of-scope)
7. [Assumptions](#assumptions)
8. [Concept](#concept)
9. [Glossary](#glossary)
10. [References](#references)
11. [Additional Details](#additional-details)
3. [Requirements](#requirements)
4. [Assumptions](#assumptions)
5. [Concept](#concept)
6. [References](#references)

# Overview

After a notification is created and approved, relevant policies must be verified before it can be sent.
There are three possibilities:
1. The policy is valid (validUntil >= current DateTime) and the notification is permitted to be sent.
2. The policy is valid (validUntil >= current DateTime) but the notification is **not** permitted to be sent.
3. The policy is **not** valid (validUntil < current DateTime) and the notification is **not** permitted to be sent (policy details are not relevant in this case).
1. All constraints are fulfilled. The notification may be sent.
2. The policy is expired (validUntil DateTime < current DateTime). The notification is not permitted to be sent.
3. One or more policy-based constraints are not fulfilled. The notification is not permitted to be sent.

Policies are stored in the IRS. The IRS provides an API to fetch and verify policies.
Policies are stored in the IRS' policy store. The IRS provides a policy store API to create, fetch and verify policies.

# Summary

When the notification is not sent because of a permission issue or an invalid policy, the user must be notified properly.
If the notification may not be sent after the policy verification, the user must be notified properly.
The status of the notification must be updated accordingly.

# Problem Statement

# Requirements

- During policy check, throw separate Exceptions based on the type of failure.
- If policy is not valid -> UsagePolicyExpiredException
- If policy is valid but notification not permitted -> UsagePolicyPermissionException
- New quality investigation & alert status: "Failed"
- Notification set to this status, when it could not be sent due to the policy exceptions
- Pop-up informing the user of the exception
- Error text message informing the user of the exception
- Detailed status information stored in the message history of the notification
- User must be able to resend the notification

# NFR

# Out of scope

# Assumptions

- The message history can show the current notification status persistently and accurately (https://github.com/eclipse-tractusx/traceability-foss/issues/423)
Expand All @@ -66,9 +55,12 @@ Instead of only having one UsagePolicyException, there must be two different exc
- UsagePolicyPermissionException (thrown when permission validation fails; contains information from the IRS policy checker response)
- UsagePolicyExpiredException (thrown when policy validUntil DateTime < current DateTime)

When either of these is thrown, the notification will be set to the new status "Failed".
A message is stored in the message history, containing information about the exception.
When either of these is thrown, the notification will be set to the new status "Failed" and a message is stored in the message history, containing information about the exception.

New notification status flow:
![Notification-Status-Flow.png](Notification-Status-Flow.png)

Creating and sending notifications:
```mermaid
sequenceDiagram
participant TraceX
Expand Down Expand Up @@ -103,7 +95,7 @@ sequenceDiagram
### Frontend

After creating and approving the notification and one of the exceptions is thrown:
1. A pop-up must be shown to the user
1. An error text message must be shown to the user
2. The notification status must be changed to "Failed"
3. A new message must be created and shown in the message history including the error description

Expand All @@ -112,15 +104,6 @@ UsagePolicyPermissionException:
UsagePolicyExpiredException:
![UsagePolicyExpiredException-Mockup.png](UsagePolicyExpiredException-Mockup.png)

# Glossary

| Abbreviation | Name | Description |
|--------------|------|---------------|
| | | |
| | | |

# References

# Additional Details

Given the dynamic nature of ongoing development, there might be variations between the conceptualization and the current implementation. For the latest status, refer to the documentation.
- Current notification status flow: https://eclipse-tractusx.github.io/traceability-foss/docs/user/user-manual.html
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cc8aee4

Please sign in to comment.