2.1 KiB
2.1 KiB
Data Model — Inventory Dependencies Graph (042)
Entities
InventoryItem
Existing entity (Spec 040).
Key fields used by this feature:
tenant_id(FK)external_id(string; stable identifier used as edge endpoint)policy_type(string)display_name(nullable string)meta_jsonb(array/jsonb; safe subset)
InventorySyncRun
Existing entity used for observability of sync operations.
Key fields used by this feature:
tenant_idselection_hashselection_payload(array)status(running/success/partial/failed/skipped)had_errors(bool)error_codes(array)error_context(array)
For MVP warnings persistence:
error_context.warnings[](array of warning objects)- Warning object shape (stable):
{type: 'unsupported_reference', policy_id, raw_ref, reason}
InventoryLink
Dependency edge storage.
Fields:
tenant_idsource_type(string; MVP usesinventory_item)source_id(string; storesInventoryItem.external_id)target_type(string;inventory_item|foundation_object|missing)target_id(nullable string; null when missing)relationship_type(string; values from RelationshipType enum)metadata(jsonb)- timestamps
Unique key (idempotency):
(tenant_id, source_type, source_id, target_type, target_id, relationship_type)
InventoryLink.metadata
Common keys:
last_known_name(nullable string)raw_ref(mixed/array; only when safe)
Required when target_type='foundation_object':
foundation_type(string enum-like):aad_group|scope_tag|device_category
Enums
RelationshipType
assigned_toscoped_bytargetsdepends_on
Relationships
- InventoryItem (source) has many outbound InventoryLinks via
source_id+tenant_id. - InventoryItem (target) has many inbound InventoryLinks via
target_id+tenant_idwheretarget_type='inventory_item'.
Constraints / Limits
- Query: limit-only, ordered by
created_at DESC. - UI: max 50 per direction (<=100 combined).
- Extraction: max 50 outbound edges per item; unknown shapes are warning-only.