Fix product performance grouped JSON build
This commit is contained in:
@@ -6282,8 +6282,8 @@ func productPerformanceProductScore(suffix string, salesUSD, salesIndex, margin,
|
||||
score := 0.30*productPerformanceMarginComponentScore(margin) +
|
||||
0.20*productPerformanceRatioScore(stockTurnover, productPerformanceStockTurnoverTarget(suffix)) +
|
||||
0.20*revenueScore +
|
||||
0.15*productPerformanceRatioScore(marketCount, 8) +
|
||||
0.15*productPerformanceRatioScore(customerCount, 25)
|
||||
0.15*productPerformanceRatioScore(marketCount, productPerformanceMarketSpreadTarget(suffix)) +
|
||||
0.15*productPerformanceRatioScore(customerCount, productPerformanceCustomerSpreadTarget(suffix))
|
||||
return productPerformanceRoundScore(score)
|
||||
}
|
||||
|
||||
@@ -6291,6 +6291,32 @@ func productPerformanceStockTurnoverTarget(suffix string) float64 {
|
||||
return 4
|
||||
}
|
||||
|
||||
func productPerformanceMarketSpreadTarget(suffix string) float64 {
|
||||
switch suffix {
|
||||
case "90d":
|
||||
return 3
|
||||
case "180d":
|
||||
return 5
|
||||
case "365d":
|
||||
return 6
|
||||
default:
|
||||
return 8
|
||||
}
|
||||
}
|
||||
|
||||
func productPerformanceCustomerSpreadTarget(suffix string) float64 {
|
||||
switch suffix {
|
||||
case "90d":
|
||||
return 8
|
||||
case "180d":
|
||||
return 15
|
||||
case "365d":
|
||||
return 18
|
||||
default:
|
||||
return 25
|
||||
}
|
||||
}
|
||||
|
||||
func productPerformanceCustomerScore(suffix string, salesUSD, margin, productGroupCount, salesQty float64) float64 {
|
||||
if salesUSD <= 0 {
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user