Skip to content

Conversation

@groe-dennis
Copy link

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