Skip to content

feat: add 7-day free trial before paid stream billing - #67

Merged
elizabetheonoja-art merged 2 commits into
SubStream-Protocol:mainfrom
ScriptedBro:feature/7-day-free-trial-tier
Mar 24, 2026
Merged

feat: add 7-day free trial before paid stream billing#67
elizabetheonoja-art merged 2 commits into
SubStream-Protocol:mainfrom
ScriptedBro:feature/7-day-free-trial-tier

Conversation

@ScriptedBro

Copy link
Copy Markdown
Contributor

Summary

This PR adds a 7-day free trial window for streams. During the trial period, no charges accrue; after the trial ends, collection resumes at the configured paid rate.

What Changed

  • Added a Tier struct with:
    • rate_per_second
    • trial_duration
  • Updated Stream to store tier instead of a raw rate_per_second.
  • Set default trial duration to 7 days on new subscriptions.
  • Updated claim/collect logic to ignore elapsed time inside the trial period.
  • Kept existing stream and group-channel flows compatible with the new tier model.
  • Updated migrate_tier to read/write stream.tier.rate_per_second.
  • Added and updated tests to validate:
    • no charges during trial
    • charges start after trial ends
    • existing flows (cancel/top-up/group/pause/tier migration) still behave correctly with trial-aware timing
  • Updated README with the 7-day free trial behavior.

Why

This supports growth and onboarding by allowing creators to offer a free week before paid streaming begins.

Validation

  • Ran cargo test
  • Result: 11 passed, 0 failed

Checklist

  • Added trial_duration to Tier
  • Modified claim logic to ignore time delta during trial period
  • Added/updated tests for free trial and regression coverage
  • Updated README documentation

Issue

Closes #4
Closes: #4

@drips-wave

drips-wave Bot commented Mar 24, 2026

Copy link
Copy Markdown

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

@elizabetheonoja-art
elizabetheonoja-art merged commit 2192ed9 into SubStream-Protocol:main Mar 24, 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.

#4 Issue: [Feature] Free Trial Period

2 participants