{
  "_note": "Eingaben, aus denen sich der Zahlbetrag nicht rechnen laesst: receiptDueCents wirft ReceiptDueError mit code receipt_due_unavailable und dem reason des Falls, vor jedem Aufruf (nichts gesendet). Eingabe in der Form von receipt-due-generated.json. Von Hand gepflegt; gilt fuer npm und Dart.",
  "version": 1,
  "code": "receipt_due_unavailable",
  "reasons": ["unknown_receipt_type", "tip_not_allowed", "invalid_item", "invalid_voucher", "invalid_tip", "unknown_payment_method", "tip_conflict", "tip_recipient_missing", "tip_without_goods"],
  "cases": [
    { "name": "Trinkgeld ohne Ware, Personal",
      "input": { "receiptType": "standard", "items": [], "vouchers": [], "tip": 100, "tipRecipient": "staff" },
      "expected": { "reason": "tip_without_goods" } },
    { "name": "Trinkgeld ohne Ware, Inhaber",
      "input": { "receiptType": "standard", "items": [], "vouchers": [], "tip": 100, "tipRecipient": "owner" },
      "expected": { "reason": "tip_without_goods" } },
    { "name": "Trinkgeld ohne Ware ueber payments[].tipCents",
      "input": { "receiptType": "standard", "items": [], "vouchers": [], "payments": [{ "method": "cash", "tipCents": 50 }], "tipRecipient": "staff" },
      "expected": { "reason": "tip_without_goods" } },
    { "name": "Trinkgeld auf Ware zu 0 Cent",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 0, "vatRate": 20 }], "vouchers": [], "tip": 100, "tipRecipient": "staff" },
      "expected": { "reason": "tip_without_goods" } },
    { "name": "Trinkgeld ohne Ware mit Empfaengern",
      "input": { "receiptType": "training", "items": [], "vouchers": [], "tip": { "cents": 100, "recipients": [{ "cents": 100, "owner": false }] } },
      "expected": { "reason": "tip_without_goods" } },
    { "name": "Trinkgeld am Nullbeleg",
      "input": { "receiptType": "zero", "items": [], "vouchers": [], "tip": 100, "tipRecipient": "staff" },
      "expected": { "reason": "tip_not_allowed" } },
    { "name": "Trinkgeld am Storno",
      "input": { "receiptType": "cancellation", "items": [{ "name": "A", "quantity": -1, "priceCents": 100, "vatRate": 20 }], "vouchers": [], "tip": 100, "tipRecipient": "staff" },
      "expected": { "reason": "tip_not_allowed" } },
    { "name": "unbekannter Belegtyp",
      "input": { "receiptType": "invoice", "items": [{ "name": "A", "quantity": 1, "priceCents": 100, "vatRate": 20 }], "vouchers": [] },
      "expected": { "reason": "unknown_receipt_type" } },
    { "name": "Position ohne Steuersatz",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 100 }], "vouchers": [] },
      "expected": { "reason": "invalid_item" } },
    { "name": "Position mit halbem Cent",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 1.5, "vatRate": 20 }], "vouchers": [] },
      "expected": { "reason": "invalid_item" } },
    { "name": "Gutschein mit halbem Cent",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 100, "vatRate": 20 }], "vouchers": [{ "action": "redeem", "type": "value", "valueCents": 0.5 }] },
      "expected": { "reason": "invalid_voucher" } },
    { "name": "Trinkgeld 0 Cent",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 100, "vatRate": 20 }], "vouchers": [], "tip": 0, "tipRecipient": "staff" },
      "expected": { "reason": "invalid_tip" } },
    { "name": "Anteile ergeben nicht den Betrag",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 100, "vatRate": 20 }], "vouchers": [], "tip": { "cents": 100, "recipients": [{ "cents": 60, "owner": false }] } },
      "expected": { "reason": "invalid_tip" } },
    { "name": "Trinkgeld an unbekannter Zahlart",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 100, "vatRate": 20 }], "vouchers": [], "payments": [{ "method": "voucher", "tipCents": 10 }], "tipRecipient": "staff" },
      "expected": { "reason": "unknown_payment_method" } },
    { "name": "tip und payments[].tipCents zugleich",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 100, "vatRate": 20 }], "vouchers": [], "tip": 10, "payments": [{ "method": "cash", "tipCents": 10 }], "tipRecipient": "staff" },
      "expected": { "reason": "tip_conflict" } },
    { "name": "Trinkgeld ohne tipRecipient",
      "input": { "receiptType": "standard", "items": [{ "name": "A", "quantity": 1, "priceCents": 100, "vatRate": 20 }], "vouchers": [], "tip": 100 },
      "expected": { "reason": "tip_recipient_missing" } }
  ]
}
