✨: LIB-538 Refactor + add Dafalgan support #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notes
wiki.mdfile in the project to keep the documentation in the same place than my project. But I would recommend using Github's wiki feature if possible. I didn't use it here to avoid creating a second project.nodein production (and notts-node!)Drug.benefitbecause the exercises specifies that the public API should not be changed and I wanted to add the check for benefit value (setBenefitmethod as it is more explicit to me but it was not possible here. I'd love to hear what you think about that setter.Process
babelwithtypescriptstraight away so I could use it for my tests (although the tests should have been the second thing to do after documentation to ensure no regressions).Drugclass as to me, theDrug(model) must be aware of its own logic, not thePharmacy(controller).Drugbased on a name. If theDrugclass is not abstract, it is possible to create anew Drug('Fervex', 30, 20)that will behave as aDruginstance despite the name'Fervex'passed to the constructor. The developper should use theFervexclass so its instance has the overridden method ofupdateValues()corresponding to Fervex's logic.Dafalganrules.Dafalgansupport.I did not add the Dafalgan to the
index.tsas it is not required by the instructions and it would modify theoutput.txt.Time Management
In total, I spent around 4 hours on the tests:
Many Thanks! 🎉
If you're reading this, it means you took time to review my PR properly so... Thanks a lot!
I never had a refactoring project as a technical test, I think it's a great idea and this one was fun to tackle.
I would be really glad to hear your feedbacks regarding my work, whether it's a full review here or a call.
I would also love to know how you would have done it, if you have any advice regarding anything (code, patterns, tests, tools, git practices...), I am always eager to further improve.