fix
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user