Skip to content

feat(#375): emit SubscriptionCancelled event on subscription cancella…#468

Merged
Abd-Standard merged 2 commits into
Core-Foundry:mainfrom
Rayhab2000:feature/375-emit-event-on-subscription-cancellation
Jul 26, 2026
Merged

feat(#375): emit SubscriptionCancelled event on subscription cancella…#468
Abd-Standard merged 2 commits into
Core-Foundry:mainfrom
Rayhab2000:feature/375-emit-event-on-subscription-cancellation

Conversation

@Rayhab2000

Copy link
Copy Markdown
Contributor

…tion

  • Add SubscriptionCancelled contractevent struct to base/events.rs Topics: group_id, subscriber, category (Group), priority (Medium)
    Data: cancelled_at (ledger timestamp)

  • Add cancel_subscription() to autoshare_logic.rs Validates: auth, paused, group exists, caller is creator/member, group is currently active. Deactivates group and zeroes usage count.

  • Expose cancel_subscription() as a public contract method in lib.rs under the Subscription Management section.

  • Add subscription_cancellation_test.rs with 8 tests covering: event emission, topic shape, cancelled_at data, group deactivation, non-member rejection, double-cancel rejection, paused-contract rejection, member (non-creator) cancellation, unknown-group panic.

Closes #375

…ion cancellation

- Add SubscriptionCancelled contractevent struct to base/events.rs
  Topics: group_id, subscriber, category (Group), priority (Medium)
  Data:   cancelled_at (ledger timestamp)

- Add cancel_subscription() to autoshare_logic.rs
  Validates: auth, paused, group exists, caller is creator/member,
  group is currently active. Deactivates group and zeroes usage count.

- Expose cancel_subscription() as a public contract method in lib.rs
  under the Subscription Management section.

- Add subscription_cancellation_test.rs with 8 tests covering:
  event emission, topic shape, cancelled_at data, group deactivation,
  non-member rejection, double-cancel rejection, paused-contract
  rejection, member (non-creator) cancellation, unknown-group panic.

Closes Core-Foundry#375
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@Rayhab2000 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

@Abd-Standard
Abd-Standard merged commit 589b05b into Core-Foundry:main Jul 26, 2026
1 check failed
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.

Emit Event on Subscription Cancellation

2 participants