-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: update depreciation #147
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good to me @zz-hh-aa , great work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zz-hh-aa Really sorry for the holdup here! All looking good :)
27fffba
to
db7c2d9
Compare
What does this PR do?
constants.ts
componentBreakdownType
breaks each component down into the percentage of the house it makes up, how much of its original value it depreciates each year, and what percentage of yearly maintenance spend it accounts forhouseBreakdownType
is an object with a component breakdown object per-componentHOUSE_BREAKDOWN_PERCENTAGES
is exported as a constant for use incalculateDepreciatedBuildPrice()
Property.ts
calculateComponentValue()
method (separated this out for ease of testing)calculateDepreciatedBuildPrice()
HOUSE_BREAKDOWN_PERCENTAGES
and runscalculateComponentValue()
to calculate depreciated value per-componentProperty.test.ts
Tests now pass! I ended up opting for a different method where stuff gets calculated again in the test file. Felt a bit more meaningful than just passing the resultant number as the expected value.
Closes #154