Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(update Freibetraege for 2024) #1533

Merged
merged 12 commits into from
Dec 10, 2024
Merged

chore(update Freibetraege for 2024) #1533

merged 12 commits into from
Dec 10, 2024

Conversation

Spencer6497
Copy link
Contributor

This PR simplifies and updates the Freibetrag for PKH/BerH by simplifying the interfaces, converting magic strings into constants, and moving year-by-year Freibetraege logic to a map for easy updates.

  • simplify freibetrag interface(s)
  • update freibetraege for 2024, use year map for ease of updating, replace magic strings and update tests
  • update unit test to ensure fallback works, regardless of whatever the actual, current year is

Copy link
Contributor

@rbrtrfl rbrtrfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work on the functionality with the map! Just left two comments, but nothing blocking.

childrenBelow6Allowance: number;
};

export const BASE_ALLOWANCE = 572;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: when do you use SCREAMING_SNAKE_CASE and when camelCase for the constants?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCREAMING_SNAKE_CASE should be used for top-level or global constants, and camelCase should be used for scoped constants (imo, happy to entertain other paradigms :))

Copy link
Member

@chohner chohner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, to small remarks

app/domains/beratungshilfe/vorabcheck/freibetrag.ts Outdated Show resolved Hide resolved
app/domains/beratungshilfe/vorabcheck/freibetrag.ts Outdated Show resolved Hide resolved
@Spencer6497 Spencer6497 merged commit ccff44f into main Dec 10, 2024
21 checks passed
@Spencer6497 Spencer6497 deleted the freibetraege branch December 10, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants