feat(09-04): compile switch, date-range, and scope filters

- Filters keep typed values and only registered scope names
- Raw conditions and arbitrary methods fail activation
- Request localization copies labels and leaves identifiers unchanged
This commit is contained in:
Jakub Zych
2026-09-24 18:53:52 +02:00
parent cb832eb70c
commit d3a93073c9
5 changed files with 417 additions and 6 deletions

View File

@@ -217,8 +217,11 @@ type RelationBeforeLink interface {
RelationBeforeLink(ctx context.Context, relation string, parent, related any, pivot map[string]any) error
}
// FilterScope is a model method referenced by a config_filter scope name.
// FilterScope is the model capability a config_filter scope name may call.
// FilterScopes is the exact, case-sensitive set of names; request text never
// selects a method outside that set.
type FilterScope interface {
FilterScopes() []string
FilterScope(name string, db *gorm.DB, value any) *gorm.DB
}