@kreiseck/kasseneck-api 1.35.1 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/CHANGELOG.md +45 -10
  2. package/dist/cjs/client/api.d.ts +15 -1
  3. package/dist/cjs/client/api.js +4 -0
  4. package/dist/cjs/client/aufrufe.d.ts +3 -3
  5. package/dist/cjs/client/aufrufe.js +15 -0
  6. package/dist/cjs/client/auth.d.ts +9 -3
  7. package/dist/cjs/client/auth.js +5 -4
  8. package/dist/cjs/client/ewp.d.ts +125 -0
  9. package/dist/cjs/client/ewp.js +95 -0
  10. package/dist/cjs/client/index.d.ts +1 -0
  11. package/dist/cjs/client/index.js +4 -1
  12. package/dist/cjs/client/list-deposit-types.d.ts +3 -0
  13. package/dist/cjs/client/list-deposit-types.js +3 -0
  14. package/dist/cjs/client/receipts.d.ts +4 -4
  15. package/dist/cjs/index.d.ts +1 -1
  16. package/dist/cjs/index.js +4 -2
  17. package/dist/cjs/invoice/index.d.ts +2 -2
  18. package/dist/cjs/invoice/index.js +2 -1
  19. package/dist/cjs/invoice/texte.d.ts +5 -0
  20. package/dist/cjs/invoice/texte.js +10 -0
  21. package/dist/cjs/invoice/typen.d.ts +34 -1
  22. package/dist/cjs/invoice/vertrag.d.ts +13 -4
  23. package/dist/cjs/invoice/vertrag.js +29 -6
  24. package/dist/cjs/payments/hobex-hps/index.d.ts +2 -1
  25. package/dist/cjs/payments/hobex-hps/index.js +3 -1
  26. package/dist/cjs/payments/hobex-hps/outcome.d.ts +10 -0
  27. package/dist/cjs/payments/hobex-hps/payments.d.ts +54 -0
  28. package/dist/cjs/payments/hobex-hps/payments.js +157 -1
  29. package/dist/cjs/payments/hobex-hps/support.d.ts +19 -0
  30. package/dist/cjs/payments/hobex-hps/support.js +22 -0
  31. package/dist/cjs/payments/hobex-hps/transaction-response.js +1 -1
  32. package/dist/cjs/payments/index.d.ts +1 -1
  33. package/dist/cjs/payments/index.js +2 -1
  34. package/dist/cjs/pos/errors.d.ts +1 -1
  35. package/dist/cjs/pos/errors.js +1 -0
  36. package/dist/cjs/pos/index.d.ts +4 -4
  37. package/dist/cjs/pos/index.js +13 -5
  38. package/dist/cjs/pos/schicht-lesen.d.ts +3 -1
  39. package/dist/cjs/pos/schicht-lesen.js +23 -1
  40. package/dist/cjs/pos/schicht-typen.d.ts +39 -4
  41. package/dist/cjs/pos/schicht-typen.js +7 -2
  42. package/dist/cjs/pos/schicht.d.ts +6 -4
  43. package/dist/cjs/pos/schicht.js +6 -3
  44. package/dist/cjs/pos/settings.d.ts +37 -8
  45. package/dist/cjs/pos/settings.js +34 -10
  46. package/dist/cjs/pos/texte.d.ts +249 -2
  47. package/dist/cjs/pos/texte.js +139 -4
  48. package/dist/cjs/pos/trinkgeld.d.ts +30 -0
  49. package/dist/cjs/pos/trinkgeld.js +30 -0
  50. package/dist/cjs/receipt/shift-sheet.js +6 -1
  51. package/dist/cjs/register/pairing.d.ts +4 -0
  52. package/dist/cjs/register/pairing.js +2 -0
  53. package/dist/cjs/stored/vokabular.d.ts +1 -1
  54. package/dist/cjs/stored/vokabular.js +12 -1
  55. package/dist/cjs/version.d.ts +1 -1
  56. package/dist/cjs/version.js +1 -1
  57. package/dist/esm/client/api.d.ts +15 -1
  58. package/dist/esm/client/api.js +4 -0
  59. package/dist/esm/client/aufrufe.d.ts +3 -3
  60. package/dist/esm/client/aufrufe.js +15 -0
  61. package/dist/esm/client/auth.d.ts +9 -3
  62. package/dist/esm/client/auth.js +5 -4
  63. package/dist/esm/client/ewp.d.ts +125 -0
  64. package/dist/esm/client/ewp.js +89 -0
  65. package/dist/esm/client/index.d.ts +1 -0
  66. package/dist/esm/client/index.js +1 -0
  67. package/dist/esm/client/list-deposit-types.d.ts +3 -0
  68. package/dist/esm/client/list-deposit-types.js +3 -0
  69. package/dist/esm/client/receipts.d.ts +4 -4
  70. package/dist/esm/index.d.ts +1 -1
  71. package/dist/esm/index.js +1 -1
  72. package/dist/esm/invoice/index.d.ts +2 -2
  73. package/dist/esm/invoice/index.js +1 -1
  74. package/dist/esm/invoice/texte.d.ts +5 -0
  75. package/dist/esm/invoice/texte.js +10 -0
  76. package/dist/esm/invoice/typen.d.ts +34 -1
  77. package/dist/esm/invoice/vertrag.d.ts +13 -4
  78. package/dist/esm/invoice/vertrag.js +28 -5
  79. package/dist/esm/payments/hobex-hps/index.d.ts +2 -1
  80. package/dist/esm/payments/hobex-hps/index.js +1 -0
  81. package/dist/esm/payments/hobex-hps/outcome.d.ts +10 -0
  82. package/dist/esm/payments/hobex-hps/payments.d.ts +54 -0
  83. package/dist/esm/payments/hobex-hps/payments.js +158 -2
  84. package/dist/esm/payments/hobex-hps/support.d.ts +19 -0
  85. package/dist/esm/payments/hobex-hps/support.js +19 -0
  86. package/dist/esm/payments/hobex-hps/transaction-response.js +1 -1
  87. package/dist/esm/payments/index.d.ts +1 -1
  88. package/dist/esm/payments/index.js +1 -1
  89. package/dist/esm/pos/errors.d.ts +1 -1
  90. package/dist/esm/pos/errors.js +1 -0
  91. package/dist/esm/pos/index.d.ts +4 -4
  92. package/dist/esm/pos/index.js +5 -5
  93. package/dist/esm/pos/schicht-lesen.d.ts +3 -1
  94. package/dist/esm/pos/schicht-lesen.js +22 -1
  95. package/dist/esm/pos/schicht-typen.d.ts +39 -4
  96. package/dist/esm/pos/schicht-typen.js +6 -1
  97. package/dist/esm/pos/schicht.d.ts +6 -4
  98. package/dist/esm/pos/schicht.js +6 -3
  99. package/dist/esm/pos/settings.d.ts +37 -8
  100. package/dist/esm/pos/settings.js +30 -9
  101. package/dist/esm/pos/texte.d.ts +249 -2
  102. package/dist/esm/pos/texte.js +138 -3
  103. package/dist/esm/pos/trinkgeld.d.ts +30 -0
  104. package/dist/esm/pos/trinkgeld.js +28 -0
  105. package/dist/esm/receipt/shift-sheet.js +6 -1
  106. package/dist/esm/register/pairing.d.ts +4 -0
  107. package/dist/esm/register/pairing.js +2 -0
  108. package/dist/esm/stored/vokabular.d.ts +1 -1
  109. package/dist/esm/stored/vokabular.js +12 -1
  110. package/dist/esm/version.d.ts +1 -1
  111. package/dist/esm/version.js +1 -1
  112. package/fixtures/duplicate-cases.json +1 -1
  113. package/fixtures/expected/duplicate.shift-close.hex +1 -1
  114. package/fixtures/expected/shift-close-card-tips.grid32.txt +44 -0
  115. package/fixtures/expected/shift-close-card-tips.grid48.txt +40 -0
  116. package/fixtures/expected/shift-close-card-tips.lines.json +479 -0
  117. package/fixtures/expected/shift-close-put-in.grid32.txt +1 -1
  118. package/fixtures/expected/shift-close-put-in.grid48.txt +1 -1
  119. package/fixtures/expected/shift-close-put-in.lines.json +1 -1
  120. package/fixtures/expected/shift-close-take-out.grid32.txt +1 -1
  121. package/fixtures/expected/shift-close-take-out.grid48.txt +1 -1
  122. package/fixtures/expected/shift-close-take-out.lines.json +1 -1
  123. package/fixtures/expected/shift-close.grid32.txt +1 -1
  124. package/fixtures/expected/shift-close.grid48.txt +1 -1
  125. package/fixtures/expected/shift-close.lines.json +1 -1
  126. package/fixtures/expected/shift-interim-card-tips.grid32.txt +34 -0
  127. package/fixtures/expected/shift-interim-card-tips.grid48.txt +31 -0
  128. package/fixtures/expected/shift-interim-card-tips.lines.json +344 -0
  129. package/fixtures/hobex-hps-codes.json +2 -2
  130. package/fixtures/invoice-api-examples/issue-error-deposit.json +39 -0
  131. package/fixtures/invoice-api-examples/issue-invoice-deposit.json +55 -0
  132. package/fixtures/invoice-api.schema.json +65 -2
  133. package/fixtures/invoice-texts.json +11 -1
  134. package/fixtures/pos-texts.json +300 -3
  135. package/fixtures/renames-1.0.json +10 -0
  136. package/fixtures/shift-ablauf-cases.json +4 -4
  137. package/fixtures/shift-cases.json +4 -2
  138. package/fixtures/shift-receipts-card-tips.json +73 -0
  139. package/fixtures/shift-receipts.json +9 -9
  140. package/fixtures/stored/card-tip-cases.json +132 -0
  141. package/fixtures/surface.json +33 -8
  142. package/fixtures/v3/antworten/belege.json +1 -1
  143. package/fixtures/v3/antworten/belegmail.json +1 -1
  144. package/fixtures/v3/antworten/berichte.json +1 -1
  145. package/fixtures/v3/antworten/kasse-belege.json +1 -1
  146. package/fixtures/v3/antworten/kasse.json +240 -3
  147. package/fixtures/v3/antworten/lager.json +1 -1
  148. package/fixtures/v3/antworten/rechnungen.json +1 -1
  149. package/fixtures/v3/antworten/storno.json +1 -1
  150. package/fixtures/v3/stored/belege.json +1 -1
  151. package/fixtures/v3/stored/kasse.json +2 -2
  152. package/fixtures/v3/stored/rechnungen.json +1 -1
  153. package/fixtures/v3/v3-vokabular.json +459 -17
  154. package/fixtures/v3/zahlbetrag-faelle.json +1 -1
  155. package/package.json +1 -1
@@ -79,6 +79,12 @@ export const INVOICE_ERROR_CODES = [
79
79
  'reservation_not_active', // schon eingeloest oder freigegeben
80
80
  // Seit 1.15.0 (Vertrag): die Rechnungsnummer ist schon vergeben (§ 11 Abs. 1 Z 3 lit. h UStG), nichts ausgestellt.
81
81
  'invoice_number_taken',
82
+ // Seit 1.36.0 (Vertrag): Pfand an Positionen (`items[].deposit`), hinten angehaengt.
83
+ 'deposit_not_enabled', // Pfand ist fuer dieses Konto nicht eingeschaltet
84
+ 'deposit_type_not_found', // die Pfandart gibt es nicht (oder ist stillgelegt)
85
+ 'deposit_set_by_server', // das Pfand zu einer Artikelposition leitet der Server selbst ab
86
+ 'invalid_deposit_quantity', // die Pfandmenge passt nicht zur Menge der Position
87
+ 'invalid_deposit', // sonstige Pfandangabe unzulaessig, `index` nennt die Position
82
88
  ];
83
89
  /**
84
90
  * Codes, die Anmeldung und Rand auf jedem Rechnungsaufruf erzeugen koennen,
@@ -447,9 +453,26 @@ export const ITEM_FIELDS = Object.freeze({
447
453
  */
448
454
  articleId: id,
449
455
  });
456
+ /**
457
+ * Pfandangabe an einer Position (seit 1.36.0, `deposit`): die Position ist eine
458
+ * Pfandzeile zu der Position `depositFor` (Index in `items`, 0 bis 499). Gleich
459
+ * dem Feld `DEPOSIT_FELD` des Backends. Zeile fuer Zeile Pfand sendet das
460
+ * Fremdsystem selbst; zu einer Position mit `articleId` leitet der Server das
461
+ * Pfand ab (`deposit_set_by_server`).
462
+ */
463
+ export const DEPOSIT_ITEM_FIELD = Object.freeze({
464
+ type: 'object',
465
+ required: false,
466
+ fields: Object.freeze({
467
+ depositTypeId: { type: 'string', required: true, min: 1, max: 128 },
468
+ depositFor: { type: 'integer', required: true, min: 0, max: 499 },
469
+ gtin: { type: 'string', required: false, min: 8, max: 14, pattern: '^[0-9]{8,14}$' },
470
+ ownFilling: { type: 'boolean', required: false },
471
+ }),
472
+ });
450
473
  /**
451
474
  * Eine Rechnungsposition beim Ausstellen: die gemeinsamen Positionsfelder plus
452
- * `reservationId` (seit 1.5.0). Die Reservierung aus der Lager-API
475
+ * `reservationId` (seit 1.5.0) und `deposit` (seit 1.36.0). Die Reservierung aus der Lager-API
453
476
  * (`createReservation`) wird beim Ausstellen geprueft und beim Buchen der
454
477
  * Rechnung eingeloest; die Position braucht dazu `articleId`. Unbekannt =
455
478
  * `reservation_not_found`, schon eingeloest oder freigegeben =
@@ -459,7 +482,7 @@ export const ITEM_FIELDS = Object.freeze({
459
482
  * `reservation_expired`. Weniger verkauft als reserviert gibt den Rest frei.
460
483
  * Gutschriften kennen das Feld nicht (`validation`).
461
484
  */
462
- export const INVOICE_ITEM_FIELDS = Object.freeze({ ...ITEM_FIELDS, reservationId: id });
485
+ export const INVOICE_ITEM_FIELDS = Object.freeze({ ...ITEM_FIELDS, reservationId: id, deposit: DEPOSIT_ITEM_FIELD });
463
486
  /** Genau einer der beiden Preise je Position (§ 9.1). */
464
487
  export const ITEM_PRICE_EXACTLY_ONE = Object.freeze([
465
488
  Object.freeze(['unitPriceCents']),
@@ -478,11 +501,11 @@ const positionen = {
478
501
  const returnDisposition = { type: 'enum', required: false, values: RETURN_DISPOSITIONS };
479
502
  /**
480
503
  * Eine Gutschriftsposition: die gemeinsamen Positionsfelder plus
481
- * `returnDisposition` (wohin die zurueckgenommene Ware geht), ohne
482
- * `reservationId`. An einer Rechnungsposition weist der Server
504
+ * `returnDisposition` (wohin die zurueckgenommene Ware geht) und `deposit`
505
+ * (seit 1.36.0), ohne `reservationId`. An einer Rechnungsposition weist der Server
483
506
  * `returnDisposition` als unbekannt ab.
484
507
  */
485
- export const CREDIT_NOTE_ITEM_FIELDS = Object.freeze({ ...ITEM_FIELDS, returnDisposition });
508
+ export const CREDIT_NOTE_ITEM_FIELDS = Object.freeze({ ...ITEM_FIELDS, returnDisposition, deposit: DEPOSIT_ITEM_FIELD });
486
509
  const gutschriftPositionen = {
487
510
  type: 'list',
488
511
  required: true,
@@ -21,7 +21,8 @@ export { type HpsConnectCancelOptions, type HpsConnectClient, type HpsConnectCli
21
21
  export { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, } from './errors.js';
22
22
  export { type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, } from './events.js';
23
23
  export { type CardPaymentOutcome, type HpsPaymentResult, isHostUncertainResult, mayRetrySafely, } from './outcome.js';
24
- export { type HpsCancelOptions, type HpsPaymentOptions, type HpsPayments, type HpsPaymentsOptions, type HpsRefundOptions, createHpsPayments, } from './payments.js';
24
+ export { type HpsCancelOptions, type HpsClarifyOptions, type HpsPaymentOptions, type HpsPayments, type HpsPaymentsOptions, type HpsRefundOptions, createHpsPayments, } from './payments.js';
25
25
  export { MAX_TRANSACTION_ID_LENGTH, createHpsTransactionIdGenerator, isValidHpsTransactionId, newHpsTransactionId, type HpsTransactionIdGeneratorOptions, } from './transaction-id.js';
26
26
  export { ABORTED_CODE, APP_SELECT_FAILED_CODE, APPROVED_CODE, BAD_REQUEST_CODE, CARD_DECLINED_CODE, CARD_INFO_NOT_ENTERED_CODE, CARD_NOT_PRESENT_CODE, CARD_NOT_SUPPORTED_CODE, CARD_READ_FAILED_CODE, CHIP_DATA_MISMATCH_CODE, COMPLETION_FAILED_CODE, DIAGNOSIS_FAILED_CODE, HOST_COMMUNICATION_FAILED_CODE, HOST_STEP_FAILED_CODE, HOST_TIMEOUT_REVERSED_CODE, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, INTERNAL_ERROR_CODE, INVALID_MESSAGE_TYPE_CODE, INVALID_TID_DOCUMENTED_CODE, INVALID_TX_TYPE_CODE, MAX_RETRIES_EXCEEDED_CODE, NOT_FOUND_CODE, PASSWORD_NOT_ENTERED_CODE, REFUND_DISABLED_CODE, REFUND_PASSWORD_INVALID_CODE, SCEP_ENROLLMENT_FAILED_CODE, TERMINAL_BLOCKED_CODE, TERMINAL_BUSY_CODE, TIP_SELECTION_FAILED_CODE, UNSUPPORTED_USER_DATA_CODE, hpsCodeInfo, hpsCodeReason, isHostUncertain, isHostUncertainReason, INVALID_TRANSACTION_CODE, NOT_ABORTABLE_CODE, INVALID_AMOUNT_CODE, AMOUNT_OUT_OF_RANGE_CODE, INVALID_TID_CODE, WRONG_PIN_CODE, NO_STATEMENT_CODE, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, isApproved, isCanceled, isConclusive, isConclusiveAsStatus, isInProgress, isNoStatement, isNotAbortable, needsReversal, normalizeHpsCode, isTechnicalError, isUnknownCode, parseHpsTransactionResponse, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsTransactionResponse, } from './transaction-response.js';
27
27
  export { hobexReceiptFromHps } from './receipt.js';
28
+ export { HOBEX_SUPPORT } from './support.js';
@@ -24,3 +24,4 @@ export { createHpsPayments, } from './payments.js';
24
24
  export { MAX_TRANSACTION_ID_LENGTH, createHpsTransactionIdGenerator, isValidHpsTransactionId, newHpsTransactionId, } from './transaction-id.js';
25
25
  export { ABORTED_CODE, APP_SELECT_FAILED_CODE, APPROVED_CODE, BAD_REQUEST_CODE, CARD_DECLINED_CODE, CARD_INFO_NOT_ENTERED_CODE, CARD_NOT_PRESENT_CODE, CARD_NOT_SUPPORTED_CODE, CARD_READ_FAILED_CODE, CHIP_DATA_MISMATCH_CODE, COMPLETION_FAILED_CODE, DIAGNOSIS_FAILED_CODE, HOST_COMMUNICATION_FAILED_CODE, HOST_STEP_FAILED_CODE, HOST_TIMEOUT_REVERSED_CODE, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, INTERNAL_ERROR_CODE, INVALID_MESSAGE_TYPE_CODE, INVALID_TID_DOCUMENTED_CODE, INVALID_TX_TYPE_CODE, MAX_RETRIES_EXCEEDED_CODE, NOT_FOUND_CODE, PASSWORD_NOT_ENTERED_CODE, REFUND_DISABLED_CODE, REFUND_PASSWORD_INVALID_CODE, SCEP_ENROLLMENT_FAILED_CODE, TERMINAL_BLOCKED_CODE, TERMINAL_BUSY_CODE, TIP_SELECTION_FAILED_CODE, UNSUPPORTED_USER_DATA_CODE, hpsCodeInfo, hpsCodeReason, isHostUncertain, isHostUncertainReason, INVALID_TRANSACTION_CODE, NOT_ABORTABLE_CODE, INVALID_AMOUNT_CODE, AMOUNT_OUT_OF_RANGE_CODE, INVALID_TID_CODE, WRONG_PIN_CODE, NO_STATEMENT_CODE, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, isApproved, isCanceled, isConclusive, isConclusiveAsStatus, isInProgress, isNoStatement, isNotAbortable, needsReversal, normalizeHpsCode, isTechnicalError, isUnknownCode, parseHpsTransactionResponse, } from './transaction-response.js';
26
26
  export { hobexReceiptFromHps } from './receipt.js';
27
+ export { HOBEX_SUPPORT } from './support.js';
@@ -48,6 +48,16 @@ export interface HpsPaymentResult {
48
48
  * Terminal etwas sagte) und bei einer Aufhebung, die nicht gegriffen hat.
49
49
  */
50
50
  readonly reason?: HpsCodeReason;
51
+ /**
52
+ * Gesetzt, wenn dieses Ergebnis aus einer SPAETEN Nachfrage stammt
53
+ * (`HpsPayments.clarifyPayment`). Ein solches Ergebnis taugt nicht als
54
+ * `previous` einer weiteren Nachfrage: die Vorgeschichte einer Zahlung ist
55
+ * das Ergebnis von `pay`, und das bleibt sie -- ein `reason` aus der
56
+ * Nachfrage selbst (etwa `noStatement`) sagt nichts darueber, ob die
57
+ * Klaerung von `pay` ein Storno nachgeschickt hat. Die Nachfrage weist ein
58
+ * so markiertes `previous` deshalb zurueck: keine Antwort entscheidet.
59
+ */
60
+ readonly clarified?: true;
51
61
  /**
52
62
  * Verlauf der Klaerung, in Reihenfolge — der Nachweis, der im
53
63
  * Belastungsstreit gelesen wird. Behauptet nie eine Ursache, die nicht
@@ -219,11 +219,65 @@ export interface HpsCancelOptions {
219
219
  currency?: string;
220
220
  language?: string;
221
221
  }
222
+ export interface HpsClarifyOptions {
223
+ /** Kennung der Zahlung aus [HpsPayments.pay] -- keine Gutschrift, keine Aufhebung. */
224
+ transactionId: string;
225
+ /**
226
+ * Was ueber die bisherige Klaerung dieser Zahlung feststeht. Davon haengt
227
+ * ab, was eine Antwort des Terminals jetzt noch beweist, siehe
228
+ * [HpsPayments.clarifyPayment]:
229
+ *
230
+ * - das `unresolved`-Ergebnis von [HpsPayments.pay] (es zaehlen `reason` und
231
+ * `clarified`). NIE das Ergebnis einer Nachfrage: dessen `reason` stammt
232
+ * aus der Nachfrage, nicht aus der Zahlung, und wuerde eine unbekannte
233
+ * Vorgeschichte reinwaschen -- ein mit `clarified` markiertes Ergebnis
234
+ * zaehlt deshalb wie `null`;
235
+ * - `'beforeResolve'`: die Zahlung wurde gestartet, ihre Klaerung hat aber
236
+ * nie begonnen -- etwa weil die Seite waehrend des Kartenflows abriss. Es
237
+ * wurde dann sicher kein Storno nachgeschickt. Nur angeben, wenn das
238
+ * Beobachter-Ereignis `resolving` nachweislich nie kam (es wird vor dem
239
+ * ersten Abbruch- oder Storno-Aufruf gemeldet); im Zweifel `null`;
240
+ * - `null`: nicht bekannt (etwa ein Eintrag aus einer aelteren Fassung, oder
241
+ * die Seite riss waehrend der Klaerung ab).
242
+ */
243
+ previous: Pick<HpsPaymentResult, 'reason' | 'clarified'> | 'beforeResolve' | null;
244
+ }
222
245
  export interface HpsPayments {
223
246
  pay(options: HpsPaymentOptions): Promise<HpsPaymentResult>;
224
247
  /** Gutschrift, geklaert wie [pay] -- siehe Klassendoku oben. */
225
248
  refund(options: HpsRefundOptions): Promise<HpsPaymentResult>;
226
249
  /** Aufhebung (Storno/Void) einer bestehenden Zahlung -- eigener Klaerweg, siehe Klassendoku oben. */
227
250
  cancel(options: HpsCancelOptions): Promise<HpsPaymentResult>;
251
+ /**
252
+ * Fragt den Ausgang einer Zahlung SPAETER noch einmal ab -- etwa wenn der
253
+ * Kassier eine unklare Karte klaert. Liest nur: kein Abbruch, kein Storno,
254
+ * kein neuer Vorgang. Das Ergebnis hat dieselbe Form wie das von [pay].
255
+ *
256
+ * Entschieden wird nur, was nach [HpsClarifyOptions.previous] feststeht
257
+ * ([nachfrageRegel]):
258
+ *
259
+ * | bisher | `'0'` | `9011` | andere Ablehnung |
260
+ * |---|---|---|---|
261
+ * | `'beforeResolve'`, oder offen ohne Stoerung beim Host | `approved` | `declined` | `declined` |
262
+ * | Stoerung beim Host, Storno sicher versucht (`hostFault`, `hostTimeout`) | offen | `declined` | offen |
263
+ * | andere Stoerung beim Host | offen | offen | offen |
264
+ * | `null` oder Ergebnis einer Nachfrage (`clarified`) | offen | offen | offen |
265
+ *
266
+ * Nach einer Stoerung beim Host kann die Klaerung von [pay] ein Storno
267
+ * nachgeschickt haben -- auch wenn der erste Code keines verlangte, denn
268
+ * ein spaeterer Status kann es noch ausloesen. Ein `'0'` beweist dann
269
+ * nichts (siehe Klassendoku, "Storno nach ausbleibender Host-Antwort").
270
+ * `9011` (aufgehoben) heisst nur dann sicher "nichts belastet", wenn ein
271
+ * Storno sicher versucht wurde -- wie in der Klaerung von [pay]. `9027`
272
+ * bleibt hier immer ohne Aussage: die Zwei-9027-Regel braucht die Antwort
273
+ * auf die Zahlung selbst. Meldet der Status selbst eine Stoerung beim
274
+ * Host, entscheidet danach nur noch `'0'`.
275
+ *
276
+ * Sagt der Status zweimal in Folge nichts, endet die Nachfrage sofort als
277
+ * `unresolved` -- die Zahlung ist laengst beendet, das Terminal wird es
278
+ * auch spaeter nicht wissen. Budget: ein Sechstel von
279
+ * [HpsPaymentsOptions.resolveBudgetMs] (Vorgabe 15 s).
280
+ */
281
+ clarifyPayment(options: HpsClarifyOptions): Promise<HpsPaymentResult>;
228
282
  }
229
283
  export declare function createHpsPayments(client: HpsConnectClient, target: HpsConnectTarget, options?: HpsPaymentsOptions): HpsPayments;
@@ -1,8 +1,34 @@
1
1
  import { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsPreflightError, } from './errors.js';
2
2
  import { newHpsTransactionId } from './transaction-id.js';
3
- import { APPROVED_CODE, hpsCodeInfo, hpsCodeReason, isApproved, isCanceled, isConclusive, isConclusiveAsStatus, isHostUncertain, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, needsReversal, NOT_ABORTABLE_CODE, NOT_FOUND_CODE, TECHNICAL_ERROR_CODE, TRANSACTION_CANCELED_CODE, } from './transaction-response.js';
3
+ import { APPROVED_CODE, HPS_CODES, hpsCodeInfo, hpsCodeReason, isApproved, isCanceled, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainReason, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, needsReversal, NOT_ABORTABLE_CODE, NOT_FOUND_CODE, TECHNICAL_ERROR_CODE, TRANSACTION_CANCELED_CODE, } from './transaction-response.js';
4
4
  /** Teiler, mit dem das Abbruchbudget aus [HpsPaymentsOptions.resolveBudgetMs] entsteht. */
5
5
  const ABORT_BUDGET_DIVISOR = 6;
6
+ /** Teiler fuer das Budget von [HpsPayments.clarifyPayment]: bei der Vorgabe 15 s. */
7
+ const CLARIFY_BUDGET_DIVISOR = 6;
8
+ /**
9
+ * `true`, wenn die Klaerung von [HpsPayments.pay] bei diesem Grund sicher ein
10
+ * Storno versucht hat: der Grund kommt von der ersten Stoerung beim Host
11
+ * ([offenerGrund]), und JEDER Code mit diesem Grund verlangt ein Storno. Aus
12
+ * der Tabelle gerechnet, damit ein neuer Code ohne Storno die Regel nicht
13
+ * still bricht.
14
+ */
15
+ function stornoSicherVersucht(reason) {
16
+ const codes = HPS_CODES.filter((c) => c.reason === reason);
17
+ return codes.length > 0 && codes.every((c) => c.sendReversal);
18
+ }
19
+ /** Siehe Tabelle an [HpsPayments.clarifyPayment]. */
20
+ function nachfrageRegel(previous) {
21
+ if (previous === null || (previous !== 'beforeResolve' && previous.clarified === true)) {
22
+ return { genehmigt: false, aufgehoben: false, abgelehnt: false };
23
+ }
24
+ if (previous === 'beforeResolve')
25
+ return { genehmigt: true, aufgehoben: true, abgelehnt: true };
26
+ const reason = previous.reason;
27
+ if (reason !== undefined && isHostUncertainReason(reason)) {
28
+ return { genehmigt: false, aufgehoben: stornoSicherVersucht(reason), abgelehnt: false };
29
+ }
30
+ return { genehmigt: true, aufgehoben: true, abgelehnt: true };
31
+ }
6
32
  /**
7
33
  * Teiler fuer das Budget des nachgeschickten Stornos: ein Drittel, bei der
8
34
  * Vorgabe 30 s. Ein Storno geht ueber den Host und darf Sekunden brauchen.
@@ -50,6 +76,7 @@ export function createHpsPayments(client, target, options = {}) {
50
76
  const observer = options.observer;
51
77
  const abortBudgetMs = Math.trunc(resolveBudgetMs / ABORT_BUDGET_DIVISOR);
52
78
  const reversalBudgetMs = Math.trunc(resolveBudgetMs / REVERSAL_BUDGET_DIVISOR);
79
+ const clarifyBudgetMs = Math.trunc(resolveBudgetMs / CLARIFY_BUDGET_DIVISOR);
53
80
  function emit(kind, message, transactionId) {
54
81
  if (!observer)
55
82
  return;
@@ -851,5 +878,134 @@ export function createHpsPayments(client, target, options = {}) {
851
878
  }
852
879
  return resolveCancel(id, steps, res);
853
880
  }
854
- return { pay, refund, cancel };
881
+ /**
882
+ * Spaete Nachfrage zu einer Zahlung, siehe [HpsPayments.clarifyPayment].
883
+ * Liest nur den Status -- nie ein Abbruch, nie ein Storno. Wirft wie [pay]
884
+ * nur [HpsPreflightError]: Connect hat die Abfrage abgewiesen, bevor sie
885
+ * das Terminal erreichte (etwa `terminal_unreachable`).
886
+ */
887
+ async function clarifyPayment(clarifyOptions) {
888
+ const id = clarifyOptions.transactionId;
889
+ const previous = clarifyOptions.previous;
890
+ const regel = nachfrageRegel(previous);
891
+ // Ein Nachfrage-Ergebnis als Vorgeschichte zaehlt wie "nicht bekannt" --
892
+ // auch sein `reason` (siehe [HpsPaymentResult.clarified]).
893
+ const vorgeschichteBekannt = previous !== null && (previous === 'beforeResolve' || previous.clarified !== true);
894
+ const vorherGrund = vorgeschichteBekannt && typeof previous === 'object' ? previous.reason : undefined;
895
+ const vorherGestoert = vorherGrund !== undefined && isHostUncertainReason(vorherGrund);
896
+ const steps = [nachfrageAnfang(previous, regel)];
897
+ emit('resolving', steps[0], id);
898
+ const start = now();
899
+ const elapsedMs = () => now() - start;
900
+ let wait = 0;
901
+ let transportFailures = 0;
902
+ let ohneAussage = 0;
903
+ // Die erste Stoerung beim Host, die der Status in DIESER Nachfrage meldet.
904
+ let stoerung;
905
+ let letzteAntwort;
906
+ // Ein schluessiger Code, der hier nicht entscheiden durfte (`'0'`, `9011`, eine
907
+ // Ablehnung), erklaert den offenen Ausgang nicht -- sonst stuende etwa „genehmigt“
908
+ // als Grund an einem offenen Ergebnis (Geraetetest 11.11.2026, Vorgeschichte unbekannt).
909
+ const offen = () => {
910
+ const erklaerend = letzteAntwort && !isConclusiveAsStatus(letzteAntwort) ? letzteAntwort : undefined;
911
+ return {
912
+ ...open(id, steps, letzteAntwort, vorherGrund ?? offenerGrund(stoerung, erklaerend)),
913
+ clarified: true,
914
+ };
915
+ };
916
+ /** Warum eine Antwort, die sonst entschiede, hier nichts sagt. */
917
+ const vorbehalt = () => {
918
+ if (!vorgeschichteBekannt)
919
+ return 'der bisherige Klaerweg ist nicht bekannt, ein Storno kann nachgeschickt sein';
920
+ if (vorherGestoert)
921
+ return `nach der Stoerung beim hobex-Host (${vorherGrund}) kann ein Storno nachgeschickt sein`;
922
+ return 'das Terminal meldet eine Stoerung beim hobex-Host';
923
+ };
924
+ while (elapsedMs() < clarifyBudgetMs) {
925
+ if (wait > 0) {
926
+ await sleep(Math.min(wait, clarifyBudgetMs - elapsedMs()));
927
+ if (elapsedMs() >= clarifyBudgetMs)
928
+ break;
929
+ }
930
+ let status;
931
+ try {
932
+ status = await withinBudget(elapsedMs, () => client.status({ ...target, transactionId: id }), clarifyBudgetMs - elapsedMs());
933
+ transportFailures = 0;
934
+ letzteAntwort = status;
935
+ }
936
+ catch (e) {
937
+ if (e instanceof HpsPreflightError)
938
+ throw e;
939
+ transportFailures += 1;
940
+ steps.push(`Statusabfrage gescheitert (${transportFailures}): ${describe(e)}`);
941
+ noteUnexpected(e, id);
942
+ if (transportFailures >= maxTransportFailures) {
943
+ steps.push('Terminal antwortet nicht -- Ausgang bleibt offen');
944
+ return offen();
945
+ }
946
+ wait = nextWait(wait);
947
+ continue;
948
+ }
949
+ if (isHostUncertain(status))
950
+ stoerung ??= status;
951
+ // Wie in [resolve]: nach einer Stoerung beim Host -- vorher oder jetzt
952
+ // gemeldet -- entscheidet hoechstens noch die Genehmigung.
953
+ const gestoert = vorherGestoert || stoerung !== undefined;
954
+ if (isApproved(status)) {
955
+ if (regel.genehmigt) {
956
+ const settled = fromResponse(status, id, steps);
957
+ if (settled)
958
+ return { ...settled, clarified: true };
959
+ }
960
+ steps.push(`Status: genehmigt (${APPROVED_CODE}) -- ${vorbehalt()}, keine Aussage`);
961
+ }
962
+ else if (isCanceled(status) && regel.aufgehoben && (vorherGestoert || stoerung === undefined)) {
963
+ steps.push(`Status: Zahlung aufgehoben (${TRANSACTION_CANCELED_CODE}) -- es ist nichts belastet`);
964
+ emit('resolved', steps[steps.length - 1], id);
965
+ return { outcome: 'declined', transactionId: id, response: status, reason: 'canceled', clarified: true, steps: [...steps] };
966
+ }
967
+ else if (regel.abgelehnt && !gestoert && isConclusiveAsStatus(status)) {
968
+ const settled = fromResponse(status, id, steps);
969
+ if (settled)
970
+ return { ...settled, clarified: true };
971
+ }
972
+ else if (isConclusiveAsStatus(status)) {
973
+ const info = hpsCodeInfo(status.responseCode);
974
+ const was = isCanceled(status) ? 'aufgehoben' : 'abgelehnt';
975
+ steps.push(`Status: ${was} (${info.code} "${info.title}") -- ${vorbehalt()}, keine Aussage`);
976
+ }
977
+ else {
978
+ steps.push(statusOhneErgebnis(status) ?? 'Status: noch kein Ergebniscode');
979
+ }
980
+ ohneAussage += 1;
981
+ if (ohneAussage >= 2) {
982
+ steps.push('Statusabfrage zweimal ohne Aussage -- das Terminal kann es nicht sagen, Ausgang bleibt offen');
983
+ return offen();
984
+ }
985
+ wait = nextWait(wait);
986
+ }
987
+ steps.push('Ausgang bleibt offen');
988
+ return offen();
989
+ }
990
+ return { pay, refund, cancel, clarifyPayment };
991
+ }
992
+ /** Erster Eintrag im Nachweis einer spaeten Nachfrage: was sie entscheiden darf. */
993
+ function nachfrageAnfang(previous, regel) {
994
+ const anfang = 'Spaete Nachfrage beim Terminal -- nur lesend, ohne Abbruch und ohne Storno';
995
+ if (previous === null)
996
+ return `${anfang}; der bisherige Klaerweg ist nicht bekannt, keine Antwort entscheidet`;
997
+ if (previous !== 'beforeResolve' && previous.clarified === true) {
998
+ return `${anfang}; als Vorgeschichte kam das Ergebnis einer frueheren Nachfrage, nicht das der Zahlung -- `
999
+ + 'der Klaerweg der Zahlung bleibt unbekannt, keine Antwort entscheidet';
1000
+ }
1001
+ if (previous === 'beforeResolve') {
1002
+ return `${anfang}; die Klaerung der Zahlung hatte nicht begonnen, es wurde kein Storno nachgeschickt`;
1003
+ }
1004
+ if (previous.reason !== undefined && isHostUncertainReason(previous.reason)) {
1005
+ return regel.aufgehoben
1006
+ ? `${anfang}; nach der Stoerung beim hobex-Host (${previous.reason}) wurde ein Storno versucht, `
1007
+ + `entscheidet nur "aufgehoben" (${TRANSACTION_CANCELED_CODE})`
1008
+ : `${anfang}; nach der Stoerung beim hobex-Host (${previous.reason}) entscheidet keine Antwort`;
1009
+ }
1010
+ return `${anfang}; die Klaerung der Zahlung endete offen ohne Stoerung beim hobex-Host`;
855
1011
  }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Technik von hobex fuer Haendler mit hobex-Terminal, rund um die Uhr
3
+ * erreichbar. Quelle: Angabe des Inhabers am 11.11.2026 („hobex Technik
4
+ * 0662 225588“); es ist die Durchwahl 88 der Zentrale +43 662 2255-0 (hobex,
5
+ * „Zahlen & Fakten“).
6
+ *
7
+ * `phone` international (fuer einen `tel:`-Link nur Ziffern und `+` daraus
8
+ * nehmen), `display` so, wie man sie in Oesterreich liest und waehlt.
9
+ * Gedacht fuer die Stellen, an denen hobex helfen kann: Stoerung beim
10
+ * hobex-Host, Terminal nicht betriebsbereit, TID passt nicht, das Terminal hat
11
+ * geantwortet und kennt den Ausgang nicht -- nie fuer Fehler im eigenen Netz
12
+ * oder an Kasseneck Connect. Die Kasse zeigt sie in einem eigenen Fenster mit
13
+ * den Angaben, die hobex fragt (Beschriftungen `hobex_help.*` im Katalog).
14
+ */
15
+ export declare const HOBEX_SUPPORT: Readonly<{
16
+ readonly phone: "+43 662 2255-88";
17
+ readonly display: "0662 2255-88";
18
+ readonly availability: "24/7";
19
+ }>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Technik von hobex fuer Haendler mit hobex-Terminal, rund um die Uhr
3
+ * erreichbar. Quelle: Angabe des Inhabers am 11.11.2026 („hobex Technik
4
+ * 0662 225588“); es ist die Durchwahl 88 der Zentrale +43 662 2255-0 (hobex,
5
+ * „Zahlen & Fakten“).
6
+ *
7
+ * `phone` international (fuer einen `tel:`-Link nur Ziffern und `+` daraus
8
+ * nehmen), `display` so, wie man sie in Oesterreich liest und waehlt.
9
+ * Gedacht fuer die Stellen, an denen hobex helfen kann: Stoerung beim
10
+ * hobex-Host, Terminal nicht betriebsbereit, TID passt nicht, das Terminal hat
11
+ * geantwortet und kennt den Ausgang nicht -- nie fuer Fehler im eigenen Netz
12
+ * oder an Kasseneck Connect. Die Kasse zeigt sie in einem eigenen Fenster mit
13
+ * den Angaben, die hobex fragt (Beschriftungen `hobex_help.*` im Katalog).
14
+ */
15
+ export const HOBEX_SUPPORT = Object.freeze({
16
+ phone: '+43 662 2255-88',
17
+ display: '0662 2255-88',
18
+ availability: '24/7',
19
+ });
@@ -40,7 +40,7 @@ import { TECS_CODES } from './tecs-codes.js';
40
40
  /** Der Satz fuer den Bediener je Grund, deutsch. */
41
41
  export const HPS_REASON_HINTS = {
42
42
  approved: 'Vom Terminal genehmigt.',
43
- approvedWithCondition: 'Das Terminal meldet eine Genehmigung mit Vorbehalt (etwa nur über einen Teilbetrag). Ob und in welcher Höhe belastet wurde, bitte am Terminalbeleg prüfen – nicht erneut kassieren, bevor es geklärt ist.',
43
+ approvedWithCondition: 'Das Terminal meldet eine Genehmigung mit Vorbehalt (etwa nur über einen Teilbetrag). Ob und in welcher Höhe belastet wurde, weiß hobex – nicht erneut kassieren, bevor es geklärt ist.',
44
44
  aborted: 'Der Vorgang wurde abgebrochen. Es wurde kein Geld bewegt.',
45
45
  noCard: 'Es wurde keine Karte vorgehalten. Es wurde kein Geld bewegt – bitte erneut versuchen.',
46
46
  cardReadFailed: 'Die Karte konnte nicht gelesen werden. Es wurde kein Geld bewegt – bitte erneut versuchen, notfalls die Karte stecken statt auflegen.',
@@ -43,4 +43,4 @@
43
43
  export { StripeLinkMode, type StripeLinkModeKey } from '../enums/index.js';
44
44
  export { type CreateStripeLinkOptions, type StripeCaptureResult, createStripeLink, stripeCaptureIntent, } from './stripe.js';
45
45
  export { type HobexPayOptions, type HobexRefundOptions, type HobexTransactionIdOptions, hobexPay, hobexRefund, newHobexTransactionId, } from './hobex.js';
46
- export { type CardPaymentOutcome, type HpsConnectClient, type HpsConnectCancelOptions, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, type HpsCancelOptions, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, type HpsPaymentOptions, type HpsPayments, type HpsPaymentResult, type HpsPaymentsOptions, type HpsRefundOptions, type HpsTransactionIdGeneratorOptions, type HpsTransactionResponse, ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
46
+ export { type CardPaymentOutcome, type HpsConnectClient, type HpsConnectCancelOptions, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, type HpsCancelOptions, type HpsClarifyOptions, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, type HpsPaymentOptions, type HpsPayments, type HpsPaymentResult, type HpsPaymentsOptions, type HpsRefundOptions, type HpsTransactionIdGeneratorOptions, type HpsTransactionResponse, ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HOBEX_SUPPORT, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
@@ -43,4 +43,4 @@
43
43
  export { StripeLinkMode } from '../enums/index.js';
44
44
  export { createStripeLink, stripeCaptureIntent, } from './stripe.js';
45
45
  export { hobexPay, hobexRefund, newHobexTransactionId, } from './hobex.js';
46
- export { ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
46
+ export { ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HOBEX_SUPPORT, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
@@ -21,7 +21,7 @@ import { KasseneckApiError } from '../client/errors.js';
21
21
  * ueber `KasseneckApiError.code` lesbar; die Kasse braucht dafuer einen
22
22
  * Rueckfallzweig.
23
23
  */
24
- export declare const POS_ERROR_CODES: readonly ["account_not_found", "action_confirmation_required", "admin_required", "after_count_not_permitted", "api_not_approved", "app_check_invalid", "app_check_missing", "article_not_found", "article_not_in_scope", "article_not_tracked", "cash_movement_exceeds_balance", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "comment_required", "count_already_voided", "count_not_found", "deposit_follows_item", "deposit_not_enabled", "deposit_return_not_offered", "deposit_set_by_server", "deposit_type_in_use", "deposit_type_not_found", "deposit_type_not_issued", "device_not_found", "dialect_mismatch", "drawer_inactive", "drawer_not_found", "filler_role_required", "idempotency_conflict", "idempotency_key_required", "internal_translation_error", "invalid_amount", "invalid_cursor", "invalid_denominations", "invalid_deposit", "invalid_deposit_quantity", "invalid_discount_preset", "invalid_item_kind", "invalid_movement_type", "invalid_quantity", "invalid_serial", "live_not_enabled", "location_inactive", "location_not_found", "logo_invalid", "logo_invalid_type", "logo_too_large", "method_not_allowed", "mfa_required", "module_inactive", "not_found", "not_permitted", "note_required", "password_change_required", "print_job_not_found", "print_layout_failed", "printer_not_found", "recount_exhausted", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "serial_already_counted", "serial_not_allowed", "serial_required", "server_error", "session_expired", "session_other_cashregister", "shift_already_open", "shift_closed", "shift_mode_off", "shift_not_open", "stocktake_closed", "stocktake_closing", "stocktake_not_found", "stocktake_not_open", "tip_payout_exceeds_claim", "too_many_counts", "too_many_deposit_types", "transfer_same_drawer", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
24
+ export declare const POS_ERROR_CODES: readonly ["account_not_found", "action_confirmation_required", "admin_required", "after_count_not_permitted", "api_not_approved", "app_check_invalid", "app_check_missing", "article_not_found", "article_not_in_scope", "article_not_tracked", "cash_movement_exceeds_balance", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "comment_required", "count_already_voided", "count_not_found", "deposit_follows_item", "deposit_not_enabled", "deposit_return_not_offered", "deposit_set_by_server", "deposit_type_in_use", "deposit_type_not_found", "deposit_type_not_issued", "device_not_found", "dialect_mismatch", "drawer_inactive", "drawer_not_found", "filler_role_required", "idempotency_conflict", "idempotency_key_required", "internal_translation_error", "invalid_amount", "invalid_cursor", "invalid_denominations", "invalid_deposit", "invalid_deposit_quantity", "invalid_discount_preset", "invalid_item_kind", "invalid_movement_type", "invalid_quantity", "invalid_serial", "live_not_enabled", "location_inactive", "location_not_found", "logo_invalid", "logo_invalid_type", "logo_too_large", "method_not_allowed", "mfa_required", "module_inactive", "not_a_person_login", "not_found", "not_permitted", "note_required", "password_change_required", "print_job_not_found", "print_layout_failed", "printer_not_found", "recount_exhausted", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "second_factor_required", "serial_already_counted", "serial_not_allowed", "serial_required", "server_error", "session_expired", "session_other_cashregister", "shift_already_open", "shift_closed", "shift_mode_off", "shift_not_open", "stocktake_closed", "stocktake_closing", "stocktake_not_found", "stocktake_not_open", "tip_payout_exceeds_claim", "too_many_counts", "too_many_deposit_types", "transfer_same_drawer", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
25
25
  export type PosErrorCode = typeof POS_ERROR_CODES[number];
26
26
  export declare function isPosErrorCode(value: unknown): value is PosErrorCode;
27
27
  /** Der Code eines geworfenen Fehlers, wenn er in [POS_ERROR_CODES] steht; sonst `undefined`. */
@@ -74,6 +74,7 @@ export const POS_ERROR_CODES = Object.freeze([
74
74
  'method_not_allowed',
75
75
  'mfa_required',
76
76
  'module_inactive',
77
+ 'not_a_person_login',
77
78
  'not_found',
78
79
  'not_permitted',
79
80
  'note_required',
@@ -6,7 +6,7 @@
6
6
  * die Backend-Functions (die Rewrites-Waechter der Web-App leiten daraus ab)
7
7
  * und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
8
8
  */
9
- export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, type PosTipMode, type PosCheckoutMode, type PosCardProvider, type PosReceiptOutput, type PosShortcutAction, type PosShortcutMap, POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, type PosLayout, type PosCategoryPosition, type PosTileHeight, type PosPrinterType, type PosTerminalVia, type PosTerminalType, type PosPaperSize, type PosCodePage, type PosCut, type PosDrawerAutoOpen, type PosQrMode, type PosLogoSize, type PosSettingsFontSize, type PosTileStyle, type PosAutoLogoutMinutes, type PosDiscount, type PosWatermarkSide, type PosWatermarkStrength, type PosLogoScale, type PosWatermarkScale, type PosDoneScreenSeconds, type PosToggleMap, type PosBusinessSettings, type PosDeviceSettings, type PosSettings, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, tipKeptFor, type TipKeptDecision, DISCOUNT_PRESET_KIND, type PosDiscountPreset, type PosDiscountPresetKind, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, type PosOpen, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict, THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_MODE, type PosTipKeptMode, CART_WIDTH, type PosTipKind, type PosCartWidth, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
9
+ export { type PosTheme, type PosFontSize, type PosWatermark, type PosQuantity, type PosTipMode, type PosCheckoutMode, type PosCardProvider, type PosReceiptOutput, type PosShortcutAction, type PosShortcutMap, POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, type PosLayout, type PosCategoryPosition, type PosTileHeight, type PosPrinterType, type PosTerminalVia, type PosTerminalType, type PosPaperSize, type PosCodePage, type PosCut, type PosDrawerAutoOpen, type PosQrMode, type PosLogoSize, type PosSettingsFontSize, type PosTileStyle, type PosAutoLogoutMinutes, type PosDiscount, type PosWatermarkSide, type PosWatermarkStrength, type PosLogoScale, type PosWatermarkScale, type PosDoneScreenSeconds, type PosToggleMap, type PosBusinessSettings, type PosDeviceSettings, type PosSettings, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, posTipCardKeptByDefault, posTipCardKeptMode, posTipSelfPayout, tipKeptFor, type TipKeptDecision, type TipPaymentKind, DISCOUNT_PRESET_KIND, type PosDiscountPreset, type PosDiscountPresetKind, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, type PosOpen, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict, THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_MODE, TIP_CARD_KEPT_MODE, type PosTipKeptMode, CART_WIDTH, type PosTipKind, type PosCartWidth, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
10
10
  export { type ArticleGroup, type ArticleGroupPayload, fromArticleGroupPayload, type PosArticle, type PosArticlePayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, type QuantityRule, type QuantityDefaults, quantityRuleForUnit, quantityDefaults, allowedQuantity, isBookableArticle, tilePrompts, } from './artikel.js';
11
11
  export { REFERENCE_MODES, type ReferenceMode, type PosReference, REFERENCE_INPUT_MAX, REFERENCE_LABEL_MAX, REFERENCE_HINT_MAX, REFERENCE_PATTERN_MAX, REFERENCE_PATTERN_TEMPLATES, cleanReferenceText, isValidReferencePattern, isDigitsOnlyPattern, type ReferenceCheckResult, checkReference, referenceLineName, fromReferencePayload, } from './kachel-referenz.js';
12
12
  export { ADD_ONS_MAX, ADD_ON_BLOCK_REASONS, type AddOnBlockReason, isSelectableAddOn, addOnsFor, addOnReferencesValid, addOnsOfItem, addOnRemap, addOnDisplayOrder, orderAddOnLines, } from './zusaetze.js';
@@ -19,7 +19,7 @@ export { distributeDiscount } from '../receipt/discount.js';
19
19
  export { cancelScopeOf, receiptsScopeOf, stockViewOf, voucherPermsOf, depositReturnOf, type VoucherPerms, type RegisterScope, type RegisterUserPerms } from '../register/pairing.js';
20
20
  export { type NetworkPrinter, type PrintJob, type PrintJobStatus, PRINT_JOB_STATUSES, type PrintJobSource, PRINT_JOB_SOURCES, isPrintJobFinished, type CreatePrintJobOptions, listMyPrinters, createPrintJob, getPrintJob, } from './drucker.js';
21
21
  export { type PrinterCatalogEntry, type PrinterCatalogValues, type PrinterCatalogValueField, type PrinterCatalogApproval, type PrinterDeviceTest, type PrinterCatalogSettings, type PrinterCatalogDeviceSettings, type PrinterCatalogCut, type PrinterCatalogQrMode, printerCatalogEntry, printerCatalogSettings, } from './drucker-katalog.js';
22
- export { listMyTipRecipients } from './trinkgeld.js';
22
+ export { listMyTipRecipients, getMyTipBalance, tipStatus, type GetMyTipBalanceOptions, type TipStatus, type TipStatusKind } from './trinkgeld.js';
23
23
  export { posDiscountPresets, discountPresetChipText, discountChipsFromPresets, checkDiscountPresets, discountBlockLines, INVALID_DISCOUNT_PRESET, DISCOUNT_PRESETS_MAX, DISCOUNT_PRESET_NAME_MAX, DISCOUNT_PRESET_PERCENT_BP, DISCOUNT_PRESET_AMOUNT_CENTS, DISCOUNT_PRESET_MESSAGES, type DiscountPresetReason, type DiscountPresetError, type DiscountPresetsCheck, type DiscountBlockLine, type DiscountTotal, } from './rabatt-vorlagen.js';
24
24
  export { depFolderName } from './dep.js';
25
25
  export { type RegisterInspectionInfo, type RegisterInspectionSignature, type InspectionSignatureStatus, type InspectionInfoRow, type InspectionInfoRowKey, type InspectionInfoSection, type InspectionInfoLinesOptions, getRegisterInspectionInfo, inspectionInfoRows, inspectionInfoLines, } from './kasseninfo.js';
@@ -31,9 +31,9 @@ export type { Stocktake, StocktakeItem, StocktakeCount, StocktakeCountResult, St
31
31
  export type { StocktakeStatus } from '../inventory/vertrag.js';
32
32
  export { VOUCHER_KINDS, VOUCHER_STATUSES, checkVoucher, reprintVoucherLabel, VOUCHER_SETTINGS_DEFAULTS, posVoucherSettingsFromWire, VOUCHER_PAYOUTS, VOUCHER_TYPE_KINDS, VOUCHER_AMOUNT_MODES, VOUCHER_TYPE_VALIDITY_PATTERNS, EXTERNAL_VOUCHERS, type PosExternalVouchers, type VoucherKind, type VoucherStatus, type VoucherValidity, type VoucherArticle, type VoucherCheck, type PosVoucherSettings, type PosVoucherReturnType, type VoucherPayout, type VoucherTypeKind, type PosVoucherType, type VoucherLabelTemplate, } from './gutschein.js';
33
33
  export { type GetMyDrawerStateOptions, type OpenMyShiftOptions, type RecordMyCashMovementOptions, type DrawerOpeningEntry, type LogMyDrawerOpeningsOptions, type GetMyShiftReportOptions, type TipPayout, type CloseMyShiftOptions, type AfterCountOption, type RecordMyShiftCountOptions, getMyDrawerState, openMyShift, recordMyCashMovement, logMyDrawerOpenings, getMyShiftReport, closeMyShift, recordMyShiftCount, sumDenominations, parseCentsAllowZero, newIdempotencyKey, shiftTipLines, durationText, type ShiftTipLine, type ShiftTipLineKey, } from './schicht.js';
34
- export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, type AfterCountType, type AfterCount, EXPECTED_PART_KEYS, DIFFERENCE_PART_TYPES, type ExpectedPartKey, type ShiftExpectedPart, type DifferencePartType, type ShiftDifferencePart, type LastShift, type ShiftCountResult, type EurDenomination, type MovementType, type ManualMovementType, type CashLocation, type OpeningReason, type ManualOpeningReason, type ShiftReceiptKind, type ShiftStatus, type ShiftActorRole, type Denominations, type ShiftActor, type DrawerInfo, type DrawerRights, type NonCashAmount, type ShiftTipTotals, type ShiftTip, type ShiftOwnerTip, type ShiftDiscount, type ShiftRunningTotals, type ShiftReconciliation, type Shift, type TipClaim, type DrawerOpening, type DrawerState, type CashMovement, type ShiftReceiptHeader, type ShiftReceiptMovement, type ShiftReceiptTip, type ShiftSummaryReceipt, type CashMovementReceipt, type ShiftReceipt, type OpenShiftResult, type CashMovementResult, type DrawerOpeningsResult, type ShiftReport, type CloseShiftResult, } from './schicht-typen.js';
34
+ export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, type AfterCountType, type AfterCount, EXPECTED_PART_KEYS, DIFFERENCE_PART_TYPES, type ExpectedPartKey, type ShiftExpectedPart, type DifferencePartType, type ShiftDifferencePart, type LastShift, type ShiftCountResult, type EurDenomination, type MovementType, type ManualMovementType, type CashLocation, type OpeningReason, type ManualOpeningReason, type ShiftReceiptKind, type ShiftStatus, type ShiftActorRole, type Denominations, type ShiftActor, type DrawerInfo, type DrawerRights, type NonCashAmount, type ShiftTipTotals, type ShiftTip, type ShiftOwnerTip, type ShiftDiscount, type ShiftRunningTotals, type ShiftReconciliation, type Shift, type TipClaim, type DrawerOpening, type DrawerState, type CashMovement, type ShiftReceiptHeader, type ShiftReceiptMovement, type ShiftReceiptTip, TIP_CLAIM_SCOPES, type TipClaimScope, type TipBalance, type TipBalanceOtherDrawer, type ShiftSummaryReceipt, type CashMovementReceipt, type ShiftReceipt, type OpenShiftResult, type CashMovementResult, type DrawerOpeningsResult, type ShiftReport, type CloseShiftResult, } from './schicht-typen.js';
35
35
  export { type ShiftReceiptLayoutOptions, shiftReceiptLayout, cashMovementLayout } from '../receipt/shift-sheet.js';
36
36
  export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS, type ReceiptOutputKind, type ReceiptOutputResult } from '../models/receipt-output.js';
37
37
  export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
38
- export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, DEPOSIT_ERROR_MESSAGES, depositErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
38
+ export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, DEPOSIT_ERROR_MESSAGES, depositErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, TIP_CLAIM_SCOPE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
39
39
  export { roundUpSuggestions } from './aufrunden.js';
@@ -6,9 +6,9 @@
6
6
  * die Backend-Functions (die Rewrites-Waechter der Web-App leiten daraus ab)
7
7
  * und sprechen den Kassenweg `/api/v3` (Schluessel und Werte englisch).
8
8
  */
9
- export { POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, tipKeptFor, DISCOUNT_PRESET_KIND, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict,
9
+ export { POS_SHORTCUT_ACTIONS, POS_SHORTCUT_DEFAULTS, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, POS_DEVICE_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_FIELDS, POS_BUSINESS_OPTIONAL_CHOICES, POS_DEVICE_OPTIONAL_CHOICES, posTipKeptByDefault, posCustomDiscountAllowed, posTipKeptMode, posTipCardKeptByDefault, posTipCardKeptMode, posTipSelfPayout, tipKeptFor, DISCOUNT_PRESET_KIND, POS_BUSINESS_OPTIONAL_LISTS, posTipKinds, posTipStart, posCartWidth, POS_BUSINESS_VALUES, POS_DEVICE_VALUES, mergePosSettings, sanitizePosSettings, unknownPosSettingValues, posSettingsChanges, POS_SHORTCUT_SHARED_PAIRS, posShortcutConflict,
10
10
  // Die Enums als Laufzeitlisten, benannt nach ihrem Feld.
11
- THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_MODE, CART_WIDTH, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
11
+ THEME, FONT_SIZE, WATERMARK, QUANTITY, TIP_MODE, TIP_KINDS, TIP_START, TIP_KEPT_MODE, TIP_CARD_KEPT_MODE, CART_WIDTH, CHECKOUT_MODE, CARD_PROVIDER, RECEIPT_OUTPUT, LAYOUT, CATEGORY_POSITION, TILE_HEIGHT, PRINTER_TYPE, TERMINAL_VIA, TERMINAL_TYPE, PAPER_SIZE, CODE_PAGE, CUT, DRAWER_AUTO_OPEN, QR_MODE, LOGO_SIZE, SETTINGS_FONT_SIZE, TILE_STYLE, AUTO_LOGOUT_MINUTES, DISCOUNT, WATERMARK_SIDE, WATERMARK_STRENGTH, LOGO_SCALE, WATERMARK_SCALE, DONE_SCREEN_SECONDS, } from './settings.js';
12
12
  export { fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, QUANTITY_RULES, quantityRuleForUnit, quantityDefaults, allowedQuantity, isBookableArticle, tilePrompts, } from './artikel.js';
13
13
  export { REFERENCE_MODES, REFERENCE_INPUT_MAX, REFERENCE_LABEL_MAX, REFERENCE_HINT_MAX, REFERENCE_PATTERN_MAX, REFERENCE_PATTERN_TEMPLATES, cleanReferenceText, isValidReferencePattern, isDigitsOnlyPattern, checkReference, referenceLineName, fromReferencePayload, } from './kachel-referenz.js';
14
14
  export { ADD_ONS_MAX, ADD_ON_BLOCK_REASONS, isSelectableAddOn, addOnsFor, addOnReferencesValid, addOnsOfItem, addOnRemap, addOnDisplayOrder, orderAddOnLines, } from './zusaetze.js';
@@ -26,7 +26,7 @@ export { PRINT_JOB_STATUSES, PRINT_JOB_SOURCES, isPrintJobFinished, listMyPrinte
26
26
  // Druckerkatalog (Connect-Einrichtung mit einem Klick): Normierung, Pruefung und der Katalog selbst bleiben im Modul,
27
27
  // nach aussen gehen nur das Erkennen und die vorgeschlagenen Einstellungen.
28
28
  export { printerCatalogEntry, printerCatalogSettings, } from './drucker-katalog.js';
29
- export { listMyTipRecipients } from './trinkgeld.js';
29
+ export { listMyTipRecipients, getMyTipBalance, tipStatus } from './trinkgeld.js';
30
30
  export { posDiscountPresets, discountPresetChipText, discountChipsFromPresets, checkDiscountPresets, discountBlockLines, INVALID_DISCOUNT_PRESET, DISCOUNT_PRESETS_MAX, DISCOUNT_PRESET_NAME_MAX, DISCOUNT_PRESET_PERCENT_BP, DISCOUNT_PRESET_AMOUNT_CENTS, DISCOUNT_PRESET_MESSAGES, } from './rabatt-vorlagen.js';
31
31
  // Prüfung (DEP) an der Kasse: Ordner auf dem USB-Stick (gleich in Web-Kasse und Kassen-App).
32
32
  export { depFolderName } from './dep.js';
@@ -41,12 +41,12 @@ export { listMyStocktakes, listMyStocktakeItems, listMyStocktakeCounts, recordMy
41
41
  export { VOUCHER_KINDS, VOUCHER_STATUSES, checkVoucher, reprintVoucherLabel, VOUCHER_SETTINGS_DEFAULTS, posVoucherSettingsFromWire, VOUCHER_PAYOUTS, VOUCHER_TYPE_KINDS, VOUCHER_AMOUNT_MODES, VOUCHER_TYPE_VALIDITY_PATTERNS, EXTERNAL_VOUCHERS, } from './gutschein.js';
42
42
  // Schicht, Kassenstand und Lade-Protokoll (1.9.0): Aufrufe, Kataloge, Helfer, Bons.
43
43
  export { getMyDrawerState, openMyShift, recordMyCashMovement, logMyDrawerOpenings, getMyShiftReport, closeMyShift, recordMyShiftCount, sumDenominations, parseCentsAllowZero, newIdempotencyKey, shiftTipLines, durationText, } from './schicht.js';
44
- export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, EXPECTED_PART_KEYS, DIFFERENCE_PART_TYPES, } from './schicht-typen.js';
44
+ export { EUR_DENOMINATIONS, MOVEMENT_TYPES, MANUAL_MOVEMENT_TYPES, CASH_LOCATIONS, OPENING_REASONS, MANUAL_OPENING_REASONS, SHIFT_RECEIPT_KINDS, AFTER_COUNT_TYPES, EXPECTED_PART_KEYS, DIFFERENCE_PART_TYPES, TIP_CLAIM_SCOPES, } from './schicht-typen.js';
45
45
  export { shiftReceiptLayout, cashMovementLayout } from '../receipt/shift-sheet.js';
46
46
  // Ausgaben eines Belegs (Belegdetail: Art und Ergebnis -> Beschriftung); dieselben Listen wie an der Wurzel.
47
47
  export { RECEIPT_OUTPUT_KINDS, RECEIPT_OUTPUT_RESULTS } from '../models/receipt-output.js';
48
48
  // Rueckgabe-Wahl beim Storno (Kassen-Dialog); dieselbe Liste wie an der Wurzel.
49
49
  export { RETURN_DISPOSITIONS, isReturnDisposition } from '../models/cancellation.js';
50
50
  // Was die Kasse selbst sagt: ein Katalog fuer Browser-Kasse und App.
51
- export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, DEPOSIT_ERROR_MESSAGES, depositErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, } from './texte.js';
51
+ export { MESSAGES, ERROR_RULES, ERROR_CODE_RULES, ERROR_OUTCOME_RULES, CALLS_WITH_EFFECT, findErrorRule, messageOutcome, messageText, messageAppliesTo, RECEIPT_EMAIL_ERROR_MESSAGES, receiptEmailErrorMessage, CANCELLATION_PAYMENT_ERROR_MESSAGES, cancellationPaymentErrorMessage, CANCELLATION_VOUCHER_ERROR_MESSAGES, cancellationErrorMessage, VOUCHER_ERROR_MESSAGES, voucherErrorMessage, DEPOSIT_ERROR_MESSAGES, depositErrorMessage, EXTERNAL_VOUCHER_TILE_MESSAGES, EXTERNAL_VOUCHER_ARTICLE_MESSAGES, externalVoucherArticleErrorMessage, EXTERNAL_VOUCHERS_LABELS, EXTERNAL_VOUCHER_KIND_LABELS, TIP_KEPT_MODE_LABELS, TIP_CLAIM_SCOPE_LABELS, LABELS, labelText, RETURN_DISPOSITION_LABELS, receiptOutputLabel, } from './texte.js';
52
52
  export { roundUpSuggestions } from './aufrunden.js';
@@ -12,7 +12,7 @@
12
12
  * stehen im Modell genau dann, wenn der Server sie sendet.
13
13
  */
14
14
  import { type ValidationScope } from '../client/errors.js';
15
- import type { CashMovement, CashMovementReceipt, CashMovementResult, DrawerOpeningsResult, OpenShiftResult, ShiftReport, CloseShiftResult, ShiftCountResult, DrawerState, Shift, ShiftSummaryReceipt } from './schicht-typen.js';
15
+ import type { CashMovement, CashMovementReceipt, CashMovementResult, DrawerOpeningsResult, OpenShiftResult, ShiftReport, CloseShiftResult, ShiftCountResult, DrawerState, Shift, ShiftSummaryReceipt, TipBalance } from './schicht-typen.js';
16
16
  type Roh = Record<string, unknown>;
17
17
  /** Wer liest (fuer die Meldung) und wo im Rumpf. */
18
18
  export interface Ort {
@@ -26,6 +26,8 @@ export declare function pflichtObjekt(ort: Ort, w: unknown): Roh;
26
26
  /** Eine Schicht; was nur mit `cashView` kommt, steht nur, wenn gesendet. */
27
27
  export declare function schicht(ort: Ort, w: unknown): Shift;
28
28
  export declare function ladeStand(ort: Ort, w: unknown): DrawerState;
29
+ /** „Mein Trinkgeld“ (getMyTipBalance): Stand der angemeldeten Person, Drahtform Feld fuer Feld. */
30
+ export declare function tipStand(ort: Ort, w: unknown): TipBalance;
29
31
  export declare function bewegung(ort: Ort, w: unknown): CashMovement;
30
32
  /** Bon-Daten eines Z- oder X-Bons; eine andere Art ist ein Fehler. */
31
33
  export declare function schichtBon(ort: Ort, w: unknown): ShiftSummaryReceipt;
@@ -95,7 +95,7 @@ function unbar(ort, w) {
95
95
  }
96
96
  function trinkgeld(ort, w) {
97
97
  const o = pflichtObjekt(ort, w);
98
- return {
98
+ const raus = {
99
99
  registerUserId: kennung(ort, o, 'registerUserId'),
100
100
  name: text(o.name),
101
101
  receivedImmediatelyCents: ganzzahl(ort, o, 'receivedImmediatelyCents'),
@@ -104,6 +104,10 @@ function trinkgeld(ort, w) {
104
104
  // Fehlt bei einem Backend vor der Regel R62: dann 0, statt die ganze Antwort zu verwerfen.
105
105
  refundedByEmployeeCents: o.refundedByEmployeeCents === undefined || o.refundedByEmployeeCents === null ? 0 : ganzzahl(ort, o, 'refundedByEmployeeCents'),
106
106
  };
107
+ // Kartentrinkgeld bar genommen: der Server sendet es nur, wenn es eines gibt -- gelesen wie gesendet.
108
+ if (o.cardTipsTakenCents !== undefined && o.cardTipsTakenCents !== null)
109
+ raus.cardTipsTakenCents = ganzzahl(ort, o, 'cardTipsTakenCents');
110
+ return raus;
107
111
  }
108
112
  /** Trinkgeld mit offenem Anspruch (Kassenstand, Bon). */
109
113
  function trinkgeldMitOffen(ort, w) {
@@ -280,6 +284,21 @@ export function ladeStand(ort, w) {
280
284
  wennWert(raus.drawer, lade, 'changeFloatCents', () => ganzzahl(ladeOrt, lade, 'changeFloatCents'));
281
285
  return raus;
282
286
  }
287
+ /** „Mein Trinkgeld“ (getMyTipBalance): Stand der angemeldeten Person, Drahtform Feld fuer Feld. */
288
+ export function tipStand(ort, w) {
289
+ const o = pflichtObjekt(ort, w);
290
+ return {
291
+ drawerId: kennung(ort, o, 'drawerId'),
292
+ claimScope: kennung(ort, o, 'claimScope'),
293
+ openCents: ganzzahl(ort, o, 'openCents'),
294
+ keptTodayCents: ganzzahl(ort, o, 'keptTodayCents'),
295
+ currency: kennung(ort, o, 'currency'),
296
+ otherDrawers: liste(ort, o, 'otherDrawers', (lOrt, lw) => {
297
+ const l = pflichtObjekt(lOrt, lw);
298
+ return { drawerId: kennung(lOrt, l, 'drawerId'), name: text(l.name), openCents: ganzzahl(lOrt, l, 'openCents') };
299
+ }),
300
+ };
301
+ }
283
302
  export function bewegung(ort, w) {
284
303
  const o = pflichtObjekt(ort, w);
285
304
  const empfaenger = objekt(o.recipient);
@@ -367,6 +386,8 @@ export function schichtBon(ort, w) {
367
386
  wennWert(r, o, 'interimDifferenceCents', () => ganzzahl(ort, o, 'interimDifferenceCents'));
368
387
  // Nur Anzeige: gewaehrte Rabatte je Name; der Server sendet sie erst ab dem ersten Rabatt.
369
388
  wennWert(r, o, 'discounts', () => liste(ort, o, 'discounts', rabatt));
389
+ // Kartentrinkgeld bar aus der Lade genommen (Summe); nur mit Karten-direkt.
390
+ wennWert(r, o, 'cardTipsTakenCents', () => ganzzahl(ort, o, 'cardTipsTakenCents'));
370
391
  wennWert(r, o, 'differenceParts', () => liste(ort, o, 'differenceParts', differenzTeil));
371
392
  wennDa(r, o, 'countedBeforePayoutCents', () => ganzzahlOderNull(ort, o, 'countedBeforePayoutCents'));
372
393
  wennDa(r, o, 'countedBeforePayoutDenominations', () => stueckelung(ort, o, 'countedBeforePayoutDenominations'));