Skip to content

Conversation

@jjasonguo
Copy link
Contributor

@jjasonguo jjasonguo commented Dec 7, 2025

Summary

This is the backend of the build a bear feature

  • created Schema, DTO, Service, Gateway, Module based on existing patterns / design in the app
  • made preliminary e2e tests (in the works, will add more/modify along with more specific user interactions when i develop frontend next sem
  • NOTE: prisma migration has a lot more than my PR because of prisma version update (Temi and I think)

SCHEMA CHANGES

Remaining TODOs:

  • implement frontend

Test Plan

E2E TESTS INCLUDED

@dti-github-bot
Copy link
Member

[diff-counting] Significant lines: 798.

Copy link
Contributor

@jiminkim214 jiminkim214 left a comment

Choose a reason for hiding this comment

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

Great Work Jason! I noticed that in avatar.dto, the RequestUserInventoryDto and RequestUserBearLoadoutDto are empty. Remove them if unnecessary, or add a comment explaining their purpose. Other than that, everything looks awesome!

@3TTemi
Copy link
Collaborator

3TTemi commented Dec 8, 2025

Backend changes look good, good job on this PR.

But we should check out this one possible race condition in avatar service.
Line 109: if (balance < item.cost) checks the value in memory. Line 117: score: { decrement: item.cost } updates the DB.

The system checks the user's balance, and then separately deducts the cost. If a user clicks "Buy" very quickly twice, both clicks can pass the initial check and deduct the cost twice, resulting in a negative balance.

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.

5 participants