filter less than 3 dimensions
This commit is contained in:
@ -52,6 +52,22 @@ func FixupSizes(s GoodsItemSize) (GoodsItemSize, bool) {
|
||||
return s, true
|
||||
}
|
||||
|
||||
func (s GoodsItemSize) AllSizesSet() bool {
|
||||
var count int
|
||||
for _, d := range []Dimension{
|
||||
s.Width,
|
||||
s.Height,
|
||||
s.Length,
|
||||
s.UnmatchedDepth,
|
||||
} {
|
||||
if d.IsZero() {
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
return count >= 3
|
||||
}
|
||||
|
||||
func (s GoodsItemSize) GetSum(kind DimensionKind) float64 {
|
||||
var value float64
|
||||
sum := func(ds ...Dimension) {
|
||||
|
||||
Reference in New Issue
Block a user