Skip to content

Jk2756/SpinTheWheel#321

Open
jiminkim214 wants to merge 7 commits into
masterfrom
jk2756/spin
Open

Jk2756/SpinTheWheel#321
jiminkim214 wants to merge 7 commits into
masterfrom
jk2756/spin

Conversation

@jiminkim214
Copy link
Copy Markdown
Contributor

@jiminkim214 jiminkim214 commented May 4, 2026

Summary

This pull request adds a "Spin the Wheel" page. Players spin a prize wheel to win random wardrobe items instead of buying them with coins. Spins are gated by a cooldown timer: after spinning, the player must either wait 24 hours to spin the wheel again. This gives players an alternative path to unlocking wardrobe items and creates an incentive to complete journeys.

  • added backend spin eligibility logic with per-user last spin tracking and cooldown checks
  • implemented backend spin + availability gateway messages: award a random unowned wardrobe item, persist inventory/timestamp updates, and return current eligibility plus remaining cooldown.
  • built a new Flutter Spin the Wheel experience with an animated wheel populated by 8 wardrobe items
  • wired the SPIN action to animation + backend result, then show a win modal (You Won [ITEM NAME]!) with preview and an Equip Now action
  • added cooldown state UX by replacing SPIN button with remaining wait time

Remaining TODOs:

  • after “Equip Now” on the spin result: navigate the user to the Profile screen (for user to ensure the equipped item/wardrobe state is reflected there)

Test Plan

  • tested through simulator

Breaking Changes

  • database schema change

@dti-github-bot
Copy link
Copy Markdown
Member

dti-github-bot commented May 4, 2026

[diff-counting] Significant lines: 1077. This diff might be too big! Developer leads are invited to review the code.

ADD COLUMN "spinJourneyUnlockAt" TIMESTAMP(3);
-- AlterTable
ALTER TABLE "User"
ADD COLUMN IF NOT EXISTS "lastSpinAt" TIMESTAMP(3),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These two seem to just be uneeded "IF NOT EXISTS" duplicates of another

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread server/prisma/schema.prisma Outdated
eventRSVPs EventRSVP[]
feedbacks Feedback[]
lastSpinAt DateTime?
spinJourneyUnlockAt DateTime?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This doesn't seem to be used yet. Is this supposed to be how long it takes to be able to respin?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah these are leftover from when I had journey completion unlock the spin. Switched to daily spin instead and forgot to clean up the schema. I'll remove them!

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.

3 participants