Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-06-23 17:37:54 +03:00
parent 0f9b7549ec
commit c2e2c6a295
2 changed files with 18 additions and 16 deletions

View File

@@ -565,18 +565,12 @@ func productSeriesRuleFitsGroup(group string, rule productSeriesAutoRule) bool {
if rule.GroupKey != "" && rule.GroupKey != group {
return false
}
groupSizes := map[string]struct{}{}
for _, size := range productSeriesSizeGroups[group] {
groupSizes[normalizeProductSeriesSize(size)] = struct{}{}
}
if len(groupSizes) == 0 {
return true
}
for size := range rule.Ratio {
if _, ok := groupSizes[size]; !ok {
return false
}
}
// NOTE: In this installation, Nebim ItemDim1Code (size_code) can be numeric tokens that do not match the
// hardcoded group size lists (e.g. "XS/S/M..."). Enforcing those lists causes valid rules to be rejected
// and series assignment to stay blank across many products.
//
// We therefore rely only on explicit rule.GroupKey when provided, and otherwise allow the rule to compete
// based on actual stock consumption.
return true
}