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>
This commit is contained in:
parent
a6be57e964
commit
722f961387
5 changed files with 35 additions and 90 deletions
10
variants.js
10
variants.js
|
|
@ -4,7 +4,9 @@
|
|||
* Loaded after holidays.js and before calculator.js.
|
||||
*/
|
||||
|
||||
// Will be implemented in subsequent tasks.
|
||||
const RATE_NORMAL = 250;
|
||||
const RATE_WEEKEND = 450;
|
||||
|
||||
function classify(date, holidayProvider) {
|
||||
const wd = date.getDay(); // 0=So, 1=Mo, ..., 5=Fr, 6=Sa
|
||||
|
||||
|
|
@ -34,8 +36,6 @@ function classifyDuties(duties, holidayProvider) {
|
|||
}
|
||||
|
||||
function variant1(classified, isVacation) {
|
||||
const RATE_NORMAL = 250;
|
||||
const RATE_WEEKEND = 450;
|
||||
const frSoThreshold = isVacation ? 0.5 : 1;
|
||||
const weekdayThreshold = isVacation ? 1.5 : 3;
|
||||
const frSoDeduction = isVacation ? 0.5 : 1;
|
||||
|
|
@ -89,8 +89,6 @@ function variant1(classified, isVacation) {
|
|||
}
|
||||
|
||||
function variant2(classified, isVacation) {
|
||||
const RATE_NORMAL = 250;
|
||||
const RATE_WEEKEND = 450;
|
||||
const saThreshold = isVacation ? 0.5 : 1;
|
||||
const weekdayThreshold = isVacation ? 1 : 2;
|
||||
const saDeduction = isVacation ? 0.5 : 1;
|
||||
|
|
@ -135,8 +133,6 @@ function variant2(classified, isVacation) {
|
|||
}
|
||||
|
||||
function variant3(classified, isVacation) {
|
||||
const RATE_NORMAL = 250;
|
||||
const RATE_WEEKEND = 450;
|
||||
const poolThreshold = isVacation ? 1 : 2;
|
||||
const totalDeduction = isVacation ? 1 : 2;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue