feat(rotational): configurable deposit reminders before round deadline#97
Open
Ebenezer199914 wants to merge 1 commit into
Open
feat(rotational): configurable deposit reminders before round deadline#97Ebenezer199914 wants to merge 1 commit into
Ebenezer199914 wants to merge 1 commit into
Conversation
JointSave-org#93) - Add ReminderLeadTime DataKey to rotational contract - Add set_reminder_lead_time (admin-only) and reminder_lead_time (getter) - Add deposit_reminder_due view: true when within the lead-time window - Extend TTL for ReminderLeadTime in bump_config_state_internal - Add 7 unit tests covering default, set/get, auth guard, and all boundary conditions of deposit_reminder_due - Add email_on_reminder to NotificationPreferences (useUserProfile, useNotifications, supabase.ts types, notify-pool-event edge function) - Handle deposit_reminder activity_type in notify-pool-event with email + in-app notification delivery - Add useDepositReminder hook to check contract view and dispatch activity - Add DB migration: reminder_lead_time column on pools table - Fix pre-existing TS7006 implicit-any in useNotifications.ts
Contributor
|
@Ebenezer199914 kindly resolve conflict please |
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.
Summary
Closes #93
Adds configurable deposit reminders so members get notified before a rotational round's deposit deadline.
Changes
Smart Contract ()
truewhennow ≥ next_payout_time − lead_timeandnow < next_payout_timeand pool is activeTests (7 new cases in
tests.rs)deposit_reminder_duefalse when lead time is 0Frontend / Infra
useUserProfile.ts—email_on_reminder: booleanadded toNotificationPreferencesuseNotifications.ts— pre-existing TS7006 implicit-any fix (non-breaking)lib/supabase.ts—email_on_reminderadded touser_profilesJSONB type definitionsnotify-pool-event/index.ts— handlesdeposit_reminderactivity type; sends email + in-app notification to all members who haven't deposited; respectsemail_on_reminderopt-outhooks/useDepositReminder.ts— new hook; callsdeposit_reminder_duevia RPC simulation; insertspool_activityrow ontrueto trigger the webhookmigrations/20260623000000_add_reminder_lead_time.sql— adds nullablereminder_lead_time bigintcolumn topoolstableTesting
tsc --noEmitpasses with zero errorstests.rs+ 4 intest.rs(CI runscargo test)