{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://yardrunner.app/schema/inventory.schema.json",
  "title": "Yardrunner counter inventory row",
  "description": "Shape used by Wiz/JAS/Hi Way /console localStorage scans and CSV export. sku MUST equal lot/tag \u2014 do not invent catalog SKUs. hollanderInterchange is reserved until CSV\u2192DB import is wired. Marketplace DEMO should map this into listings; img is often a device dataURL and is only hostable when it is an https URL.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "id",
    "sku",
    "lot",
    "name",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Client-generated id, e.g. scan-<timestamp>"
    },
    "sku": {
      "type": "string",
      "description": "Same as lot/tag. Never invent."
    },
    "lot": {
      "type": "string",
      "description": "Lot / tag typed at the counter"
    },
    "name": {
      "type": "string",
      "description": "Part name (Field Scout item maps here)"
    },
    "cat": {
      "type": "string",
      "description": "Category"
    },
    "year": {
      "type": [
        "string",
        "number",
        "null"
      ]
    },
    "make": {
      "type": [
        "string",
        "null"
      ]
    },
    "model": {
      "type": [
        "string",
        "null"
      ]
    },
    "ymm": {
      "type": [
        "string",
        "null"
      ],
      "description": "Joined year make model"
    },
    "vin": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional 17-character VIN used to pull year/make/model for part matching",
      "pattern": "^[A-HJ-NPR-Z0-9]{17}$"
    },
    "condition": {
      "type": "string",
      "description": "Often tested|graded|asis"
    },
    "bin": {
      "type": [
        "string",
        "null"
      ],
      "description": "Bin location; required on Wiz/JAS phone trial"
    },
    "price": {
      "type": [
        "number",
        "null"
      ],
      "description": "Null/blank may mean Call"
    },
    "featured": {
      "type": "boolean"
    },
    "hidden": {
      "type": "boolean"
    },
    "img": {
      "type": [
        "string",
        "null"
      ],
      "description": "Photo dataURL or https URL"
    },
    "desc": {
      "type": [
        "string",
        "null"
      ]
    },
    "yard": {
      "type": "string",
      "description": "Human yard name on the row"
    },
    "notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "source": {
      "type": "string",
      "enum": [
        "counter",
        "demo",
        "shop",
        "csv",
        "fieldscout"
      ]
    },
    "hollanderInterchange": {
      "type": [
        "string",
        "null"
      ],
      "description": "Reserved \u2014 omit until Hollander import exists"
    }
  },
  "examples": [
    {
      "id": "scan-example",
      "sku": "4412",
      "lot": "4412",
      "name": "Alternator",
      "cat": "Electronics",
      "year": "2016",
      "make": "Honda",
      "model": "Civic",
      "ymm": "2016 Honda Civic",
      "vin": "1HGBH41JXMN109186",
      "condition": "graded",
      "bin": "A12",
      "price": 85,
      "featured": true,
      "hidden": false,
      "img": "",
      "desc": "Just listed from the yard.",
      "yard": "Wiz Auto Parts",
      "notes": "",
      "createdAt": "2026-09-09T07:00:00.000Z",
      "source": "counter"
    }
  ]
}
