Skip to content

feat(contract): enforce notification category validation - #543

Open
iamtjbest wants to merge 5 commits into
Core-Foundry:mainfrom
iamtjbest:main
Open

feat(contract): enforce notification category validation#543
iamtjbest wants to merge 5 commits into
Core-Foundry:mainfrom
iamtjbest:main

Conversation

@iamtjbest

Copy link
Copy Markdown

This PR introduces the Notification Category Registry, allowing administrators to define and manage supported notification categories before they can be used in the system. It enforces these category rules across the notification scheduling ecosystem, ensuring only valid, pre-registered categories are utilized.

Changes Made
Category Validation Enforced: Integrated strict category registry checks into the core scheduling logic, specifically within create_autoshare, schedule_notification, and batch_schedule_notifications (autoshare_logic.rs).

Error Handling & Compilation Fix: Resolved severe compilation errors in errors.rs that were caused by overlapping enum values.

Event Emission: Updated events.rs to ensure the registry properly emits update events when categories are registered or modified.

Backward Compatibility: Implemented a mechanism to pre-seed default categories, ensuring that existing operations and legacy schedules do not break upon deployment.

Testing & Verification
Refactored and expanded category_registry_test.rs to cover the new registration logic fully.

Introduced a new System category variant specifically to facilitate robust testing.

Verified that duplicate category registrations are successfully rejected and that all associated events are properly emitted.

Confirmed that the test suite compiles and passes with the newly added validations.

To Test
Run the test suite locally to verify the registry logic and backward compatibility:

Bash
cargo test

Closes: #470

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@iamtjbest Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Implement Notification Category Registry

1 participant