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

Refactor #10

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Refactor #10

wants to merge 18 commits into from

Conversation

Eoli-an
Copy link

@Eoli-an Eoli-an commented Dec 17, 2024

Refactor: Improve Statement Logic and Introduce Configurable Play Types

Key Changes:

  • Removed the switch statement for play types and introduced the playTypes.json configuration file.
  • Created dedicated calculateAmount and calculateCredits functions using the new playTypes configuration.
  • Refactored to introduce a createStatementData function and use map and reduce for better immutability.
  • Improved Error handling with try...catch block.
  • Created a helper createFormatter function
  • Changed to use template literals
  • Updated index.js to use the new playTypes configuration

…dits functions; add tests for those functions
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.

1 participant