This commit is contained in:
2026-08-23 20:49:40 +02:00
parent 3b678ca857
commit f3d4fb56ed
31 changed files with 3608 additions and 111 deletions
+8
View File
@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"log"
"strings"
"github.com/descrybe/descrybe-v2/apps/api/internal/company"
@@ -167,6 +168,13 @@ func (s *Service) CreateCategory(ctx context.Context, companyID uuid.UUID, name,
if err != nil {
return nil, err
}
// New categories start with the platform-default formula so enhance produces
// formula-shaped copy instead of generic paragraphs. Non-fatal: a category
// without a stored formula still falls back to the default at enhance time.
if err := ApplyDefaultCategoryFormulas(ctx, s.Pool, companyID,
DefaultFormulaTarget{ID: id, UniqueID: uniqueID, Name: name}); err != nil {
log.Printf("catalog: default formulas company=%s category=%s err=%v", companyID, id, err)
}
return s.GetCategory(ctx, companyID, id)
}