| title | Territory |
|---|---|
| description | Territory protocol schemas |
{/*
Territory Management Protocol
Defines a matrix reporting structure that exists parallel to the
business-unit hierarchy (ADR-0090 D3 — the org tree is sys_business_unit).
USE CASE:
-
Enterprise Sales Teams (Geo-based: "EMEA", "APAC")
-
Industry Verticals (Industry-based: "Healthcare", "Financial")
-
Strategic Accounts (Account-based: "Strategic Accounts")
DIFFERENCE FROM THE BUSINESS-UNIT TREE:
-
Business unit: Hierarchy of PEOPLE (org structure). Stable. HR-driven.
-
Territory: Hierarchy of ACCOUNTS/REVENUE (Who owns which market). Flexible. Sales-driven.
-
One User can be assigned to MANY Territories (Matrix).
-
One User belongs to one primary business unit (Tree).
import { Territory, TerritoryModel, TerritoryType } from '@objectstack/spec/security';
import type { Territory, TerritoryModel, TerritoryType } from '@objectstack/spec/security';
// Validate data
const result = Territory.parse(data);| Property | Type | Required | Description |
|---|---|---|---|
| name | string |
✅ | Territory unique name (lowercase snake_case) |
| label | string |
✅ | Territory Label (e.g. "West Coast") |
| modelId | string |
✅ | Belongs to which Territory Model |
| parent | string |
optional | Parent Territory |
| type | Enum<'geography' | 'industry' | 'named_account' | 'product_line'> |
✅ | |
| assignmentRule | string |
optional | Criteria based assignment rule |
| assignedUsers | string[] |
optional | |
| accountAccess | Enum<'read' | 'edit'> |
✅ | |
| opportunityAccess | Enum<'read' | 'edit'> |
✅ | |
| caseAccess | Enum<'read' | 'edit'> |
✅ |
| Property | Type | Required | Description |
|---|---|---|---|
| name | string |
✅ | Model Name (e.g. FY24 Planning) |
| state | Enum<'planning' | 'active' | 'archived'> |
✅ | |
| startDate | string |
optional | |
| endDate | string |
optional |
geographyindustrynamed_accountproduct_line