GobiertoCommon::Trackable extension and User Notifications feature starting point #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Connects to #167.
What does this PR do?
This PR implements an extension library that allows any of the
Form
objects in the system to track changes on its managed resources. Those changes also produce events to be consumed through our pub/sub implementation.To cover a complete first iteration, the
GobiertoCommon::Trackable
extension is being integrated into theGobiertoAdmin::GobiertoBudgetConsultations::ConsultationForm
class so that we're producing events that are consumed by a custom Subscriber.It also adds the
User::Notification
implementation which is the first resource populated through events within thetrackable
namespace. The logic for building thoseUser::Notification
records based on User Subscriptions is abstracted in theUser::NotificationBuilder
service class.Some other details on the implementation can be found in the doc that comes with this PR: https://github.com/PopulateTools/gobierto-dev/blob/fb34ccd159c470238d3bc82fe0e0f2601f963a50/docs/trackable-extension.md
How should this be manually tested?
Since the
User::Notification
implementation is already there, a starting User notifications view can be reached at http:https://madrid.gobierto.dev/user/notifications. It is being populated through changes in theGobiertoBudgetConsultations::Consultation
model which the user is subscribed to (see #171).✏️ Known improvements
User::Notification
population process should be done asynchronously, in a background job.