Skip to content

Commit

Permalink
Tariff: add margins and uplifts (#16855)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Oct 27, 2024
1 parent 98d2dc5 commit 520d54b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tariff/embed.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package tariff

type embed struct {
Margin float64 `mapstructure:"margin"`
Charges float64 `mapstructure:"charges"`
Tax float64 `mapstructure:"tax"`
Uplifts float64 `mapstructure:"uplifts"`
}

func (t *embed) totalPrice(price float64) float64 {
return (price + t.Charges) * (1 + t.Tax)
return (price*(1+t.Margin)+t.Charges)*(1+t.Tax) + t.Uplifts
}

0 comments on commit 520d54b

Please sign in to comment.