Kaizen
Browse modulesRulesrules/sharedTypes

Type Alias: Scope

type Scope = z.infer<typeof Scope>;

Defined in: shared/rules/types/rules.ts:18

A scope targets a rule to a slice of contexts. scope_value is a list. The entry matches if the context's value for scope_type matches any listed value (OR within an entry). Multiple scope entries on a rule are AND-combined by matchScopes, so [{ venue_id: [v1, v2] }, { facility_id: [f1] }] reads as "(venue is v1 or v2) AND (facility is f1)".

An empty scope_value ([]) matches nothing at runtime. It is not a wildcard. A rule that should apply everywhere uses an empty scopes array instead.