-
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: maintenance calculations #134
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
411ed3f
to
d69b480
Compare
b86060f
to
720accd
Compare
app/models/ForecastParameters.ts
Outdated
* @param maintenancePercentage - Maintenance spend value from form ("0.015" | "0.02" | "0.0375") | ||
* @returns ForecastParameters with updated maintenance cost | ||
*/ | ||
export function createForecastParameters(maintenancePercentage: string): ForecastParameters { |
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.
I think there's probably scope to simplify a fair few things in this PR by making sure that maintenancePercentage
(and MAINTENANCE_LEVELS
) are numbers at all times.
Even if it's a string value in the input, we can use Zod to refine it to a number for submission, and then keep it as a number going forward in out codebase.
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.
Ah great catch, I think I've just pushed a fix for this now.
9694e58
to
532dc3a
Compare
2c38fcf
to
18fc750
Compare
to overwrite DEFAULT_FORECAST_PARAMETERS with user input
532dc3a
to
19b6eb8
Compare
for ForecastParameters file
This PR uses #130 as base (that handles the UI, this handles the calculations).
What does this PR do?
maintenanceSpend
tomaintenancePercentage
for claritymaintenancePercentage
to relevant schemas and testscreateForecastParameters()
to overwriteDEFAULT_FORECAST_PARAMETERS
with user input maintenance spend percentageCloses #133.