feat: 增加规格匹配建议与决策审计 (#90)
This commit is contained in:
@@ -50,3 +50,15 @@ func UpsertSpecMapping(q Execer, m model.SpecMapping) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func InsertSpecMappingDecision(q Execer, d model.SpecMappingDecision) error {
|
||||
_, err := q.Exec(`INSERT INTO spec_mapping_decisions
|
||||
(shopee_goods_id,spec_key,pdd_goods_id,rules_version,suggested_option_key,
|
||||
chosen_option_key,accepted,decided_by,decided_at) VALUES (?,?,?,?,?,?,?,?,?)`,
|
||||
d.ShopeeGoodsID, d.SpecKey, d.PddGoodsID, d.RulesVersion, nullableText(d.SuggestedOptionKey),
|
||||
d.ChosenOptionKey, d.Accepted, nullableText(d.DecidedBy), d.DecidedAt)
|
||||
if err != nil {
|
||||
return fmt.Errorf("写入规格匹配决策审计失败: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user