Notifications for Trust banana
Description
Issue a bell notification (an e-mail would be too much) when you receive a new Trust banana. Right now there is no way to know you received one except for checking your profile.
Impact
According to the wiki, Trust bananas are an important part for the trust of foodsharing members. E.g. some activities are limited to people that have a certain amount of bananas. So people should be notified when they receive one.
In the rare case of problematic bananas being given, it's also good to quickly notice this so the appropriate action can be taken.
Proposal
Create a bell notification for new Trust bananas. A similar change, if you're looking for inspiration, was part of !1708 (merged).
How does the code work?
- Bananas are given by our REST api
- The endpoint needed for this (
Put("user/{userId}/banana"
) is defined insrc/Controller/UserRestController.php
- It is called through the Javascript function
trySendBanana
insrc/Modules/Profile/Profile.js
- This is executed when people submit the banana form
id="bouch-ta"
, defined insrc/Modules/Profile/ProfileView.php
- The form is still ugly old frontend code, you won't need to touch it
😅
What needs to be changed?
- define structure for the bell (identifier, icon, content)
- introduce or use an appropriate Transaction to generate a bell for receiving user
- call the Transaction from the REST endpoint once that has succeeded
- any questions? chat with @ChrisOelmueller
Edited by Chris Oelmueller