Skip to content

Add notification category to Notification model and implement attribute change tracking watcher - #1663

Merged
YoshihitoAso merged 4 commits into
dev-25.9from
feature/#1662
Jul 31, 2025
Merged

Add notification category to Notification model and implement attribute change tracking watcher#1663
YoshihitoAso merged 4 commits into
dev-25.9from
feature/#1662

Conversation

@purplesmoke05

Copy link
Copy Markdown
Member

📌 Description

This pull request introduces a new notification_category field 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 the transferable attribute of contracts.

✅ Related Issues

🔄 Changes

Database Schema Enhancements:

  • Added a new notification_category field to the Notification model to classify notifications as either "event_log" or "attribute_change" (app/model/db/notification.py).
  • Introduced the NotificationAttributeValue model to store synchronized attribute values for notifications (app/model/db/notification.py).
  • Updated the NotificationType enum to include new types for attribute change notifications (app/model/db/notification.py) [1] [2].

API Updates:

  • Added notification_category as a query parameter in the list_all_notifications API to enable filtering by category (app/api/routers/notification.py) [1] [2].
  • Updated the NotificationsQuery and Notification schemas to include the notification_category field (app/model/schema/notification.py) [1] [2].

Batch Processor Modifications:

  • Updated batch processors (processor_Notifications_Coupon_Exchange.py, processor_Notifications_Membership_Exchange.py, processor_Notifications_Token.py) to set the notification_category field to "event_log" when creating notifications [1] [2] [3].

Codebase Simplifications:

  • Renamed Watcher to EventWatcher in processor_Notifications_Token.py for clarity and consistency (batch/processor_Notifications_Token.py).
  • Improved imports by grouping related modules and adding missing dependencies (batch/processor_Notifications_Token.py) [1] [2].

📌 Checklist

  • I have added tests where necessary.
  • I have updated the documentation where necessary.

@github-actions

github-actions Bot commented Jul 31, 2025

Copy link
Copy Markdown

@purplesmoke05
purplesmoke05 marked this pull request as ready for review July 31, 2025 07:19
@YoshihitoAso
YoshihitoAso requested a review from Copilot July 31, 2025 08:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WatchTransferableAttribute watcher 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_account variable 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_account variable is removed. Ensure this variable wasn't referenced in other parts of the test class.
    issuer = eth_account["issuer"]

Comment thread tests/batch/processor_Notifications_Token_test.py Outdated
YoshihitoAso and others added 2 commits July 31, 2025 17:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@YoshihitoAso
YoshihitoAso merged commit c79b0c3 into dev-25.9 Jul 31, 2025
11 checks passed
@YoshihitoAso
YoshihitoAso deleted the feature/#1662 branch July 31, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add notification triggers for contract attribute changes

3 participants