Skip to content

feat: add daily login rewards calendar (#462) - #491

Merged
Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
ifygreg01-best:feat/daily-login-rewards-calendar-462
Oct 22, 2026
Merged

Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
ifygreg01-best:feat/daily-login-rewards-calendar-462

Conversation

@ifygreg01-best

@ifygreg01-best ifygreg01-best commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
  • Add LoginRewardCalendar entity (configurable cycle length, resetOnMissDays, JSONB rewardDays array)
  • Add PlayerLoginRewardClaim entity with unique (userId, calendarDate) constraint to enforce one claim per calendar day
  • Add PlayerLoginStreak entity to track each player's cycle position and last claim date
  • Implement DailyLoginRewardsService with:
    • Timezone-safe day boundaries via Intl.DateTimeFormat
    • Idempotent claimDailyReward (returns alreadyClaimed on duplicate)
    • Configurable missed-day detection and cycle reset logic
    • Calendar CRUD (create, update, list)
    • getStatus and getClaimHistory endpoints
  • Add DailyLoginRewardsController with JWT-protected player routes
  • Register DailyLoginRewardsModule in AppModule
  • 29 unit tests: all passing, lint clean, zero TS errors

Closes #462

What does this PR do?

Why?

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing behavior to change)
  • Refactor (no behavior change)
  • Docs / CI / tooling

How was it tested?

  • Unit tests added/updated
  • E2E test added/updated
  • Manual verification steps below

Checklist

  • npm run lint passes
  • npm run format:check passes (run npm run format if not)
  • npm run typecheck passes
  • npm test passes
  • I added/updated tests for the change
  • I updated relevant docs (README, JSDoc, comments)
  • I added a changeset / migration if schema changed
  • I read CONTRIBUTING.md

Screenshots / Logs

Risk & rollout

- Add LoginRewardCalendar entity (configurable cycle length,
  resetOnMissDays, JSONB rewardDays array)
- Add PlayerLoginRewardClaim entity with unique (userId, calendarDate)
  constraint to enforce one claim per calendar day
- Add PlayerLoginStreak entity to track each player's cycle position
  and last claim date
- Implement DailyLoginRewardsService with:
  - Timezone-safe day boundaries via Intl.DateTimeFormat
  - Idempotent claimDailyReward (returns alreadyClaimed on duplicate)
  - Configurable missed-day detection and cycle reset logic
  - Calendar CRUD (create, update, list)
  - getStatus and getClaimHistory endpoints
- Add DailyLoginRewardsController with JWT-protected player routes
- Register DailyLoginRewardsModule in AppModule
- 29 unit tests: all passing, lint clean, zero TS errors

Closes MindFlowInteractive#462
@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@ifygreg01-best 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

@Mkalbani
Mkalbani merged commit 550067e into MindFlowInteractive:main Oct 22, 2026
@grantfox-oss grantfox-oss Bot mentioned this pull request Oct 22, 2026
6 tasks
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.

Daily Login Rewards Calendar

2 participants