{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://api.kamsoft.pl/schemas/canonical-eod/LedgerEntry.schema.json",
  "title": "LedgerEntry",
  "description": "LedgerEntry – pojedynczy zapis księgowy (linia w ogólnika). Rozszerza DomainResource.",
  "version": "1.0.0",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "meta": {
      "$ref": "Meta.schema.json"
    },
    "identifier": {
      "type": "array",
      "items": {
        "$ref": "Identifier.schema.json"
      }
    },
    "ledger": {
      "$ref": "Reference.schema.json"
    },
    "account": {
      "$ref": "Reference.schema.json"
    },
    "postingDate": {
      "type": "string",
      "format": "date",
      "description": "Data zaksięgowania"
    },
    "documentDate": {
      "type": "string",
      "format": "date",
      "description": "Data dokumentu źródłowego"
    },
    "documentNumber": {
      "type": "string",
      "description": "Numer dokumentu źródłowego"
    },
    "description": {
      "type": "string",
      "description": "Opis zapisu"
    },
    "debitAmount": {
      "$ref": "Money.schema.json"
    },
    "creditAmount": {
      "$ref": "Money.schema.json"
    },
    "currency": {
      "$ref": "CodeableConcept.schema.json"
    },
    "journal": {
      "$ref": "CodeableConcept.schema.json"
    },
    "relatedDocument": {
      "$ref": "Reference.schema.json"
    },
    "status": {
      "$ref": "CodeableConcept.schema.json"
    },
    "reversingEntry": {
      "$ref": "Reference.schema.json"
    },
    "attachment": {
      "type": "array",
      "items": {
        "$ref": "Attachment.schema.json"
      }
    },
    "extension": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Rozszerzenia (DomainResource pattern)"
    }
  }
}