{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://api.kamsoft.pl/schemas/canonical-eod/PostingInstruction.schema.json",
  "title": "PostingInstruction",
  "description": "Kanoniczny bufor dokumentu do procedowania w FK (dekretacja, ewidencja VAT, JPK). Jeden zasob dla wielu typow dokumentow, roznicowany przez pole type i profile walidacji.",
  "version": "2.0.0-draft",
  "type": "object",
  "required": [
    "issueDate",
    "symbol"
  ],
  "properties": {
    "identifier": {
      "type": "array",
      "items": {
        "$ref": "Identifier.schema.json"
      },
      "description": "Identyfikatory biznesowe i techniczne dokumentu z systemu zewnetrznego."
    },
    "participant": {
      "type": "array",
      "items": {
        "$ref": "Reference.schema.json"
      },
      "description": "Uczestnicy dokumentu jako referencje do PartyRole."
    },
    "attachment": {
      "type": "array",
      "items": {
        "$ref": "Attachment.schema.json"
      },
      "description": "Zalaczniki powiazane z dokumentem."
    },
    "issueDate": {
      "type": "string",
      "format": "date",
      "description": "Data wystawienia."
    },
    "realizationDate": {
      "type": "string",
      "format": "date",
      "description": "Data otrzymania / realizacji."
    },
    "symbol": {
      "$ref": "CodeableConcept.schema.json",
      "description": "Symbol typu dokumentu w systemie zewnetrznym (dawne symbolType)."
    },
    "paymentMethod": {
      "$ref": "CodeableConcept.schema.json"
    },
    "accountingVariant": {
      "$ref": "Reference.schema.json",
      "description": "Wariant dekretacji na naglowku."
    },
    "grossAmount": {
      "$ref": "Money.schema.json"
    },
    "netAmount": {
      "$ref": "Money.schema.json"
    },
    "vatAmount": {
      "$ref": "Money.schema.json"
    },
    "register": {
      "$ref": "Reference.schema.json",
      "description": "Rejestr FK."
    },
    "saleDate": {
      "type": "string",
      "format": "date-time",
      "description": "Data sprzedazy (dopuszczalne date/date-time)."
    },
    "dueDate": {
      "type": "string",
      "format": "date-time",
      "description": "Termin platnosci (dopuszczalne date/date-time)."
    },
    "accountingDate": {
      "type": "string",
      "format": "date-time",
      "description": "Data ksiegowania (dopuszczalne date/date-time)."
    },
    "paymentAccount": {
      "$ref": "Reference.schema.json",
      "description": "Rachunek platnosci."
    },
    "position": {
      "type": "array",
      "items": {
        "$ref": "PostingInstructionLine.schema.json"
      },
      "description": "Pozycje instrukcji (accounting-item, vat-summary)."
    }
  }
}