Harden pricelist formation and document architecture decisions
This commit is contained in:
@@ -274,7 +274,7 @@ func TestWeightedMedianFallbackToMedianWhenNoWeights(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildWarehousePricelistItems_UsesPrefixResolver(t *testing.T) {
|
||||
func TestBuildWarehousePricelistItems_UsesPrefixResolverAndWeightedAverage(t *testing.T) {
|
||||
db := openTestDB(t)
|
||||
if err := db.AutoMigrate(&models.StockLog{}, &models.Lot{}, &models.LotPartnumber{}); err != nil {
|
||||
t.Fatalf("automigrate: %v", err)
|
||||
@@ -306,8 +306,8 @@ func TestBuildWarehousePricelistItems_UsesPrefixResolver(t *testing.T) {
|
||||
if items[0].LotName != "CPU_A" {
|
||||
t.Fatalf("expected lot CPU_A, got %s", items[0].LotName)
|
||||
}
|
||||
if items[0].Price != 100 {
|
||||
t.Fatalf("expected weighted median 100, got %v", items[0].Price)
|
||||
if items[0].Price != 105 {
|
||||
t.Fatalf("expected weighted average 105, got %v", items[0].Price)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user