Add notification category to Notification model and implement attribute change tracking watcher - #1663
Merged
Conversation
purplesmoke05
marked this pull request as draft
July 31, 2025 04:26
purplesmoke05
force-pushed
the
feature/#1662
branch
from
July 31, 2025 04:29
9aa6878 to
06cbb02
Compare
purplesmoke05
marked this pull request as ready for review
July 31, 2025 07:19
…te change tracking watcher
purplesmoke05
force-pushed
the
feature/#1662
branch
from
July 31, 2025 08:22
06cbb02 to
77a7f7c
Compare
YoshihitoAso
approved these changes
Jul 31, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new notification_category field to classify notifications by type ("event_log" or "attribute_change"), along with implementing a Watcher to monitor changes to the transferable attribute of contracts. It includes comprehensive database schema updates, API enhancements, and batch processor modifications to support this functionality.
- Added notification categorization system to differentiate between event-based and attribute-change notifications
- Implemented new
WatchTransferableAttributewatcher to track changes in token transferability - Updated all existing notification creation points to set appropriate category values
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| migrations/versions/a5e395bf46a9_v25_9_0_feature_1662.py | Database migration adding notification_category field and NotificationAttributeValue table |
| app/model/db/notification.py | Added notification_category field, NotificationAttributeValue model, and new notification types |
| app/model/schema/notification.py | Updated API schemas to include notification_category field |
| app/api/routers/notification.py | Added notification_category query parameter to notifications API |
| batch/processor_Notifications_Token.py | Renamed Watcher to EventWatcher, added WatchTransferableAttribute class, updated all notification creation to include category |
| batch/processor_Notifications_Coupon_Exchange.py | Updated notification creation to set notification_category = "event_log" |
| batch/processor_Notifications_Membership_Exchange.py | Updated notification creation to set notification_category = "event_log" |
| tests/* | Updated all test files to include notification_category assertions and test data |
| docs/ibet_wallet_api.yaml | Updated API documentation to include notification_category field |
Comments suppressed due to low confidence (2)
tests/batch/processor_Notifications_Token_test.py:2332
- The
lock_accountvariable is removed but was not used in the original code. This removal is correct but consider verifying that this variable wasn't referenced elsewhere in the codebase.
issuer = eth_account["issuer"]
tests/batch/processor_Notifications_Token_test.py:2729
- Similar to the previous instance, the
lock_accountvariable is removed. Ensure this variable wasn't referenced in other parts of the test class.
issuer = eth_account["issuer"]
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tifications_Token_test.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📌 Description
This pull request introduces a new
notification_categoryfield to classify notifications by type, along with updates to the database schema, API, and batch processors to support this functionality. Additionally, it implements a Watcher to monitor changes to thetransferableattribute of contracts.✅ Related Issues
🔄 Changes
Database Schema Enhancements:
notification_categoryfield to theNotificationmodel to classify notifications as either "event_log" or "attribute_change" (app/model/db/notification.py).NotificationAttributeValuemodel to store synchronized attribute values for notifications (app/model/db/notification.py).NotificationTypeenum to include new types for attribute change notifications (app/model/db/notification.py) [1] [2].API Updates:
notification_categoryas a query parameter in thelist_all_notificationsAPI to enable filtering by category (app/api/routers/notification.py) [1] [2].NotificationsQueryandNotificationschemas to include thenotification_categoryfield (app/model/schema/notification.py) [1] [2].Batch Processor Modifications:
processor_Notifications_Coupon_Exchange.py,processor_Notifications_Membership_Exchange.py,processor_Notifications_Token.py) to set thenotification_categoryfield to "event_log" when creating notifications [1] [2] [3].Codebase Simplifications:
WatchertoEventWatcherinprocessor_Notifications_Token.pyfor clarity and consistency (batch/processor_Notifications_Token.py).batch/processor_Notifications_Token.py) [1] [2].📌 Checklist