This commit is contained in:
2026-08-24 03:41:06 +02:00
parent a246ed8fe5
commit 8a690a0464
22 changed files with 1253 additions and 358 deletions
+7 -1
View File
@@ -1701,7 +1701,13 @@ func (p *Pipeline) processOne(ctx context.Context, companyID, jobID uuid.UUID, i
// Stick taxonomy unique_id onto mapped_data.category when still empty so the
// Products UI (reads mapped) and reprocess keep the AI/vector/mapped pick.
if cat := strings.TrimSpace(result.Category); cat != "" {
if _, err := tx.Exec(ctx, persistMappedCategorySQL, it.RawID, companyID, cat); err != nil {
// Record who chose it: a category this pipeline derived must not read back
// as the feed's own on the next run (see MappedCategorySourceKey).
catSource, _ := result.FieldSources["category"].(string)
if strings.TrimSpace(catSource) == "" {
catSource = "pipeline"
}
if _, err := tx.Exec(ctx, persistMappedCategorySQL, it.RawID, companyID, cat, catSource); err != nil {
return false, 0, result, fmt.Errorf("persist mapped category: %w", err)
}
}