# Data Model — Tag Badge Catalog (Neutral, Suite-wide) v1

This feature is UI-only. It introduces no database schema changes.

## Entities (existing)

### Tenant
- **Role**: scope boundary for all queries and UI rendering.
- **Tag-like fields used**:
  - `environment` (for example: `prod|staging|dev|other`)
- **Status-like fields (explicitly out of scope)**:
  - `status` (`active|archived`) is status-like/lifecycle and is standardized separately.

### Policy
- **Role**: policy inventory and entry point for policy-related UI.
- **Tag-like fields used** (source may be top-level columns and/or `metadata`):
  - policy type
  - policy category
  - platform
- **Status-like fields (explicitly out of scope)**:
  - `ignored_at` is a boolean-like status signal (“ignored”) and is handled via centralized status-like semantics.

### PolicyVersion
- **Role**: immutable snapshots/versions of a policy.
- **Tag-like fields used** (from `metadata` and/or `snapshot`):
  - policy type
  - platform
  - snapshot type (for example: `full|incremental`)

### InventoryItem
- **Role**: “last observed” inventory record for an Intune object.
- **Tag-like fields used** (source may include `meta_jsonb`):
  - inventory type/category
  - platform

### BackupSet / BackupItem / BackupSchedule (selected)
- **Role**: backup metadata surfaces may display tag-like chips (schedule/frequency/type).
- **Tag-like fields used**: schedule/frequency/snapshot metadata where presented as chips (domain discovered during migration sweep).

## Entities (code-only)

### Tag badge domain
- **Role**: a named namespace for metadata tags that must render consistently (for example, “platform”, “policy category”, “tenant environment”).
- **Uniqueness**: domain name is unique within the application.

### Tag badge spec
- **Role**: the resolved UI meaning of a tag value (label + neutral color + optional icon).
- **Constraints**:
  - Must be pure (no DB queries, no HTTP, no side effects).
  - Color must be from the neutral allowlist: `gray|primary|info`.
  - Unknown values must render as “Other: <value>” (normalized).

## State transitions

This feature does not introduce new state machines. It standardizes how existing metadata values render as neutral tag badges.
