{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/item_master/v1.json",
  "title": "item_master contract v1",
  "type": "object",
  "required": [
    "base_unit_of_measure",
    "currency",
    "item_no",
    "sell_price"
  ],
  "properties": {
    "active": {
      "type": "boolean",
      "description": "false when the item is blocked or retired in the ERP",
      "x-demiton-requiredness": "optional"
    },
    "item_no": {
      "type": "string",
      "description": "the item's number in the ERP; the same key as `purchase_line.item_reference`",
      "x-demiton-requiredness": "required",
      "x-demiton-reference": true
    },
    "on_hand": {
      "type": "number",
      "description": "the quantity in stock, in `base_unit_of_measure`",
      "x-demiton-requiredness": "optional"
    },
    "currency": {
      "type": "currency",
      "description": "the currency of every amount on this record (`standard_cost`, `book_cost`, `last_direct_cost`, `sell_price`), an ISO 4217 alpha-3 code. A record with no currency has no usable amount.",
      "x-demiton-requiredness": "required"
    },
    "supplier": {
      "type": "string",
      "description": "the usual supplier",
      "x-demiton-requiredness": "optional",
      "x-demiton-reference": true
    },
    "book_cost": {
      "type": "number",
      "description": "the unit cost the stock on hand is carried at",
      "x-demiton-requiredness": "optional"
    },
    "tax_basis": {
      "type": "string",
      "description": "whether the amounts on this record include GST or VAT",
      "enum": [
        "excl_gst",
        "incl_gst"
      ],
      "x-demiton-requiredness": "optional"
    },
    "sell_price": {
      "type": "number",
      "description": "the unit price the contractor charges when it supplies the item",
      "x-demiton-requiredness": "required"
    },
    "description": {
      "type": "string",
      "description": "the item as the ERP describes it",
      "x-demiton-requiredness": "optional"
    },
    "standard_cost": {
      "type": "number",
      "description": "the standard unit cost, when `costing_method` is `standard`",
      "x-demiton-requiredness": "optional"
    },
    "costing_method": {
      "type": "string",
      "description": "how the ERP values the item's stock",
      "enum": [
        "fifo",
        "lifo",
        "moving_average",
        "standard",
        "specific"
      ],
      "x-demiton-requiredness": "optional"
    },
    "index_series_key": {
      "type": "string",
      "description": "the platform_rate series that ages this item's last purchase price",
      "x-demiton-requiredness": "optional"
    },
    "last_direct_cost": {
      "type": "number",
      "description": "the unit cost of the item's most recent purchase, as the ERP records it",
      "x-demiton-requiredness": "optional"
    },
    "target_margin_pct": {
      "type": "number",
      "description": "the margin on the sell price the contractor targets, 0 to 100. No default: absent means the target is not set.",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "percent"
    },
    "last_direct_cost_on": {
      "type": "string",
      "description": "the date of that purchase",
      "x-demiton-requiredness": "optional",
      "format": "date",
      "x-demiton-type": "date"
    },
    "base_unit_of_measure": {
      "type": "string",
      "description": "the unit every quantity and price on this record is per",
      "x-demiton-requiredness": "required"
    }
  },
  "x-demiton-register-type": "item_master",
  "x-demiton-contract-version": "1.0.0",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [],
  "x-demiton-measures": [],
  "x-demiton-provenance": {
    "standards": []
  },
  "description": "The Item master register contract, version 1. JSON Schema (draft 2020-12); x-demiton-* keywords carry Demiton's own meaning and standard validators ignore them.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/item_master/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}