feat(points): negative-balance policy (FEAT-7)#595
Merged
Conversation
New opt-in setting 'allow_negative_balance' (default off = current floor-at-zero behaviour). When on, penalties / point removals can take a child's spendable balance below zero instead of clamping at zero. - coord_points.async_remove_points gates the floor on the setting (read via _setting_enabled so bool or string both work). - Settings WS schema + allowlist accept the key. - Panel settings: new toggle in the points section. - i18n: panel.settings_allow_negative_label/_hint in all 8 locales. Tests: floors by default, allows negative when enabled. Verified live on ha-dev: with the policy on, over-deducting a 53-pt balance produced -5; default still floors at 0.
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.
FEAT-7 — negative-balance policy
New opt-in setting
allow_negative_balance(default off = current floor-at-zero behaviour). When enabled, penalties / point removals can take a child's spendable balance below zero instead of clamping at zero — useful for families who want penalties to "stick" as a debt.Changes
coord_points.async_remove_pointsgates the zero-floor on the setting (read via_setting_enabled, so a stored bool or"true"/"false"string both work)._SUBKEY_SETTINGSaccept the new key.panel.settings_allow_negative_label/_hintadded to all 8 panel locales.Testing
From AUDIT_REPORT.md §5 (FEAT-7).