{
  "step": "trait-validate",
  "tool": "object_registry",
  "input": {
    "action": "validate",
    "yaml": "trait:\n  name: Stockable\n  version: 1.0.0\n  description: How full a storage location is, counted in the unit the team stores goods in.\n  category: inventory\n  tags:\n    - inventory\n    - capacity\n\nparameters:\n  - name: capacityUnit\n    type: string\n    required: false\n    description: The unit capacity and stock are counted in.\n    default: pallets\n\nschema:\n  stock_level:\n    type: string\n    required: true\n    description: Whether the location has room, is nearly full, or is full.\n    validation:\n      enum:\n        - room_available\n        - nearly_full\n        - full\n  capacity_units:\n    type: integer\n    required: true\n    description: How many units the location holds when it is full.\n    examples:\n      - 1200\n      - 800\n      - 2400\n  units_on_hand:\n    type: integer\n    required: true\n    description: How many units are stored there now.\n    examples:\n      - 640\n      - 760\n      - 2400\n\nsemantics:\n  stock_level:\n    semantic_type: inventory.stock.level\n    token_mapping: tokenMap(inventory.stock.*)\n    ui_hints:\n      component: StatusBadge\n\nview_extensions:\n  list:\n    - component: StatusBadge\n      position: after\n      props:\n        statusField: stock_level\n        emphasis: subtle\n        showIcon: false\n  card:\n    - component: StatusBadge\n      position: after\n      props:\n        statusField: stock_level\n        emphasis: subtle\n        showIcon: false\n  detail:\n    - component: StatusBadge\n      position: main\n      priority: 70\n      props:\n        statusField: stock_level\n        emphasis: subtle\n        showIcon: false\n    # Like the shipped Supersedable trait: the fields the trait is about are placed explicitly, so the detail\n    # composer's field budget never leaves them out.\n    - component: Text\n      position: main\n      priority: 69\n      props:\n        field: units_on_hand\n    - component: Text\n      position: main\n      priority: 68\n      props:\n        field: capacity_units\n\ntokens:\n  inventory.stock.tone: neutral\n\ndependencies: []\n"
  },
  "isError": false,
  "error": null,
  "output": {
    "kind": "trait",
    "name": "Stockable",
    "valid": true,
    "errors": [],
    "warnings": [],
    "contexts": [
      "list",
      "card",
      "detail"
    ],
    "folder": "~/.oods-foundry/traits"
  }
}
