Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Invoice data",
  "type": "object",
  "required": [
    "items"
  ],
  "additionalProperties": false,
  "properties": {
    "items": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "type": "object",
        "required": [
          "name",
          "price",
          "unit",
          "quantity",
          "sum",
          "vat_mode"
        ],
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "minimum": 0
          },
          "unit": {
            "enum": [
              "piece",
              "service",
              "package",
              "g",
              "kg",
              "t",
              "ml",
              "l",
              "m3",
              "hr",
              "m",
              "km"
            ]
          },
          "quantity": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true
          },
          "sum": {
            "type": "number",
            "minimum": 0
          },
          "vat_mode": {
            "enum": ["none", "vat0", "vat10", "vat110", "vat18", "vat118", "vat20", "vat120"]
          },
          "vat_amount": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true
          },
          "discount_rate": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true
          },
          "discount_amount": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true
          }
        }
      }
    },
    "vat_total": {
      "type": "number",
      "minimum": 0,
      "exclusiveMinimum": true
    },
    "discount_total": {
      "type": "number",
      "minimum": 0,
      "exclusiveMinimum": true
    }
  }
}

...