@kreiseck/kasseneck-api 1.2.2 → 1.4.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.
- package/CHANGELOG.md +99 -0
- package/README.md +119 -3
- package/dist/cjs/client/aufrufe.d.ts +2 -2
- package/dist/cjs/client/aufrufe.js +30 -0
- package/dist/cjs/inventory/api.d.ts +45 -0
- package/dist/cjs/inventory/api.js +38 -0
- package/dist/cjs/inventory/auth.d.ts +17 -0
- package/dist/cjs/inventory/auth.js +27 -0
- package/dist/cjs/inventory/endpunkte.d.ts +71 -0
- package/dist/cjs/inventory/endpunkte.js +285 -0
- package/dist/cjs/inventory/fehler.d.ts +33 -0
- package/dist/cjs/inventory/fehler.js +47 -0
- package/dist/cjs/inventory/index.d.ts +19 -0
- package/dist/cjs/inventory/index.js +64 -0
- package/dist/cjs/inventory/lesen.d.ts +38 -0
- package/dist/cjs/inventory/lesen.js +294 -0
- package/dist/cjs/inventory/typen.d.ts +319 -0
- package/dist/cjs/inventory/typen.js +14 -0
- package/dist/cjs/inventory/vertrag.d.ts +76 -0
- package/dist/cjs/inventory/vertrag.js +166 -0
- package/dist/cjs/inventory/webhook.d.ts +50 -0
- package/dist/cjs/inventory/webhook.js +110 -0
- package/dist/cjs/pos/artikel.d.ts +20 -0
- package/dist/cjs/pos/artikel.js +8 -0
- package/dist/cjs/pos/index.d.ts +1 -1
- package/dist/cjs/pos/index.js +2 -1
- package/dist/cjs/pos/texte.d.ts +41 -0
- package/dist/cjs/pos/texte.js +29 -1
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +2 -2
- package/dist/esm/client/aufrufe.js +30 -0
- package/dist/esm/inventory/api.d.ts +45 -0
- package/dist/esm/inventory/api.js +35 -0
- package/dist/esm/inventory/auth.d.ts +17 -0
- package/dist/esm/inventory/auth.js +24 -0
- package/dist/esm/inventory/endpunkte.d.ts +71 -0
- package/dist/esm/inventory/endpunkte.js +266 -0
- package/dist/esm/inventory/fehler.d.ts +33 -0
- package/dist/esm/inventory/fehler.js +40 -0
- package/dist/esm/inventory/index.d.ts +19 -0
- package/dist/esm/inventory/index.js +18 -0
- package/dist/esm/inventory/lesen.d.ts +38 -0
- package/dist/esm/inventory/lesen.js +278 -0
- package/dist/esm/inventory/typen.d.ts +319 -0
- package/dist/esm/inventory/typen.js +13 -0
- package/dist/esm/inventory/vertrag.d.ts +76 -0
- package/dist/esm/inventory/vertrag.js +163 -0
- package/dist/esm/inventory/webhook.d.ts +50 -0
- package/dist/esm/inventory/webhook.js +101 -0
- package/dist/esm/pos/artikel.d.ts +20 -0
- package/dist/esm/pos/artikel.js +8 -0
- package/dist/esm/pos/index.d.ts +1 -1
- package/dist/esm/pos/index.js +1 -1
- package/dist/esm/pos/texte.d.ts +41 -0
- package/dist/esm/pos/texte.js +28 -0
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/invoice-api.schema.json +1 -1
- package/fixtures/invoice-texts.json +1 -1
- package/fixtures/pos-texts.json +36 -1
- package/fixtures/surface.json +161 -3
- package/fixtures/v3/README.md +9 -1
- package/fixtures/v3/antworten/belege.json +2 -2
- package/fixtures/v3/antworten/belegmail.json +2 -2
- package/fixtures/v3/antworten/kasse-belege.json +2 -2
- package/fixtures/v3/antworten/kasse.json +3 -3
- package/fixtures/v3/antworten/lager.json +1520 -0
- package/fixtures/v3/antworten/rechnungen.json +2 -2
- package/fixtures/v3/antworten/storno.json +2 -2
- package/fixtures/v3/stored/belege.json +2 -2
- package/fixtures/v3/stored/kasse.json +404 -4
- package/fixtures/v3/stored/rechnungen.json +2 -2
- package/fixtures/v3/v3-vokabular.json +423 -6
- package/fixtures/v3/zahlbetrag-faelle.json +2 -2
- package/package.json +14 -2
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Der Vertrag der Lager-API (Backend Stufe 5a) als Daten: Endpunkte,
|
|
3
|
+
* Wertkataloge, Ereignisse und Fehlercodes, englisch wie am Draht `/v3`.
|
|
4
|
+
*
|
|
5
|
+
* Quelle ist der Vertrags-Export des Backends (`fixtures/v3/v3-vokabular.json`):
|
|
6
|
+
* `endpoints.public`, die Kataloge `STANDORT_TYP`, `BEWEGUNG_ART`,
|
|
7
|
+
* `BEWEGUNG_QUELLE`, `LAGER_ZUSTAND`, `LAGER_URSACHE`, `ZUSTELLUNG` und
|
|
8
|
+
* `events`. `test/inventory.test.ts` haelt jede Liste deckungsgleich mit
|
|
9
|
+
* dieser Datei; nichts hier wird geraten.
|
|
10
|
+
*/
|
|
11
|
+
/** Die 14 Endpunkte, in der Reihenfolge von `endpoints.public`. */
|
|
12
|
+
export declare const INVENTORY_ENDPOINTS: readonly ["getArticle", "listArticles", "lookupArticleByCode", "listLocations", "getStock", "listStock", "listStockMovements", "createWebhook", "updateWebhook", "deleteWebhook", "listWebhooks", "sendWebhookTest", "rotateWebhookSecret", "listWebhookDeliveries"];
|
|
13
|
+
export type InventoryEndpoint = (typeof INVENTORY_ENDPOINTS)[number];
|
|
14
|
+
/** Art eines Standorts (Katalog `STANDORT_TYP`). */
|
|
15
|
+
export declare const LOCATION_TYPES: readonly ["warehouse", "store", "vehicle", "other"];
|
|
16
|
+
export type LocationType = (typeof LOCATION_TYPES)[number];
|
|
17
|
+
/**
|
|
18
|
+
* Art einer Lagerbewegung (Katalog `BEWEGUNG_ART`); zugleich der Filter `type`.
|
|
19
|
+
* `goods_receipt` ist der Wareneingang, `takeover` der uebernommene Anfangsbestand
|
|
20
|
+
* (auch per Import). `receipt` gibt es hier nicht: das ist der Kassenbeleg (Quelle).
|
|
21
|
+
*/
|
|
22
|
+
export declare const STOCK_MOVEMENT_TYPES: readonly ["sale", "goods_receipt", "loss", "return", "transfer_out", "transfer_in", "condition_out", "condition_in", "stocktake", "adjustment", "takeover", "reversal", "revaluation", "method_change"];
|
|
23
|
+
export type StockMovementType = (typeof STOCK_MOVEMENT_TYPES)[number];
|
|
24
|
+
/**
|
|
25
|
+
* Woher eine Bewegung kommt (Katalog `BEWEGUNG_QUELLE`); zugleich der Filter
|
|
26
|
+
* `source`. `receipt` ist der Kassenbeleg wie ueberall in der API (der
|
|
27
|
+
* Wareneingang ist die Bewegungsart `goods_receipt`).
|
|
28
|
+
*/
|
|
29
|
+
export declare const STOCK_MOVEMENT_SOURCES: readonly ["receipt", "invoice", "cancellation", "credit_note", "panel", "register", "api", "stocktake", "system"];
|
|
30
|
+
export type StockMovementSource = (typeof STOCK_MOVEMENT_SOURCES)[number];
|
|
31
|
+
/** Zustand der Ware an einer Bewegung (Katalog `LAGER_ZUSTAND`). */
|
|
32
|
+
export declare const STOCK_CONDITIONS: readonly ["sellable", "defective"];
|
|
33
|
+
export type StockCondition = (typeof STOCK_CONDITIONS)[number];
|
|
34
|
+
/**
|
|
35
|
+
* Ursache eines `stock.changed` (Katalog `LAGER_URSACHE`), abgeleitet aus der
|
|
36
|
+
* juengsten Bewegung mit Mengenwirkung. `other`: keine Regel passt oder es
|
|
37
|
+
* gibt keine Bewegung (dann ist `movementId` `null`).
|
|
38
|
+
*/
|
|
39
|
+
export declare const STOCK_CHANGE_CAUSES: readonly ["sale", "invoice", "credit_note", "cancellation", "goods_receipt", "transfer", "loss", "condition", "reversal", "reservation", "stocktake", "takeover", "other"];
|
|
40
|
+
export type StockChangeCause = (typeof STOCK_CHANGE_CAUSES)[number];
|
|
41
|
+
/** Stand einer Zustellung (Katalog `ZUSTELLUNG`, derselbe wie bei Partner-Webhooks). */
|
|
42
|
+
export declare const WEBHOOK_DELIVERY_STATUSES: readonly ["delivered", "pending", "failed", "dropped"];
|
|
43
|
+
export type WebhookDeliveryStatus = (typeof WEBHOOK_DELIVERY_STATUSES)[number];
|
|
44
|
+
/**
|
|
45
|
+
* Die Ereignisse, die ein Konto-Webhook abonnieren kann (Stufe 5a). Spaetere
|
|
46
|
+
* Stufen ergaenzen `reservation.*` und `variant_group.*`.
|
|
47
|
+
*/
|
|
48
|
+
export declare const INVENTORY_WEBHOOK_EVENTS: readonly ["stock.changed", "stock.below_minimum", "article.created", "article.updated", "article.deactivated"];
|
|
49
|
+
export type InventoryWebhookEventType = (typeof INVENTORY_WEBHOOK_EVENTS)[number];
|
|
50
|
+
/**
|
|
51
|
+
* Die Felder der Huelle jeder Zustellung, in der Reihenfolge am Draht. Statt
|
|
52
|
+
* `partnerId` (Partner-Webhooks) traegt sie `accountId`; `test` steht nur auf
|
|
53
|
+
* Probesendungen.
|
|
54
|
+
*/
|
|
55
|
+
export declare const INVENTORY_WEBHOOK_ENVELOPE_FIELDS: readonly ["id", "type", "createdAt", "accountId", "test", "data"];
|
|
56
|
+
/** Hoechstzahl der Webhooks je Konto (`webhook_limit`, wie bei Partner-Webhooks). */
|
|
57
|
+
export declare const INVENTORY_WEBHOOK_LIMIT = 5;
|
|
58
|
+
/** Groesstes `limit` einer Liste; ohne Angabe liefert der Server 50. */
|
|
59
|
+
export declare const INVENTORY_LIST_LIMIT_MAX = 200;
|
|
60
|
+
/**
|
|
61
|
+
* Die Codes, die die Lager-Endpunkte selbst senden. `validation` traegt
|
|
62
|
+
* `errors: [{ field, message }]`, `rate_limited` traegt `retryAfterSec`
|
|
63
|
+
* (dazu die Kopfzeile `Retry-After`) – auch bei `sendWebhookTest` nach 20
|
|
64
|
+
* Probesendungen je Wiener Kalendertag (dann bis Mitternacht in Wien).
|
|
65
|
+
*/
|
|
66
|
+
export declare const INVENTORY_ERROR_CODES: readonly ["validation", "invalid_cursor", "article_not_found", "webhook_not_found", "webhook_limit", "invalid_webhook_url", "event_not_subscribed", "webhook_inactive", "inventory_api_not_enabled", "module_inactive", "rate_limited", "server_error"];
|
|
67
|
+
export type InventoryErrorCode = (typeof INVENTORY_ERROR_CODES)[number];
|
|
68
|
+
/**
|
|
69
|
+
* Codes, die Anmeldung und Rand auf jedem Lager-Aufruf erzeugen koennen,
|
|
70
|
+
* soweit sie nicht schon in [INVENTORY_ERROR_CODES] stehen: `errorCodes.auth`
|
|
71
|
+
* ohne die des Partner-Zugangs und `errorCodes.edge` (sortiert), zuletzt
|
|
72
|
+
* `route_missing` (Code des Pakets). Dieselbe Ableitung wie bei der
|
|
73
|
+
* Rechnungs-API.
|
|
74
|
+
*/
|
|
75
|
+
export declare const INVENTORY_REQUEST_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
|
|
76
|
+
export type InventoryRequestErrorCode = (typeof INVENTORY_REQUEST_ERROR_CODES)[number];
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Der Vertrag der Lager-API (Backend Stufe 5a) als Daten: Endpunkte,
|
|
3
|
+
* Wertkataloge, Ereignisse und Fehlercodes, englisch wie am Draht `/v3`.
|
|
4
|
+
*
|
|
5
|
+
* Quelle ist der Vertrags-Export des Backends (`fixtures/v3/v3-vokabular.json`):
|
|
6
|
+
* `endpoints.public`, die Kataloge `STANDORT_TYP`, `BEWEGUNG_ART`,
|
|
7
|
+
* `BEWEGUNG_QUELLE`, `LAGER_ZUSTAND`, `LAGER_URSACHE`, `ZUSTELLUNG` und
|
|
8
|
+
* `events`. `test/inventory.test.ts` haelt jede Liste deckungsgleich mit
|
|
9
|
+
* dieser Datei; nichts hier wird geraten.
|
|
10
|
+
*/
|
|
11
|
+
/** Die 14 Endpunkte, in der Reihenfolge von `endpoints.public`. */
|
|
12
|
+
export const INVENTORY_ENDPOINTS = [
|
|
13
|
+
'getArticle',
|
|
14
|
+
'listArticles',
|
|
15
|
+
'lookupArticleByCode',
|
|
16
|
+
'listLocations',
|
|
17
|
+
'getStock',
|
|
18
|
+
'listStock',
|
|
19
|
+
'listStockMovements',
|
|
20
|
+
'createWebhook',
|
|
21
|
+
'updateWebhook',
|
|
22
|
+
'deleteWebhook',
|
|
23
|
+
'listWebhooks',
|
|
24
|
+
'sendWebhookTest',
|
|
25
|
+
'rotateWebhookSecret',
|
|
26
|
+
'listWebhookDeliveries',
|
|
27
|
+
];
|
|
28
|
+
/** Art eines Standorts (Katalog `STANDORT_TYP`). */
|
|
29
|
+
export const LOCATION_TYPES = ['warehouse', 'store', 'vehicle', 'other'];
|
|
30
|
+
/**
|
|
31
|
+
* Art einer Lagerbewegung (Katalog `BEWEGUNG_ART`); zugleich der Filter `type`.
|
|
32
|
+
* `goods_receipt` ist der Wareneingang, `takeover` der uebernommene Anfangsbestand
|
|
33
|
+
* (auch per Import). `receipt` gibt es hier nicht: das ist der Kassenbeleg (Quelle).
|
|
34
|
+
*/
|
|
35
|
+
export const STOCK_MOVEMENT_TYPES = [
|
|
36
|
+
'sale',
|
|
37
|
+
'goods_receipt',
|
|
38
|
+
'loss',
|
|
39
|
+
'return',
|
|
40
|
+
'transfer_out',
|
|
41
|
+
'transfer_in',
|
|
42
|
+
'condition_out',
|
|
43
|
+
'condition_in',
|
|
44
|
+
'stocktake',
|
|
45
|
+
'adjustment',
|
|
46
|
+
'takeover',
|
|
47
|
+
'reversal',
|
|
48
|
+
'revaluation',
|
|
49
|
+
'method_change',
|
|
50
|
+
];
|
|
51
|
+
/**
|
|
52
|
+
* Woher eine Bewegung kommt (Katalog `BEWEGUNG_QUELLE`); zugleich der Filter
|
|
53
|
+
* `source`. `receipt` ist der Kassenbeleg wie ueberall in der API (der
|
|
54
|
+
* Wareneingang ist die Bewegungsart `goods_receipt`).
|
|
55
|
+
*/
|
|
56
|
+
export const STOCK_MOVEMENT_SOURCES = [
|
|
57
|
+
'receipt',
|
|
58
|
+
'invoice',
|
|
59
|
+
'cancellation',
|
|
60
|
+
'credit_note',
|
|
61
|
+
'panel',
|
|
62
|
+
'register',
|
|
63
|
+
'api',
|
|
64
|
+
'stocktake',
|
|
65
|
+
'system',
|
|
66
|
+
];
|
|
67
|
+
/** Zustand der Ware an einer Bewegung (Katalog `LAGER_ZUSTAND`). */
|
|
68
|
+
export const STOCK_CONDITIONS = ['sellable', 'defective'];
|
|
69
|
+
/**
|
|
70
|
+
* Ursache eines `stock.changed` (Katalog `LAGER_URSACHE`), abgeleitet aus der
|
|
71
|
+
* juengsten Bewegung mit Mengenwirkung. `other`: keine Regel passt oder es
|
|
72
|
+
* gibt keine Bewegung (dann ist `movementId` `null`).
|
|
73
|
+
*/
|
|
74
|
+
export const STOCK_CHANGE_CAUSES = [
|
|
75
|
+
'sale',
|
|
76
|
+
'invoice',
|
|
77
|
+
'credit_note',
|
|
78
|
+
'cancellation',
|
|
79
|
+
'goods_receipt',
|
|
80
|
+
'transfer',
|
|
81
|
+
'loss',
|
|
82
|
+
'condition',
|
|
83
|
+
'reversal',
|
|
84
|
+
'reservation',
|
|
85
|
+
'stocktake',
|
|
86
|
+
'takeover',
|
|
87
|
+
'other',
|
|
88
|
+
];
|
|
89
|
+
/** Stand einer Zustellung (Katalog `ZUSTELLUNG`, derselbe wie bei Partner-Webhooks). */
|
|
90
|
+
export const WEBHOOK_DELIVERY_STATUSES = ['delivered', 'pending', 'failed', 'dropped'];
|
|
91
|
+
/**
|
|
92
|
+
* Die Ereignisse, die ein Konto-Webhook abonnieren kann (Stufe 5a). Spaetere
|
|
93
|
+
* Stufen ergaenzen `reservation.*` und `variant_group.*`.
|
|
94
|
+
*/
|
|
95
|
+
export const INVENTORY_WEBHOOK_EVENTS = [
|
|
96
|
+
'stock.changed',
|
|
97
|
+
'stock.below_minimum',
|
|
98
|
+
'article.created',
|
|
99
|
+
'article.updated',
|
|
100
|
+
'article.deactivated',
|
|
101
|
+
];
|
|
102
|
+
/**
|
|
103
|
+
* Die Felder der Huelle jeder Zustellung, in der Reihenfolge am Draht. Statt
|
|
104
|
+
* `partnerId` (Partner-Webhooks) traegt sie `accountId`; `test` steht nur auf
|
|
105
|
+
* Probesendungen.
|
|
106
|
+
*/
|
|
107
|
+
export const INVENTORY_WEBHOOK_ENVELOPE_FIELDS = ['id', 'type', 'createdAt', 'accountId', 'test', 'data'];
|
|
108
|
+
/** Hoechstzahl der Webhooks je Konto (`webhook_limit`, wie bei Partner-Webhooks). */
|
|
109
|
+
export const INVENTORY_WEBHOOK_LIMIT = 5;
|
|
110
|
+
/** Groesstes `limit` einer Liste; ohne Angabe liefert der Server 50. */
|
|
111
|
+
export const INVENTORY_LIST_LIMIT_MAX = 200;
|
|
112
|
+
/**
|
|
113
|
+
* Die Codes, die die Lager-Endpunkte selbst senden. `validation` traegt
|
|
114
|
+
* `errors: [{ field, message }]`, `rate_limited` traegt `retryAfterSec`
|
|
115
|
+
* (dazu die Kopfzeile `Retry-After`) – auch bei `sendWebhookTest` nach 20
|
|
116
|
+
* Probesendungen je Wiener Kalendertag (dann bis Mitternacht in Wien).
|
|
117
|
+
*/
|
|
118
|
+
export const INVENTORY_ERROR_CODES = [
|
|
119
|
+
'validation',
|
|
120
|
+
'invalid_cursor',
|
|
121
|
+
'article_not_found',
|
|
122
|
+
'webhook_not_found',
|
|
123
|
+
'webhook_limit',
|
|
124
|
+
'invalid_webhook_url',
|
|
125
|
+
'event_not_subscribed',
|
|
126
|
+
'webhook_inactive',
|
|
127
|
+
'inventory_api_not_enabled',
|
|
128
|
+
'module_inactive',
|
|
129
|
+
'rate_limited',
|
|
130
|
+
'server_error',
|
|
131
|
+
];
|
|
132
|
+
/**
|
|
133
|
+
* Codes, die Anmeldung und Rand auf jedem Lager-Aufruf erzeugen koennen,
|
|
134
|
+
* soweit sie nicht schon in [INVENTORY_ERROR_CODES] stehen: `errorCodes.auth`
|
|
135
|
+
* ohne die des Partner-Zugangs und `errorCodes.edge` (sortiert), zuletzt
|
|
136
|
+
* `route_missing` (Code des Pakets). Dieselbe Ableitung wie bei der
|
|
137
|
+
* Rechnungs-API.
|
|
138
|
+
*/
|
|
139
|
+
export const INVENTORY_REQUEST_ERROR_CODES = [
|
|
140
|
+
'account_not_found',
|
|
141
|
+
'admin_required',
|
|
142
|
+
'api_not_approved',
|
|
143
|
+
'cashregister_not_assigned',
|
|
144
|
+
'cashregister_not_found',
|
|
145
|
+
'cashregister_token_invalid',
|
|
146
|
+
'cashregister_token_missing',
|
|
147
|
+
'dialect_mismatch',
|
|
148
|
+
'internal_translation_error',
|
|
149
|
+
'live_not_enabled',
|
|
150
|
+
'method_not_allowed',
|
|
151
|
+
'mfa_required',
|
|
152
|
+
'not_found',
|
|
153
|
+
'register_user_no_business',
|
|
154
|
+
'register_user_not_allowed',
|
|
155
|
+
'register_user_not_found',
|
|
156
|
+
'response_translation_failed',
|
|
157
|
+
'session_expired',
|
|
158
|
+
'session_other_cashregister',
|
|
159
|
+
'unauthorized',
|
|
160
|
+
'user_disabled',
|
|
161
|
+
'user_verification_failed',
|
|
162
|
+
'route_missing',
|
|
163
|
+
];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eingehende Konto-Webhooks der Lager-API: Signatur pruefen, Ereignis lesen.
|
|
3
|
+
*
|
|
4
|
+
* Dasselbe Verfahren wie bei Partner-Webhooks (Backend
|
|
5
|
+
* `gemeinsam/webhook-core.js`, `signaturKopf`/`pruefeSignatur`): Kopf
|
|
6
|
+
* `X-Kasseneck-Signature: t=<unix-sekunden>,v1=<hex>` mit
|
|
7
|
+
* `v1 = HMAC-SHA256(secret, "<t>.<roher Rumpf>")`, Zeitfenster 300 Sekunden in
|
|
8
|
+
* beide Richtungen, zeitkonstanter Vergleich, mehrere `v1=`-Anteile erlaubt.
|
|
9
|
+
* Die Pruefung selbst liegt in `partner/webhook-signatur.ts` und wird hier nur
|
|
10
|
+
* mit der Form `(secret, kopf, rumpf, optionen)` angeboten.
|
|
11
|
+
*
|
|
12
|
+
* Reihenfolge im Empfaenger: **erst pruefen, dann lesen**, und dabei den
|
|
13
|
+
* **rohen** Rumpf nehmen (in Express `express.raw({ type: '*\/*' })` vor jedem
|
|
14
|
+
* JSON-Parser).
|
|
15
|
+
*/
|
|
16
|
+
import type { InventoryWebhookEvent } from './typen.js';
|
|
17
|
+
export { WEBHOOK_SIGNATURE_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_DELIVERY_HEADER, WEBHOOK_TOLERANCE_SEC, } from '../partner/webhook-signatur.js';
|
|
18
|
+
export interface VerifyInventoryWebhookOptions {
|
|
19
|
+
/** Erlaubte Abweichung des Zeitstempels in Sekunden, in beide Richtungen; Vorgabe 300. */
|
|
20
|
+
toleranceSec?: number;
|
|
21
|
+
/** Jetzt: ein `Date` oder Millisekunden seit 1970 (wie `Date.now()`). Vorgabe: die Systemuhr. */
|
|
22
|
+
now?: Date | number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Prueft die Signatur einer Zustellung. `true` nur, wenn Kopf, Zeitfenster
|
|
26
|
+
* und HMAC stimmen; jede schlechte Eingabe und jede Ausnahme ist `false`,
|
|
27
|
+
* nie ein Wurf.
|
|
28
|
+
*
|
|
29
|
+
* **Asynchron**, weil die Pruefung WebCrypto (`crypto.subtle`) benutzt: das
|
|
30
|
+
* Paket hat keine Laufzeitabhaengigkeit und laeuft auch im Browser.
|
|
31
|
+
*
|
|
32
|
+
* @param secret das Secret aus `createWebhook`/`rotateWebhookSecret`; eine
|
|
33
|
+
* Liste erlaubt den Wechsel (es reicht, wenn eines passt)
|
|
34
|
+
* @param header der Wert von `X-Kasseneck-Signature`, unveraendert
|
|
35
|
+
* @param rawBody der **rohe** Rumpf (Text oder Bytes), nicht `JSON.parse` + `stringify`
|
|
36
|
+
*/
|
|
37
|
+
export declare function verifyInventoryWebhookSignature(secret: string | readonly string[], header: string | null | undefined, rawBody: string | Uint8Array, options?: VerifyInventoryWebhookOptions): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Liest eine Zustellung als typisiertes Ereignis. Vorher die Signatur pruefen
|
|
40
|
+
* ([verifyInventoryWebhookSignature]).
|
|
41
|
+
*
|
|
42
|
+
* - Ein Ereignis, das diese Paketversion nicht kennt (etwa `reservation.*`
|
|
43
|
+
* einer spaeteren Stufe), ergibt `null`: mit 2xx antworten und uebergehen.
|
|
44
|
+
* - Ein Rumpf, der keine Huelle ist, oder eine Bruchzahl in einer Menge wirft
|
|
45
|
+
* `KasseneckValidationError` (`scope: 'response'`).
|
|
46
|
+
*
|
|
47
|
+
* **Entdoppeln** auf `event.id`; **Stand statt Aenderung**: einen gespeicherten
|
|
48
|
+
* Bestand nur ueberschreiben, wenn `data.sequence` groesser ist.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseInventoryWebhookEvent(rawBody: string | Uint8Array): InventoryWebhookEvent | null;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eingehende Konto-Webhooks der Lager-API: Signatur pruefen, Ereignis lesen.
|
|
3
|
+
*
|
|
4
|
+
* Dasselbe Verfahren wie bei Partner-Webhooks (Backend
|
|
5
|
+
* `gemeinsam/webhook-core.js`, `signaturKopf`/`pruefeSignatur`): Kopf
|
|
6
|
+
* `X-Kasseneck-Signature: t=<unix-sekunden>,v1=<hex>` mit
|
|
7
|
+
* `v1 = HMAC-SHA256(secret, "<t>.<roher Rumpf>")`, Zeitfenster 300 Sekunden in
|
|
8
|
+
* beide Richtungen, zeitkonstanter Vergleich, mehrere `v1=`-Anteile erlaubt.
|
|
9
|
+
* Die Pruefung selbst liegt in `partner/webhook-signatur.ts` und wird hier nur
|
|
10
|
+
* mit der Form `(secret, kopf, rumpf, optionen)` angeboten.
|
|
11
|
+
*
|
|
12
|
+
* Reihenfolge im Empfaenger: **erst pruefen, dann lesen**, und dabei den
|
|
13
|
+
* **rohen** Rumpf nehmen (in Express `express.raw({ type: '*\/*' })` vor jedem
|
|
14
|
+
* JSON-Parser).
|
|
15
|
+
*/
|
|
16
|
+
import { KasseneckValidationError } from '../client/errors.js';
|
|
17
|
+
import { verifyWebhookSignature as pruefeSignatur } from '../partner/webhook-signatur.js';
|
|
18
|
+
import { artikel, bestandGeaendert, objekt, unterMindestbestand } from './lesen.js';
|
|
19
|
+
import { INVENTORY_WEBHOOK_EVENTS } from './vertrag.js';
|
|
20
|
+
export { WEBHOOK_SIGNATURE_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_DELIVERY_HEADER, WEBHOOK_TOLERANCE_SEC, } from '../partner/webhook-signatur.js';
|
|
21
|
+
/**
|
|
22
|
+
* Prueft die Signatur einer Zustellung. `true` nur, wenn Kopf, Zeitfenster
|
|
23
|
+
* und HMAC stimmen; jede schlechte Eingabe und jede Ausnahme ist `false`,
|
|
24
|
+
* nie ein Wurf.
|
|
25
|
+
*
|
|
26
|
+
* **Asynchron**, weil die Pruefung WebCrypto (`crypto.subtle`) benutzt: das
|
|
27
|
+
* Paket hat keine Laufzeitabhaengigkeit und laeuft auch im Browser.
|
|
28
|
+
*
|
|
29
|
+
* @param secret das Secret aus `createWebhook`/`rotateWebhookSecret`; eine
|
|
30
|
+
* Liste erlaubt den Wechsel (es reicht, wenn eines passt)
|
|
31
|
+
* @param header der Wert von `X-Kasseneck-Signature`, unveraendert
|
|
32
|
+
* @param rawBody der **rohe** Rumpf (Text oder Bytes), nicht `JSON.parse` + `stringify`
|
|
33
|
+
*/
|
|
34
|
+
export async function verifyInventoryWebhookSignature(secret, header, rawBody, options = {}) {
|
|
35
|
+
try {
|
|
36
|
+
const jetzt = options.now instanceof Date ? options.now.getTime() : options.now;
|
|
37
|
+
const nowSec = typeof jetzt === 'number' && Number.isFinite(jetzt) ? Math.floor(jetzt / 1000) : undefined;
|
|
38
|
+
const r = await pruefeSignatur({
|
|
39
|
+
secret,
|
|
40
|
+
signatureHeader: header,
|
|
41
|
+
body: rawBody,
|
|
42
|
+
...(nowSec === undefined ? {} : { nowSec }),
|
|
43
|
+
...(options.toleranceSec === undefined ? {} : { toleranceSec: options.toleranceSec }),
|
|
44
|
+
});
|
|
45
|
+
return r.ok;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const BEKANNT = new Set(INVENTORY_WEBHOOK_EVENTS);
|
|
52
|
+
function kaputt(grund) {
|
|
53
|
+
return new KasseneckValidationError('parseInventoryWebhookEvent', grund, 'response');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Liest eine Zustellung als typisiertes Ereignis. Vorher die Signatur pruefen
|
|
57
|
+
* ([verifyInventoryWebhookSignature]).
|
|
58
|
+
*
|
|
59
|
+
* - Ein Ereignis, das diese Paketversion nicht kennt (etwa `reservation.*`
|
|
60
|
+
* einer spaeteren Stufe), ergibt `null`: mit 2xx antworten und uebergehen.
|
|
61
|
+
* - Ein Rumpf, der keine Huelle ist, oder eine Bruchzahl in einer Menge wirft
|
|
62
|
+
* `KasseneckValidationError` (`scope: 'response'`).
|
|
63
|
+
*
|
|
64
|
+
* **Entdoppeln** auf `event.id`; **Stand statt Aenderung**: einen gespeicherten
|
|
65
|
+
* Bestand nur ueberschreiben, wenn `data.sequence` groesser ist.
|
|
66
|
+
*/
|
|
67
|
+
export function parseInventoryWebhookEvent(rawBody) {
|
|
68
|
+
const text = typeof rawBody === 'string' ? rawBody : new TextDecoder('utf-8').decode(rawBody);
|
|
69
|
+
let roh;
|
|
70
|
+
try {
|
|
71
|
+
roh = JSON.parse(text);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
throw kaputt('Rumpf ist kein JSON');
|
|
75
|
+
}
|
|
76
|
+
const e = objekt(roh);
|
|
77
|
+
if (!e)
|
|
78
|
+
throw kaputt('Rumpf ist kein Ereignis (kein Objekt)');
|
|
79
|
+
const { id, type, createdAt, accountId, data } = e;
|
|
80
|
+
if (typeof id !== 'string' || id === '' || typeof type !== 'string' || type === '')
|
|
81
|
+
throw kaputt('Ereignis ohne id oder type');
|
|
82
|
+
if (typeof createdAt !== 'number' || !Number.isFinite(createdAt))
|
|
83
|
+
throw kaputt('Ereignis ohne createdAt');
|
|
84
|
+
if (typeof accountId !== 'string' || accountId === '')
|
|
85
|
+
throw kaputt('Ereignis ohne accountId');
|
|
86
|
+
if (!BEKANNT.has(type))
|
|
87
|
+
return null;
|
|
88
|
+
const ort = { name: 'parseInventoryWebhookEvent', pfad: 'data' };
|
|
89
|
+
if (!objekt(data))
|
|
90
|
+
throw kaputt('Ereignis ohne data');
|
|
91
|
+
// Nur ein ausdrueckliches `true` ist eine Probe; im Zweifel der Ernstfall.
|
|
92
|
+
const huelle = { id, type: type, createdAt, accountId, test: e.test === true };
|
|
93
|
+
switch (huelle.type) {
|
|
94
|
+
case 'stock.changed':
|
|
95
|
+
return { ...huelle, type: huelle.type, data: bestandGeaendert(ort, data) };
|
|
96
|
+
case 'stock.below_minimum':
|
|
97
|
+
return { ...huelle, type: huelle.type, data: unterMindestbestand(ort, data) };
|
|
98
|
+
default:
|
|
99
|
+
return { ...huelle, type: huelle.type, data: artikel(ort, data) };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -72,6 +72,22 @@ export interface PosArticle {
|
|
|
72
72
|
* (`fromPosArticlePayload`) setzt das Feld immer (`null` oder Liste).
|
|
73
73
|
*/
|
|
74
74
|
stockLocationIds?: string[] | null;
|
|
75
|
+
/**
|
|
76
|
+
* Artikelnummer des Betriebs; null = keine. Diese und die drei folgenden
|
|
77
|
+
* Felder (Scanner-Suche, Lager) sind optional wie `stockLocationIds`, der
|
|
78
|
+
* Leser setzt sie immer. Texte kommen unveraendert durch (fuehrende Nullen,
|
|
79
|
+
* Schreibweise); nur ein leerer Text (auch reiner Leerraum) wird `null`.
|
|
80
|
+
*/
|
|
81
|
+
number?: string | null;
|
|
82
|
+
/** EAN/GTIN, wie gespeichert; null = keine. */
|
|
83
|
+
ean?: string | null;
|
|
84
|
+
/** Interner Code des Betriebs (eigener Barcode/QR); null = keiner. */
|
|
85
|
+
internalCode?: string | null;
|
|
86
|
+
/**
|
|
87
|
+
* Bestandsgefuehrt (Lager-Modul). `null`, wenn die Antwort keine Angabe
|
|
88
|
+
* traegt (aeltere Backends) -- dann nicht aus anderen Feldern ableiten.
|
|
89
|
+
*/
|
|
90
|
+
stockTracked?: boolean | null;
|
|
75
91
|
}
|
|
76
92
|
/** Deckelt eine gewuenschte Menge an der Hoechstmenge des Artikels (null = keine Grenze). */
|
|
77
93
|
export declare function allowedQuantity(a: Pick<PosArticle, 'maxQuantity'>, wanted: number): number;
|
|
@@ -93,6 +109,10 @@ export interface PosArticlePayload {
|
|
|
93
109
|
askQuantity?: boolean | null;
|
|
94
110
|
maxQuantity?: number | null;
|
|
95
111
|
stockLocationIds?: string[] | null;
|
|
112
|
+
number?: string | null;
|
|
113
|
+
ean?: string | null;
|
|
114
|
+
internalCode?: string | null;
|
|
115
|
+
stockTracked?: boolean | null;
|
|
96
116
|
}
|
|
97
117
|
export declare function fromPosArticlePayload(p: PosArticlePayload): PosArticle;
|
|
98
118
|
/**
|
package/dist/esm/pos/artikel.js
CHANGED
|
@@ -45,6 +45,10 @@ export function quantityDefaults(a) {
|
|
|
45
45
|
export function allowedQuantity(a, wanted) {
|
|
46
46
|
return a.maxQuantity != null && a.maxQuantity > 0 ? Math.min(wanted, a.maxQuantity) : wanted;
|
|
47
47
|
}
|
|
48
|
+
/** Ein Text mit Inhalt, unveraendert; leer, nur Leerraum oder kein Text -> null. */
|
|
49
|
+
function textOderNull(wert) {
|
|
50
|
+
return typeof wert === 'string' && wert.trim() !== '' ? wert : null;
|
|
51
|
+
}
|
|
48
52
|
export function fromPosArticlePayload(p) {
|
|
49
53
|
return {
|
|
50
54
|
id: p.id ?? '',
|
|
@@ -63,6 +67,10 @@ export function fromPosArticlePayload(p) {
|
|
|
63
67
|
stockLocationIds: Array.isArray(p.stockLocationIds)
|
|
64
68
|
? p.stockLocationIds.filter((s) => typeof s === 'string' && s !== '')
|
|
65
69
|
: null,
|
|
70
|
+
number: textOderNull(p.number),
|
|
71
|
+
ean: textOderNull(p.ean),
|
|
72
|
+
internalCode: textOderNull(p.internalCode),
|
|
73
|
+
stockTracked: typeof p.stockTracked === 'boolean' ? p.stockTracked : null,
|
|
66
74
|
};
|
|
67
75
|
}
|
|
68
76
|
/**
|
package/dist/esm/pos/index.d.ts
CHANGED
|
@@ -15,4 +15,4 @@ export { type NetworkPrinter, type PrintJob, type PrintJobStatus, PRINT_JOB_STAT
|
|
|
15
15
|
export { listMyTipRecipients } from './trinkgeld.js';
|
|
16
16
|
export { STOCK_LOCATION_TYPES, type StockLocationType, type StockLocation, type StockLocationAddress, type StockLevel, type StockValue, type StockList, type ListMyStockOptions, type SetMyCashregisterStockLocationOptions, type CashregisterStockLocation, listMyStockLocations, listMyStock, setMyCashregisterStockLocation, } from './lager.js';
|
|
17
17
|
export { RETURN_DISPOSITIONS, isReturnDisposition, type ReturnDisposition } from '../models/cancellation.js';
|
|
18
|
-
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, LABELS, labelText, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
|
18
|
+
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, LABELS, labelText, RETURN_DISPOSITION_LABELS, type TextEntry, type MessageKey, type ErrorKind, type ErrorRule, type ErrorRuleDetail, type Surface, type ReceiptEmailMessageCode, type CancellationPaymentMessageCode, type LabelKey, } from './texte.js';
|
package/dist/esm/pos/index.js
CHANGED
|
@@ -21,4 +21,4 @@ export { STOCK_LOCATION_TYPES, listMyStockLocations, listMyStock, setMyCashregis
|
|
|
21
21
|
// Rueckgabe-Wahl beim Storno (Kassen-Dialog); dieselbe Liste wie an der Wurzel.
|
|
22
22
|
export { RETURN_DISPOSITIONS, isReturnDisposition } from '../models/cancellation.js';
|
|
23
23
|
// Was die Kasse selbst sagt: ein Katalog fuer Browser-Kasse und App.
|
|
24
|
-
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, LABELS, labelText, } from './texte.js';
|
|
24
|
+
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, LABELS, labelText, RETURN_DISPOSITION_LABELS, } from './texte.js';
|
package/dist/esm/pos/texte.d.ts
CHANGED
|
@@ -300,6 +300,9 @@ declare const MELDUNGEN_ROH: {
|
|
|
300
300
|
readonly 'cancellation.cards_not_checked': {
|
|
301
301
|
readonly text: "Noch ist nicht jede Karte abgehakt – bitte jede am Terminal gutschreiben. Ist das schon geschehen, zum Schließen noch einmal drücken.";
|
|
302
302
|
};
|
|
303
|
+
readonly 'cancellation.input_rejected': {
|
|
304
|
+
readonly text: "Die Eingabe wurde abgelehnt – bitte das Storno neu beginnen.";
|
|
305
|
+
};
|
|
303
306
|
readonly 'split.setting_hint': {
|
|
304
307
|
readonly text: "Ein Tisch zahlt in Teilen: jede Zahlung bar oder mit Karte, mit eigenem Trinkgeld – am Ende ein Beleg für alles.";
|
|
305
308
|
};
|
|
@@ -1015,9 +1018,47 @@ declare const BESCHRIFTUNGEN_ROH: {
|
|
|
1015
1018
|
readonly 'codetable.other_row': {
|
|
1016
1019
|
readonly text: "Andere Zeile";
|
|
1017
1020
|
};
|
|
1021
|
+
readonly 'stock.all_articles': {
|
|
1022
|
+
readonly text: "Alle Artikel";
|
|
1023
|
+
};
|
|
1024
|
+
readonly 'stock.location': {
|
|
1025
|
+
readonly text: "Lager-Standort";
|
|
1026
|
+
};
|
|
1027
|
+
readonly 'stock.default_location': {
|
|
1028
|
+
readonly text: "Standard-Standort";
|
|
1029
|
+
};
|
|
1030
|
+
readonly 'stock.resolved': {
|
|
1031
|
+
readonly text: "aufgelöst";
|
|
1032
|
+
};
|
|
1033
|
+
readonly 'stock.where_to': {
|
|
1034
|
+
readonly text: "Wohin mit der Ware?";
|
|
1035
|
+
};
|
|
1036
|
+
readonly 'stock.available': {
|
|
1037
|
+
readonly text: "verfügbar";
|
|
1038
|
+
};
|
|
1039
|
+
readonly 'stock.return_restock': {
|
|
1040
|
+
readonly text: "Zurück ins Lager";
|
|
1041
|
+
};
|
|
1042
|
+
readonly 'stock.return_defective': {
|
|
1043
|
+
readonly text: "Defekt";
|
|
1044
|
+
};
|
|
1045
|
+
readonly 'stock.return_disposed': {
|
|
1046
|
+
readonly text: "Entsorgt";
|
|
1047
|
+
};
|
|
1018
1048
|
};
|
|
1019
1049
|
export type LabelKey = keyof typeof BESCHRIFTUNGEN_ROH;
|
|
1020
1050
|
export declare const LABELS: Record<LabelKey, TextEntry>;
|
|
1051
|
+
/**
|
|
1052
|
+
* Rueckgabe beim Storno (`returnDisposition`): welche Beschriftung jede Wahl
|
|
1053
|
+
* traegt. Ein Objekt wie CANCELLATION_PAYMENT_ERROR_MESSAGES, keine Liste in
|
|
1054
|
+
* GROSSSCHRIFT (der Oberflaechen-Vertrag liest Listen als Enums ein); die
|
|
1055
|
+
* App liest die Zuordnung aus `fixtures/pos-texts.json`.
|
|
1056
|
+
*/
|
|
1057
|
+
export declare const RETURN_DISPOSITION_LABELS: {
|
|
1058
|
+
readonly restock: "stock.return_restock";
|
|
1059
|
+
readonly defective: "stock.return_defective";
|
|
1060
|
+
readonly disposed: "stock.return_disposed";
|
|
1061
|
+
};
|
|
1021
1062
|
/** Die Beschriftung zum Schluessel, Platzhalter ersetzt; fehlt ein Wert, wirft es wie `messageText`. */
|
|
1022
1063
|
export declare function labelText(key: LabelKey, values?: Record<string, string | number>): string;
|
|
1023
1064
|
/** Der Satz zum Schluessel, Platzhalter ersetzt. Fehlt ein Wert, wirft es — ein `{status}` am Tresen waere schlimmer. */
|
package/dist/esm/pos/texte.js
CHANGED
|
@@ -162,6 +162,10 @@ const MELDUNGEN_ROH = {
|
|
|
162
162
|
// nicht jede Karte abgehakt ist: einmal nachfragen -- eine vergessene
|
|
163
163
|
// Gutschrift faellt sonst erst dem Gast auf.
|
|
164
164
|
'cancellation.cards_not_checked': { text: 'Noch ist nicht jede Karte abgehakt – bitte jede am Terminal gutschreiben. Ist das schon geschehen, zum Schließen noch einmal drücken.' },
|
|
165
|
+
// Das Backend weist Grund, Notiz oder Positionen des Stornos zurueck
|
|
166
|
+
// (`unknown_reason`, `note_too_long`, `invalid_items`): am Server geschah
|
|
167
|
+
// nichts, der Kassier beginnt das Storno von vorn.
|
|
168
|
+
'cancellation.input_rejected': { text: 'Die Eingabe wurde abgelehnt – bitte das Storno neu beginnen.' },
|
|
165
169
|
// --- Getrennt zahlen -----------------------------------------------------
|
|
166
170
|
// Ein Tisch zahlt in Teilen, ein Beleg fuer alles. Das Teure ist eine schon
|
|
167
171
|
// belastete Karte: jeder Satz, der sie betrifft, nennt den Betrag, und keiner
|
|
@@ -588,8 +592,32 @@ const BESCHRIFTUNGEN_ROH = {
|
|
|
588
592
|
'codetable.preview_title': { text: 'So steht es dann am Bon:' },
|
|
589
593
|
'codetable.apply': { text: 'Übernehmen' },
|
|
590
594
|
'codetable.other_row': { text: 'Andere Zeile' },
|
|
595
|
+
// --- Lager an der Kasse ----------------------------------------------------
|
|
596
|
+
// Standort-Auswahl, Bestandsanzeige und die Rueckgabe-Wahl beim Storno
|
|
597
|
+
// (`RETURN_DISPOSITION_LABELS`). „aufgelöst“ steht an einem Standort mit
|
|
598
|
+
// `active: false`, „verfügbar“ an der Menge `available`.
|
|
599
|
+
'stock.all_articles': { text: 'Alle Artikel' },
|
|
600
|
+
'stock.location': { text: 'Lager-Standort' },
|
|
601
|
+
'stock.default_location': { text: 'Standard-Standort' },
|
|
602
|
+
'stock.resolved': { text: 'aufgelöst' },
|
|
603
|
+
'stock.where_to': { text: 'Wohin mit der Ware?' },
|
|
604
|
+
'stock.available': { text: 'verfügbar' },
|
|
605
|
+
'stock.return_restock': { text: 'Zurück ins Lager' },
|
|
606
|
+
'stock.return_defective': { text: 'Defekt' },
|
|
607
|
+
'stock.return_disposed': { text: 'Entsorgt' },
|
|
591
608
|
};
|
|
592
609
|
export const LABELS = BESCHRIFTUNGEN_ROH;
|
|
610
|
+
/**
|
|
611
|
+
* Rueckgabe beim Storno (`returnDisposition`): welche Beschriftung jede Wahl
|
|
612
|
+
* traegt. Ein Objekt wie CANCELLATION_PAYMENT_ERROR_MESSAGES, keine Liste in
|
|
613
|
+
* GROSSSCHRIFT (der Oberflaechen-Vertrag liest Listen als Enums ein); die
|
|
614
|
+
* App liest die Zuordnung aus `fixtures/pos-texts.json`.
|
|
615
|
+
*/
|
|
616
|
+
export const RETURN_DISPOSITION_LABELS = {
|
|
617
|
+
restock: 'stock.return_restock',
|
|
618
|
+
defective: 'stock.return_defective',
|
|
619
|
+
disposed: 'stock.return_disposed',
|
|
620
|
+
};
|
|
593
621
|
/** Die Beschriftung zum Schluessel, Platzhalter ersetzt; fehlt ein Wert, wirft es wie `messageText`. */
|
|
594
622
|
export function labelText(key, values = {}) {
|
|
595
623
|
return ersetze(`labelText(${key})`, LABELS[key].text, values);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
2
|
-
export declare const VOKABULAR_QUELLE = "
|
|
2
|
+
export declare const VOKABULAR_QUELLE = "79931a40ccaea45777da4713bba475c2f74e1fe7d6264f294cecd321964f9ded";
|
|
3
3
|
/** Schema-Notation des Vertrags: Blatt 'aussen': 'innen', Objekt { __: 'innen', ... }, Liste [ { __: 'innen', ... } ]. */
|
|
4
4
|
export type SchemaEintrag = string | SchemaObjekt | readonly [SchemaObjekt];
|
|
5
5
|
export interface SchemaObjekt {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Erzeugt von scripts/stored-vokabular.mjs aus fixtures/v3/v3-vokabular.json.
|
|
2
2
|
// Nicht von Hand aendern: test/stored.test.ts vergleicht mit dem Vertrag.
|
|
3
3
|
/** Fingerabdruck des Vertrags-Exports, aus dem diese Datei stammt (`_quelle.sha256`). */
|
|
4
|
-
export const VOKABULAR_QUELLE = "
|
|
4
|
+
export const VOKABULAR_QUELLE = "79931a40ccaea45777da4713bba475c2f74e1fe7d6264f294cecd321964f9ded";
|
|
5
5
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
6
6
|
export const SCHEMAS = {
|
|
7
7
|
"getReceipt": {
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED