This commit is contained in:
2026-08-16 18:18:39 +02:00
parent b19373e2a4
commit d981147ff2
18 changed files with 20707 additions and 20497 deletions
+9
View File
@@ -358,6 +358,15 @@ func cloneCompanyCatalog(ctx context.Context, pool *pgxpool.Pool, src, dest uuid
}
add("raw_products", ct.RowsAffected())
var mappedWithCat int64
if err := tx.QueryRow(ctx, `
SELECT COUNT(*) FROM raw_products
WHERE company_id = $1
AND COALESCE(NULLIF(trim(mapped_data->>'category'), ''), '') <> ''`, dest).Scan(&mappedWithCat); err != nil {
return nil, fmt.Errorf("count mapped categories: %w", err)
}
add("mapped_with_category", mappedWithCat)
ct, err = tx.Exec(ctx, `
INSERT INTO processed_products (
id, company_id, user_id, product_id, name, category, description, processed_description,