Default a full-time year to 28 days of annual leave - #43
Merged
Conversation
25 was a placeholder. 28 is the full-time annual allowance, so it is the number a fresh instance should start from and the one the admin form should offer. The value is declared twice — once in the config lexicon, once as the admin form's field default — and AdminDeclarativeSettingsTest fails if the two disagree, so both move together, along with the settings tables in the README and the specification. The 25s left in the service tests are deliberate: they stub getDefaultEntitlement() to prove the code reads the configured value rather than a constant, and a stub that differs from the real default tests that more strongly, not less. Existing installations are unaffected: a lexicon default applies only to a key that was never set, and ensureEntitlement() consults it only when creating a row, so stored entitlements keep their current allowance. Moving current staff to 28 is a deliberate HR bulk-set, not a silent migration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
25 was a placeholder. 28 is the full-time annual allowance, so it is the number a fresh instance should start from and the one the admin form should offer.
What changed
The default is declared in two places, and
AdminDeclarativeSettingsTest::testFieldDefaultsMatchTheConfigLexicon()fails if they disagree — so both move together:lib/ConfigLexicon.phpKEY_DEFAULT_ENTITLEMENTdefault25.0→28.0lib/Settings/AdminDeclarativeSettings.php25.0→28.0tests/Unit/ConfigLexiconTest.php'28'SPECIFICATION.md,README.mdThe lexicon description now reads "(a full-time year)", since that is the distinction the number encodes.
What deliberately did not change
The remaining
25s in the service tests stay.testEnsureEntitlementForAnnualUsesConfiguredDefaultstubsgetDefaultEntitlement()to prove the code reads the configured value rather than a constant — a stub that differs from the real default tests that more strongly, not less. The others are arithmetic (30 − 5 − 0 = 25).Upgrade impact: none, by design
default_entitlementkeeps its value.ensureEntitlement()consults the default only when creating a row, so employees with a stored entitlement keep their current allowance.Moving existing staff to 28 is therefore a deliberate HR bulk-set (
POST /api/entitlements/bulk) for the year and the annual type — not a silent migration of everyone's balance.Testing
Full suite: 157 tests, 428 assertions, 0 failures.
php -lclean. No frontend rebuild — the value never appears insrc/.🤖 Generated with Claude Code