{
  "resourceType": "StructureDefinition",
  "url": "https://api-erp.kamsoft.pl/ns/StructureDefinition/Payment",
  "name": "Payment",
  "version": "1.0.0",
  "title": "Płatność (Payment)",
  "description": "Zasób kanoniczny FK — płatność z kwotą, stronami, kontami i powiązaniem z dokumentem źródłowym.",
  "kind": "resource",
  "abstract": false,
  "type": "Payment",
  "baseDefinition": "https://api-erp.kamsoft.pl/ns/StructureDefinition/DomainResource",
  "snapshot": {
    "element": [
      {
        "path": "Payment.identifier",
        "min": 0,
        "max": "*",
        "short": "Identyfikatory płatności",
        "type": [
          {
            "code": "Identifier[]"
          }
        ]
      },
      {
        "path": "Payment.date",
        "min": 0,
        "max": "1",
        "short": "Data operacji płatności",
        "type": [
          {
            "code": "String"
          }
        ]
      },
      {
        "path": "Payment.party",
        "min": 0,
        "max": "*",
        "short": "Strony",
        "definition": "Uczestnicy płatności (Reference do Party / PartyRole).",
        "type": [
          {
            "code": "Reference[]"
          }
        ]
      },
      {
        "path": "Payment.amount",
        "min": 0,
        "max": "1",
        "short": "Kwota",
        "type": [
          {
            "code": "Money"
          }
        ]
      },
      {
        "path": "Payment.paymentMethod",
        "min": 0,
        "max": "1",
        "short": "Sposób zapłaty",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "valueSet": "https://api-erp.kamsoft.pl/ns/payment-method"
        }
      },
      {
        "path": "Payment.paymentAccount",
        "min": 0,
        "max": "1",
        "short": "Rachunek płatnika",
        "type": [
          {
            "code": "Reference"
          }
        ]
      },
      {
        "path": "Payment.recipientAccount",
        "min": 0,
        "max": "1",
        "short": "Rachunek odbiorcy",
        "type": [
          {
            "code": "Reference"
          }
        ]
      },
      {
        "path": "Payment.sourceDocument",
        "min": 0,
        "max": "*",
        "short": "Dokumenty źródłowe",
        "definition": "np. faktura (Reference do Document / Invoice).",
        "type": [
          {
            "code": "Reference[]"
          }
        ]
      },
      {
        "path": "Payment.splitPayment",
        "min": 0,
        "max": "1",
        "short": "Split payment (MPP)",
        "type": [
          {
            "code": "Boolean"
          }
        ]
      },
      {
        "path": "Payment.reconciliationStatus",
        "min": 0,
        "max": "1",
        "short": "Status rozliczenia",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "path": "Payment.amlCheckStatus",
        "min": 0,
        "max": "1",
        "short": "Status kontroli AML",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "path": "Payment.amlCheckDate",
        "min": 0,
        "max": "1",
        "short": "Data kontroli AML",
        "type": [
          {
            "code": "String"
          }
        ]
      },
      {
        "path": "Payment.relatedPayment",
        "min": 0,
        "max": "*",
        "short": "Powiązane płatności",
        "type": [
          {
            "code": "Reference[]"
          }
        ]
      }
    ]
  }
}