This commit is contained in:
2026-08-16 23:07:32 +02:00
parent 389608ea56
commit 6e77154228
14 changed files with 1189 additions and 21 deletions
+9 -1
View File
@@ -1564,7 +1564,8 @@ func (p *Pipeline) processOne(ctx context.Context, companyID, jobID uuid.UUID, i
engine = &Engine{Vector: NoopVectorCategorizer{}}
}
policy := cache.stepPolicy()
result, err := engine.RunSteps(ctx, companyID.String(), in, processingType, nil, policy)
catNames := categoryUniqueIDsList(categoryNamesByUID)
result, err := engine.RunSteps(ctx, companyID.String(), in, processingType, catNames, policy)
if err != nil {
return false, 0, StepResult{}, err
}
@@ -1644,6 +1645,13 @@ func (p *Pipeline) processOne(ctx context.Context, companyID, jobID uuid.UUID, i
WHERE id = $1 AND company_id = $2`, it.RawID, companyID); err != nil {
return false, 0, result, err
}
// 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 {
return false, 0, result, fmt.Errorf("persist mapped category: %w", err)
}
}
if err := tx.Commit(ctx); err != nil {
return false, 0, result, err
}