Schemas / Commerce

rig.commerce.stock

v1.0.0 · stable maturity: draft 4 fields 3 required

Fields

FieldTypeMeaning
product entity required The rig.commerce.product
place entity required Place that holds it
quantity float required Count on hand
unit enumeach · kilogram · metre · litre · other optional Optional. each / kilogram / metre / litre / other; absent = each

How many of a product sit at a place. Format when present.

This schema is the count - not rig.commerce.offer availability, and not a warehouse management system.

product, place, and quantity are required. Address and geo stay on the place entity. A second place is another entity. Do not copy in-stock onto the offer from this count.

JSON Schema

Resolves at https://rig.works/schemas/rig.commerce.stock.schema.json — raw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.commerce.stock.schema.json",
  "title": "rig.commerce.stock",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "product": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "place": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "quantity": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "unit": {
      "type": "string",
      "enum": [
        "each",
        "kilogram",
        "metre",
        "litre",
        "other"
      ]
    }
  },
  "required": [
    "product",
    "place",
    "quantity"
  ],
  "description": "Count of a product at a place. Not offer availability and not a warehouse engine.",
  "x-rig-maturity": "draft"
}

Seen in

record-shop.json