TorbatYar/docs/reference/policy-targets.md
2026-07-28 20:39:10 +03:30

62 lines
1.8 KiB
Markdown

# Policy Targets
> Binding contracts for [policy-engine-contracts.md](policy-engine-contracts.md).
> Contract version: `policy-targets.v1`
---
## 1. PolicyTargetBinding
| Field | Type | Meaning |
| --- | --- | --- |
| `target_kind` | string | Open — see §2 |
| `target_id` | uuid? | Universal ID when known |
| `target_code` | string? | Stable code when ID not yet assigned |
| `match` | enum | `exact` \| `any` \| `pattern` |
| `pattern` | string? | When `match=pattern` |
---
## 2. Target kinds (open)
| target_kind | Meaning |
| --- | --- |
| `product` | PlatformProduct |
| `bundle` | Business Bundle |
| `capability` | Capability |
| `subscription` | Subscription / plan |
| `license` | SubscriptionLicense / license |
| `tenant` | Tenant |
| `workspace` | Workspace |
| `business_type` | Business type catalog code |
| `country` | Country code |
| `region` | Region code |
| `industry` | Industry tag |
| `automation` | Automation type or pack |
| `asset` | Asset |
| `metadata` | Metadata bag / attribute path |
| `extension` | Extension |
| `pricing_item` | Pricing catalog item |
| *(future)* | Any new commercial object type |
---
## 3. Examples
| Policy | Targets |
| --- | --- |
| Trial eligibility | `business_type`, `country`, `product` |
| Regional sellability | `region`, `bundle` |
| Capability access | `capability`, `license`, `tenant` |
| Marketplace listing | `asset`, `product` |
| Quota SMS | `capability=sms`, `subscription` |
| Feature visibility | `product`, `workspace` |
---
## 4. Invariants
1. Target kinds are an open string registry.
2. Policies MAY target multiple kinds in one definition.
3. Future object types require **only** new target_kind values — not Core architecture redesign.