Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: daily stacked and spent sats notification #1756

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Soxasora
Copy link
Contributor

@Soxasora Soxasora commented Dec 22, 2024

Description

Daily stacked and spent sats summary addressing #1751

It features a brief summary of how much a user has stacked (including rewards) and spent in 24h.

Data is collected from the user_stats_days view following the America/Chicago timezone, if the record is still not available past the midnight for other timezones, the latest record available is pulled (2 day interval, limited to 1).

SN-worker triggers a push notification every midnight

The notification itself is clickable and links to the full Satistics page

Screenshots

Notification
image

Settings
image

Additional Context

#1750 will not conflict with this new type of notification, we would need to give it a filter category though!

Checklist

Are your changes backwards compatible? Please answer below:

It needs migrations to allow toggling and scheduler support but other than that these are only additions!

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

6, data collection happens unequivocally from user_stats_days, the notification also has a fallback to the previous one if newer data isn't available. Push notifications are not tested yet but follows the same design as the others, worker correctly starts and finish the job at midnight

For frontend changes: Tested on mobile, light and dark mode? Please answer below: The displayed notification follows the same design language as the others

Did you introduce any new environment variables? If so, call them out explicitly here: No

TODO:

  • push notification
  • cleanup
  • fix notification is not always available (timezone)
  • slimmer query
  • refactor DailyStats to SatSummary
  • settings toggle for daily stats
  • notification component
  • notification resolver

@Soxasora Soxasora marked this pull request as ready for review December 23, 2024 18:22
@Soxasora Soxasora marked this pull request as draft December 23, 2024 19:10
@Soxasora Soxasora marked this pull request as ready for review December 23, 2024 19:11
@Soxasora Soxasora marked this pull request as draft December 24, 2024 11:46
@Soxasora Soxasora marked this pull request as ready for review December 24, 2024 11:46
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

realized I didn't push this before, sorry

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.

1 participant