Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backend] Reject notifications to the own BPN #783

Assignees
Labels
backend Backend related issues frontend Frontend related Issues

Comments

@ds-crehm
Copy link
Contributor

ds-crehm commented Mar 22, 2024

As user,
I want that the application rejects notifications that I send to my own BPN,
so that I won't cause problems in the system.

Hints / Details

When a user sends a notification that is adressed to his own BPN, the system must reject that notification. Otherwise the database will have problems with this scenario and might break.

Acceptance Criteria

  • When receiving a notification, Trace-X must verify if the BPN is different than the BPN of the currently running instance.
  • If the BPN is identical, the notification must be rejected with the error 'Bad Request'
  • validate that it doesnt work in FE to use own BPN

Out of Scope

-Error Message enrichment will be provided in #787

@ds-crehm ds-crehm added this to Trace-X Mar 22, 2024
@ds-crehm ds-crehm moved this to backlog in Trace-X Mar 22, 2024
@ds-crehm ds-crehm moved this from backlog to inbox in Trace-X Mar 22, 2024
@ds-crehm ds-crehm added the backend Backend related issues label Mar 22, 2024
@ds-mmaul ds-mmaul added the frontend Frontend related Issues label Apr 16, 2024
@ds-mmaul ds-mmaul moved this from inbox to backlog in Trace-X Apr 16, 2024
@ds-mwesener ds-mwesener moved this from backlog to next in Trace-X Apr 16, 2024
@ds-mwesener ds-mwesener changed the title Reject notifications to the own BPN [Backend] Reject notifications to the own BPN Apr 16, 2024
@ds-mmaul ds-mmaul moved this from next to backlog in Trace-X Apr 16, 2024
@ds-mmaul ds-mmaul moved this from backlog to next in Trace-X Apr 30, 2024
@ds-mwesener ds-mwesener moved this from next to wip in Trace-X Apr 30, 2024
@ds-mwesener ds-mwesener self-assigned this Apr 30, 2024
@ds-mwesener ds-mwesener moved this from wip to test in Trace-X May 7, 2024
@ds-mwesener ds-mwesener assigned ds-crehm and unassigned ds-mwesener May 7, 2024
@ds-crehm
Copy link
Contributor Author

ds-crehm commented May 8, 2024

Frontend implementation works on E2E-A:
grafik
Alert can not be created with own BPN.

Does not work on E2E-B. When typing BPNL00000003CNKC there, it's not rejected. The notification can be created. After approving it, an error is thrown "Alert failed to send, please try again."

In the backend directly, I can create notification with the own BPN as receiver. After approving them, I receive the error 503:
grafik
And in the notification, following error is saved:
grafik

The request response and the error message are not very descriptive. Please check if that can be improved, as it was part of the acceptance criteria to handle it as 400 Bad request.

(If the frontend verification works correctly, the error message is not as important, as the user should never have the possibility to create such a notification in the first place.)

@ds-crehm
Copy link
Contributor Author

ds-crehm commented May 8, 2024

Works properly now for E2E-B as well. (Rejected when choosing own BPN)

Now the backend also throws a 400 Bad request with a proper error message:
grafik

Verification is implemented for creating and editing notifications. Both processes were tested and work as expected.

Ready for review.

@ds-crehm ds-crehm reopened this May 8, 2024
@ds-crehm ds-crehm assigned mkanal and unassigned ds-crehm May 8, 2024
@ds-crehm ds-crehm moved this from test to review in Trace-X May 8, 2024
@mkanal mkanal moved this from review to done in Trace-X May 13, 2024
@mkanal mkanal assigned ds-mwesener and unassigned mkanal May 13, 2024
@mkanal
Copy link
Contributor

mkanal commented May 13, 2024

PO acceptance in behalf of @jzbmw. Works as intended.

@mkanal mkanal closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment