feat(profile): persist a player's display decimal places - #224
Open
damianrzepka wants to merge 1 commit into
Open
damianrzepka wants to merge 1 commit into
damianrzepka wants to merge 1 commit into
Conversation
Adds a nullable player.display_decimal_places (0-18, checked in the database) returned as decimalPlaces on the display-currency read and set through PUT /profile/display-decimal-places. The write and its audit record commit in one transaction with the row locked, so a racing pick audits the value it actually replaced. null clears the pick. The value is presentation only and never rounds a stored or submitted amount.
damianrzepka
requested review from
jakubfilinger-b,
klaudia-blazyczek-blurify,
marek-chmielowski-blurify,
mp-blurify,
okapitula and
zaxovaiko
as code owners
September 25, 2026 12:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BF-629. Adds a per-player display decimal places preference to the profile module: a nullable
player.display_decimal_places(0-18, enforced by a database CHECK), returned asdecimalPlacesonGET/PUT /profile/display-currencyand set through the newPUT /profile/display-decimal-places({ decimalPlaces: number | null },nullclears the pick). React:useSetDisplayDecimalPlacesfrom@openora/core/pam/react, which invalidatesuseDisplayCurrency.Why
A consumer's "wallet decimal places" preference had no backing field, so it had no effect and did not survive a reload. The preference now lives on the account next to
displayCurrency, so it follows the player across devices and ships in the display-currency read the balance header already loads, with no extra request.The write and its audit record (
player.display_decimal_places.set, before/after) commit in one transaction with the player row locked before the previous value is read, so two racing picks each audit the value they actually replaced.Alternatives considered
Risks
decimalPlacesis a new field onDisplayCurrencyInfo; existing readers are unaffected. A consumer that buildsDisplayCurrencyInfoliterals (fixtures, mocks) needs to adddecimalPlaces: nullto typecheck.0006adds a nullable column and a CHECK constraint; existing rows stayNULLand satisfy it.馃 Generated with Claude Code