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

Shipping fee to be a flat rate #694

Merged
merged 2 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions src/shippingservice/quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ func quoteByCountFloat(count int) float64 {
if count == 0 {
return 0
}
count64 := float64(count)
var p = 1 + (count64 * 0.2)
return count64 + math.Pow(3, p)
return 8.99
}
2 changes: 1 addition & 1 deletion src/shippingservice/shippingservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestGetQuote(t *testing.T) {
if err != nil {
t.Errorf("TestGetQuote (%v) failed", err)
}
if res.CostUsd.GetUnits() != 11 || res.CostUsd.GetNanos() != 220000000 {
if res.CostUsd.GetUnits() != 8 || res.CostUsd.GetNanos() != 990000000 {
t.Errorf("TestGetQuote: Quote value '%d.%d' does not match expected '%s'", res.CostUsd.GetUnits(), res.CostUsd.GetNanos(), "11.220000000")
xtineskim marked this conversation as resolved.
Show resolved Hide resolved
}
}
Expand Down