{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vetdatastandards.com/schemas/v0.1/product.schema.json",
  "title": "Product",
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "practiceId", "name", "source"],
  "properties": {
    "id": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/id" },
    "source": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/source" },
    "matchKeys": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/matchKeys" },
    "createdAt": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/dateTime" },
    "updatedAt": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/dateTime" },
    "deletedAt": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/dateTime" },
    "active": { "type": "boolean" },
    "extensions": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/extensions" },
    "practiceId": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/id" },
    "name": { "type": "string", "minLength": 1, "maxLength": 255 },
    "code": { "type": "string", "minLength": 1, "maxLength": 64 },
    "description": { "type": "string", "maxLength": 4096 },
    "unit": { "type": "string", "minLength": 1, "maxLength": 32 },
    "unitPrice": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/money" },
    "taxPercent": { "$ref": "https://vetdatastandards.com/schemas/v0.1/common.schema.json#/$defs/taxPercent" },
    "priceIncludesTax": { "type": "boolean" },
    "manufacturer": { "type": "string", "minLength": 1, "maxLength": 255 },
    "controlled": {
      "type": "boolean",
      "description": "True when the source marks the product as a controlled medicine. Register workflow is out of v0.1."
    }
  }
}
