Add article generation and pricelist categories

This commit is contained in:
Mikhail Chusavitin committed 2026-02-11 19:16:01 +03:00
1 parent 99fd80bca7
commit 5edffe822b
32 files changed
+1953 -323

No files matched your search

+1 -5
View File
@@ -238,11 +238,7 @@ func (r *PricelistRepository) GetItems(pricelistID uint, offset, limit int, sear
if err := r.db.Where("lot_name = ?", items[i].LotName).First(&lot).Error; err == nil {
items[i].LotDescription = lot.LotDescription
}
// Parse category from lot_name (e.g., "CPU_AMD_9654" -> "CPU")
parts := strings.SplitN(items[i].LotName, "_", 2)
if len(parts) >= 1 {
items[i].Category = parts[0]
}
items[i].Category = strings.TrimSpace(items[i].LotCategory)
}
if err := r.enrichItemsWithStock(items); err != nil {