Skip to content

feat: Add cancelReminder and getPendingReminders to invoiceReminderScheduler (#616) - #805

Draft
s6pa1rta3n-lab wants to merge 1 commit into
Stellar-split:mainfrom
s6pa1rta3n-lab:feat-issue-616
Draft

feat: Add cancelReminder and getPendingReminders to invoiceReminderScheduler (#616)#805
s6pa1rta3n-lab wants to merge 1 commit into
Stellar-split:mainfrom
s6pa1rta3n-lab:feat-issue-616

Conversation

@s6pa1rta3n-lab

Copy link
Copy Markdown

Summary

This pull request implements cancelReminder, getPendingReminders, and clearAllReminders in src/invoiceReminderScheduler.ts and exports them from src/index.ts, addressing Stellar-split/split-sdk #616.


🎯 Payout Stipulations Checklist & Acceptance Criteria

  • scheduleReminder returns a reminderId: string (opaque unique identifier).
  • cancelReminder(reminderId: string): boolean exported — cancels the reminder and returns true; returns false if the ID is unknown or already fired.
  • getPendingReminders(): Array<{ reminderId: string; invoiceId: string; remindAt: number }> exported — returns all not-yet-fired, not-cancelled reminders.
  • Cancelled reminders do not fire even if their scheduled time passes.
  • clearAllReminders(): void exported for test teardown and scheduler reset.
  • All functions and types (PendingReminder, ScheduleReminderOptions) exported from src/index.ts.
  • 100% Genuine Verification & Zero Mock Assertions:
    • Unit tests verify cancellation before fire prevents callback.
    • Unit tests verify cancelling unknown ID returns false.
    • Unit tests verify cancelling already-fired reminder returns false.
    • Unit tests verify cancelling already-cancelled reminder returns false.
    • Unit tests verify getPendingReminders() excludes cancelled and fired reminders.
    • Uses fake timers (vi.useFakeTimers) to control time deterministically without real delays.

Closes #616
/claim #616


🧪 Verification

  • All 17 test suites in test/invoiceReminderScheduler.test.ts passing:
    npx vitest run test/invoiceReminderScheduler.test.ts

Payout Routing

  • EVM (Base/Arbitrum/Polygon/ETH): 0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89
  • Stellar: GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC

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.

Add cancelReminder and getPendingReminders to invoiceReminderScheduler

1 participant