feat(platform): add the notification inbox and deterministic match search

This commit is contained in:
shira committed 2026-10-09 13:14:46 +03:00
1 parent 5edff21d2d
commit 0b11021b16
169 files changed
+17083 -443

No files matched your search

+13
View File
@@ -93,6 +93,10 @@ type ProductPolicy struct {
// Support is absent only in immutable policy documents that predate the
// support section. New demo policies should set it explicitly.
Support *SupportPolicy
// Matching holds the coefficients of the deterministic basic matching. It
// is nil in policy versions that predate it; such a version cannot rank
// and never inherits another version's coefficients.
Matching *MatchingPolicy
}
// Validate checks every section. A zero value is never valid, so a section
@@ -114,6 +118,11 @@ func (policy ProductPolicy) Validate() error {
return fmt.Errorf("ProductPolicy.Validate - support section: %w: %w", ErrInvalidPolicy, err)
}
}
if policy.Matching != nil {
if err := policy.Matching.Validate(); err != nil {
return err
}
}
return nil
}
@@ -138,6 +147,10 @@ func (policy ProductPolicy) clone() ProductPolicy {
supportCopy := *support
copied.Support = &supportCopy
}
if matching := policy.Matching; matching != nil {
matchingCopy := matching.Clone()
copied.Matching = &matchingCopy
}
return copied
}