Skip to content

Default a full-time year to 28 days of annual leave - #43

Merged
karlitschek merged 1 commit into
mainfrom
feat/noid/default-entitlement-28-days
Aug 12, 2026
Merged

Default a full-time year to 28 days of annual leave#43
karlitschek merged 1 commit into
mainfrom
feat/noid/default-entitlement-28-days

Conversation

@karlitschek

Copy link
Copy Markdown
Member

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:

File Change
lib/ConfigLexicon.php KEY_DEFAULT_ENTITLEMENT default 25.028.0
lib/Settings/AdminDeclarativeSettings.php admin form field default 25.028.0
tests/Unit/ConfigLexiconTest.php asserts '28'
SPECIFICATION.md, README.md settings tables

The 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. testEnsureEntitlementForAnnualUsesConfiguredDefault stubs getDefaultEntitlement() 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

  • A lexicon default applies only to a key that was never set. An instance that explicitly configured default_entitlement keeps 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 -l clean. No frontend rebuild — the value never appears in src/.

🤖 Generated with Claude Code

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>
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Aug 12, 2026
@karlitschek
karlitschek merged commit ba74c98 into main Aug 12, 2026
30 of 33 checks passed
@karlitschek
karlitschek deleted the feat/noid/default-entitlement-28-days branch August 12, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants