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

Add validation to calculator inputs #2507

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/playground/src/utils/pricing_calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ export const mruRules = _applyRules([
required("Memory is required."),
isInt("Memory must be a valid integer."),
max("Maximum allowed memory is 1024 GB.", 1024),
min("Minimum allowed memory storage size is 1 GB.", 1),
]);

export const sruRules = _applyRules([
required("SSD Storage size is required."),
isInt("SSD Storage size must be a valid integer."),
max("Maximum allowed ssd storage size is 1000000 GB.", 1000000),
min("Minimum allowed ssd storage size is 1 GB.", 1),
]);

export const hruRules = _applyRules([
required("HDD Storage size is required."),
isInt("HDD Storage size must be a valid integer."),
max("Maximum allowed hdd storage size is 1000000 GB.", 1000000),
min("Minimum allowed hdd storage size is 0 GB.", 0),
Expand Down
Loading