Commit graph

10 commits

Author SHA1 Message Date
bb4e0d2bbb test(calc): Story 5.3/5.4 — variants.js node-testbar + Regressionstests (Juni-Faelle); Report-Splice als Paste-Artefakt verifiziert (kein Code-Bug) 2026-07-07 23:21:59 +02:00
4eed9d0c4c refactor(variants): extract shared ineligible/pay/deduct helpers
V1/V2/V3 duplicated the empty-result shape, the paid-shares/bonus math
and the Friday-priority deduction loop. Pull them into ineligibleResult,
payResult and deductInOrder; each variant keeps only its distinct
threshold, eligibility test and deduction slots.

paidShares is now computed uniformly as max(0, classified - deduction);
never-deducted slots carry deduction 0, so the result is byte-identical
(verified against a 13122-case golden master over the full input grid).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 11:47:57 +02:00
88cc0553f6 refactor(variants): drop unused isWinner flag on variant results
Each variant emitted isWinner:false and the calculator set winner.isWinner
=true, but the UI marks the winner via variantId===winnerId, never the
flag. Only one test read it. Removed from the 6 variant returns, the empty
result, and the calculator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 11:45:15 +02:00
722f961387 chore: cleanup dead code and duplicated logic from audit
- Remove broken webpack.yml (no package.json/webpack config exists)
- Drop dead RATE_NORMAL/RATE_WEEKEND fields on BonusCalculator; share the
  real rate constants across all three variants in variants.js
- Simplify getEmptyResult() to build allResults via .map instead of
  three manual spreads
- Replace 5 duplicated German month-name arrays and 2 weekday-name
  arrays in app.js with a shared monthName()/WEEKDAY_NAMES helper;
  drop the now-redundant getMonthName() method
- Reuse existing .modal/.modal-backdrop/.modal-content CSS classes in
  generateEmailReport() instead of hand-rolled inline styles
- Delegate ImageImporter.classify() to the shared classify() in
  variants.js instead of a duplicated copy
- Unify ad hoc YYYY-MM-DD formatting in app.js to use the existing
  HolidayProvider.formatDate() helper

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 19:23:14 +02:00
f7153a5e53 feat: implement variant2 (1 sa + 2 weekday) 2026-05-12 00:14:50 +02:00
591a2773cc feat: implement variant1 (1 fr+so + 3 weekday, fr-priority) 2026-05-12 00:14:21 +02:00
a675763206 feat: implement variant3 (loose, pool fr+sa+so, fr-priority) 2026-05-12 00:13:51 +02:00
c460a20c00 feat: implement classifyDuties() aggregation by slot 2026-05-12 00:13:16 +02:00
bfc20b8c4f feat: implement classify(date, holidayProvider) day-slot mapping 2026-05-12 00:12:55 +02:00
2877d0ae35 feat: add variants.js skeleton and wire into index.html + test.html 2026-05-12 00:12:22 +02:00