@kreiseck/kasseneck-api 1.1.1 → 1.2.1
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 +67 -0
- package/README.md +70 -0
- package/dist/cjs/client/aufrufe.d.ts +5 -5
- package/dist/cjs/client/aufrufe.js +21 -2
- package/dist/cjs/client/errors.d.ts +1 -1
- package/dist/cjs/client/errors.js +2 -1
- package/dist/cjs/client/receipts.d.ts +9 -1
- package/dist/cjs/client/receipts.js +18 -3
- package/dist/cjs/client/transport.d.ts +3 -3
- package/dist/cjs/client/transport.js +2 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +6 -3
- package/dist/cjs/invoice/index.d.ts +2 -2
- package/dist/cjs/invoice/index.js +3 -1
- package/dist/cjs/invoice/texte.d.ts +5 -5
- package/dist/cjs/invoice/texte.js +10 -10
- package/dist/cjs/invoice/typen.d.ts +13 -2
- package/dist/cjs/invoice/vertrag.d.ts +10 -1
- package/dist/cjs/invoice/vertrag.js +39 -2
- package/dist/cjs/models/cancellation.d.ts +14 -2
- package/dist/cjs/models/cancellation.js +15 -1
- package/dist/cjs/models/cashregister.d.ts +3 -0
- package/dist/cjs/models/cashregister.js +1 -0
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +4 -2
- package/dist/cjs/models/payment-errors.d.ts +1 -1
- package/dist/cjs/models/payment-errors.js +1 -0
- package/dist/cjs/models/receipt-email.d.ts +1 -1
- package/dist/cjs/models/receipt-email.js +1 -0
- package/dist/cjs/models/receipt-errors.d.ts +1 -1
- package/dist/cjs/models/receipt-errors.js +1 -0
- package/dist/cjs/models/receipt-item.d.ts +9 -0
- package/dist/cjs/models/receipt-item.js +5 -0
- package/dist/cjs/models/receipt.d.ts +1 -1
- package/dist/cjs/models/receipt.js +6 -1
- package/dist/cjs/pos/artikel.d.ts +14 -0
- package/dist/cjs/pos/artikel.js +13 -2
- package/dist/cjs/pos/errors.d.ts +3 -3
- package/dist/cjs/pos/errors.js +6 -2
- package/dist/cjs/pos/index.d.ts +5 -2
- package/dist/cjs/pos/index.js +13 -2
- package/dist/cjs/pos/lager.d.ts +95 -0
- package/dist/cjs/pos/lager.js +160 -0
- package/dist/cjs/register/errors.d.ts +1 -1
- package/dist/cjs/register/errors.js +1 -0
- package/dist/cjs/register/pairing.d.ts +27 -1
- package/dist/cjs/register/pairing.js +18 -1
- package/dist/cjs/stored/draht.d.ts +4 -2
- package/dist/cjs/stored/draht.js +46 -5
- package/dist/cjs/stored/vokabular.d.ts +1 -1
- package/dist/cjs/stored/vokabular.js +5 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client/aufrufe.d.ts +5 -5
- package/dist/esm/client/aufrufe.js +21 -2
- package/dist/esm/client/errors.d.ts +1 -1
- package/dist/esm/client/errors.js +2 -1
- package/dist/esm/client/receipts.d.ts +9 -1
- package/dist/esm/client/receipts.js +19 -4
- package/dist/esm/client/transport.d.ts +3 -3
- package/dist/esm/client/transport.js +2 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/invoice/index.d.ts +2 -2
- package/dist/esm/invoice/index.js +1 -1
- package/dist/esm/invoice/texte.d.ts +5 -5
- package/dist/esm/invoice/texte.js +10 -10
- package/dist/esm/invoice/typen.d.ts +13 -2
- package/dist/esm/invoice/vertrag.d.ts +10 -1
- package/dist/esm/invoice/vertrag.js +38 -1
- package/dist/esm/models/cancellation.d.ts +14 -2
- package/dist/esm/models/cancellation.js +13 -0
- package/dist/esm/models/cashregister.d.ts +3 -0
- package/dist/esm/models/cashregister.js +1 -0
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/models/payment-errors.d.ts +1 -1
- package/dist/esm/models/payment-errors.js +1 -0
- package/dist/esm/models/receipt-email.d.ts +1 -1
- package/dist/esm/models/receipt-email.js +1 -0
- package/dist/esm/models/receipt-errors.d.ts +1 -1
- package/dist/esm/models/receipt-errors.js +1 -0
- package/dist/esm/models/receipt-item.d.ts +9 -0
- package/dist/esm/models/receipt-item.js +5 -0
- package/dist/esm/models/receipt.d.ts +1 -1
- package/dist/esm/models/receipt.js +6 -1
- package/dist/esm/pos/artikel.d.ts +14 -0
- package/dist/esm/pos/artikel.js +13 -3
- package/dist/esm/pos/errors.d.ts +3 -3
- package/dist/esm/pos/errors.js +6 -2
- package/dist/esm/pos/index.d.ts +5 -2
- package/dist/esm/pos/index.js +6 -2
- package/dist/esm/pos/lager.d.ts +95 -0
- package/dist/esm/pos/lager.js +154 -0
- package/dist/esm/register/errors.d.ts +1 -1
- package/dist/esm/register/errors.js +1 -0
- package/dist/esm/register/pairing.d.ts +27 -1
- package/dist/esm/register/pairing.js +17 -1
- package/dist/esm/stored/draht.d.ts +4 -2
- package/dist/esm/stored/draht.js +45 -4
- package/dist/esm/stored/vokabular.d.ts +1 -1
- package/dist/esm/stored/vokabular.js +5 -3
- 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-examples/cancel-error-return-disposition.json +17 -0
- package/fixtures/invoice-api-examples/credit-error-return-disposition.json +26 -0
- package/fixtures/invoice-api-examples/credit-return-disposition.json +23 -0
- package/fixtures/invoice-api-examples/issue-error-return-disposition.json +25 -0
- package/fixtures/invoice-api-examples/issue-error-stock-id.json +27 -0
- package/fixtures/invoice-api-examples/issue-stock.json +22 -0
- package/fixtures/invoice-api.schema.json +37 -1
- package/fixtures/invoice-texts.json +11 -11
- package/fixtures/pos-texts.json +1 -1
- package/fixtures/surface.json +48 -4
- package/fixtures/v3/antworten/belege.json +1 -1
- package/fixtures/v3/antworten/belegmail.json +1 -1
- package/fixtures/v3/antworten/kasse-belege.json +1 -1
- package/fixtures/v3/antworten/kasse.json +662 -3
- package/fixtures/v3/antworten/rechnungen.json +1 -1
- package/fixtures/v3/antworten/storno.json +1 -1
- package/fixtures/v3/stored/belege.json +1 -1
- package/fixtures/v3/stored/kasse.json +58 -3
- package/fixtures/v3/stored/rechnungen.json +1 -1
- package/fixtures/v3/v3-vokabular.json +249 -16
- package/fixtures/v3/zahlbetrag-faelle.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { KasseneckValidationError } from '../client/errors.js';
|
|
2
|
+
import { liste } from './artikel.js';
|
|
3
|
+
/**
|
|
4
|
+
* Lager an der Kasse (Lager-Kern Stufe 2, Backend lager-endpoints.js):
|
|
5
|
+
* Standorte, Bestand und der Standort der Kasse. Alle drei Aufrufe gibt es
|
|
6
|
+
* nur ueber den Kassenweg `/api/v3` (registerInternal); Rechte am Server:
|
|
7
|
+
* `stockView` (lesen), `stockCosts` (Werte), `stockLocation` (Standort setzen).
|
|
8
|
+
*
|
|
9
|
+
* **Ganzzahlen:** Mengen sind Tausendstel der Basiseinheit (`1000` = 1 Stueck,
|
|
10
|
+
* `250` = 0,250 kg), Werte ganze Cent bzw. Mikro-Euro. Nichts wird geteilt,
|
|
11
|
+
* gerundet oder geklemmt -- ein negativer Bestand (mehr verkauft als gebucht)
|
|
12
|
+
* ist eine Aussage des Servers und bleibt negativ. Eine Zahl, die keine
|
|
13
|
+
* Ganzzahl ist, oder eine fehlende Menge wird **nie** zu `0`: der Aufruf
|
|
14
|
+
* endet mit `KasseneckValidationError` (`scope: 'response'`), denn „kein
|
|
15
|
+
* Bestand“ und „Antwort kaputt“ sind verschiedene Aussagen.
|
|
16
|
+
*/
|
|
17
|
+
/** Standort-Typen (Katalog `STANDORT_TYP`), englisch wie am Draht. */
|
|
18
|
+
export const STOCK_LOCATION_TYPES = Object.freeze(['warehouse', 'store', 'vehicle', 'other']);
|
|
19
|
+
const TYPEN = new Set(STOCK_LOCATION_TYPES);
|
|
20
|
+
function antwortfehler(name, grund) {
|
|
21
|
+
return new KasseneckValidationError(name, grund, 'response');
|
|
22
|
+
}
|
|
23
|
+
const objekt = (w) => (w !== null && typeof w === 'object' && !Array.isArray(w) ? w : null);
|
|
24
|
+
/** Freitext, der fehlen darf (Name, Adressteile, Kennzeichen): leer = `null`. */
|
|
25
|
+
const textOderNull = (w) => (typeof w === 'string' && w !== '' ? w : null);
|
|
26
|
+
/**
|
|
27
|
+
* Eine Kennung, die da sein muss: ohne sie ist die Zeile nicht zuzuordnen,
|
|
28
|
+
* und ein leerer Text als `stockLocationId` setzte die Kasse zurueck.
|
|
29
|
+
*/
|
|
30
|
+
function kennung(name, pfad, w) {
|
|
31
|
+
if (typeof w !== 'string' || w === '')
|
|
32
|
+
throw antwortfehler(name, `Antwort enthaelt keine Kennung (data.${pfad} fehlt)`);
|
|
33
|
+
return w;
|
|
34
|
+
}
|
|
35
|
+
/** Eine Zahl des Servers: Ganzzahl oder Antwortfehler, nie ein Ersatzwert. */
|
|
36
|
+
function ganzzahl(name, pfad, w) {
|
|
37
|
+
if (typeof w !== 'number' || !Number.isInteger(w)) {
|
|
38
|
+
throw antwortfehler(name, `Antwort enthaelt keine ganze Zahl (data.${pfad})`);
|
|
39
|
+
}
|
|
40
|
+
return w;
|
|
41
|
+
}
|
|
42
|
+
function standort(name, e, i) {
|
|
43
|
+
const s = objekt(e) ?? {};
|
|
44
|
+
const pfad = `locations[${i}]`;
|
|
45
|
+
const a = objekt(s.address);
|
|
46
|
+
const teile = a ? { street: textOderNull(a.street), zip: textOderNull(a.zip), city: textOderNull(a.city), country: textOderNull(a.country) } : null;
|
|
47
|
+
// Eine Adresse ohne einen einzigen Teil ist keine Adresse.
|
|
48
|
+
const address = teile && Object.values(teile).some((t) => t !== null) ? teile : null;
|
|
49
|
+
return {
|
|
50
|
+
id: kennung(name, `${pfad}.id`, s.id),
|
|
51
|
+
name: typeof s.name === 'string' ? s.name : '',
|
|
52
|
+
type: typeof s.type === 'string' && TYPEN.has(s.type) ? s.type : null,
|
|
53
|
+
address,
|
|
54
|
+
licensePlate: textOderNull(s.licensePlate),
|
|
55
|
+
active: s.active !== false,
|
|
56
|
+
virtual: s.virtual === true,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function bestand(name, e, i) {
|
|
60
|
+
const b = objekt(e) ?? {};
|
|
61
|
+
const pfad = `stock[${i}]`;
|
|
62
|
+
return {
|
|
63
|
+
articleId: kennung(name, `${pfad}.articleId`, b.articleId),
|
|
64
|
+
locationId: kennung(name, `${pfad}.locationId`, b.locationId),
|
|
65
|
+
sellable: ganzzahl(name, `${pfad}.sellable`, b.sellable),
|
|
66
|
+
defective: ganzzahl(name, `${pfad}.defective`, b.defective),
|
|
67
|
+
reserved: ganzzahl(name, `${pfad}.reserved`, b.reserved),
|
|
68
|
+
available: ganzzahl(name, `${pfad}.available`, b.available),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function wert(name, e, i) {
|
|
72
|
+
const w = objekt(e) ?? {};
|
|
73
|
+
const pfad = `values[${i}]`;
|
|
74
|
+
return {
|
|
75
|
+
articleId: kennung(name, `${pfad}.articleId`, w.articleId),
|
|
76
|
+
stockValueCents: ganzzahl(name, `${pfad}.stockValueCents`, w.stockValueCents),
|
|
77
|
+
// Fehlt der Durchschnitt oder ist er null, ist die Menge 0 -- eine
|
|
78
|
+
// vorhandene, aber unbrauchbare Zahl ist dagegen ein Antwortfehler.
|
|
79
|
+
averageCostMicros: w.averageCostMicros === undefined || w.averageCostMicros === null
|
|
80
|
+
? null
|
|
81
|
+
: ganzzahl(name, `${pfad}.averageCostMicros`, w.averageCostMicros),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** Standorte des Betriebs, samt aufgeloesten (`active: false`) und dem Hauptstandort. */
|
|
85
|
+
export async function listMyStockLocations(transport) {
|
|
86
|
+
const name = 'listMyStockLocations';
|
|
87
|
+
const daten = await transport(name);
|
|
88
|
+
return liste(daten, 'locations', name, (e, i) => standort(name, e, i));
|
|
89
|
+
}
|
|
90
|
+
/** Bestand je Artikel und Standort; Werte nur mit dem Recht `stockCosts`. */
|
|
91
|
+
export async function listMyStock(transport, options = {}) {
|
|
92
|
+
const name = 'listMyStock';
|
|
93
|
+
if (options === null || typeof options !== 'object')
|
|
94
|
+
throw new KasseneckValidationError(name, 'options muss ein Objekt sein', 'request');
|
|
95
|
+
const params = {};
|
|
96
|
+
for (const feld of ['locationId', 'articleId']) {
|
|
97
|
+
const w = options[feld];
|
|
98
|
+
if (w === undefined || w === '')
|
|
99
|
+
continue;
|
|
100
|
+
if (typeof w !== 'string')
|
|
101
|
+
throw new KasseneckValidationError(name, `${feld} muss Text sein`, 'request');
|
|
102
|
+
params[feld] = w;
|
|
103
|
+
}
|
|
104
|
+
if (options.belowMinimum !== undefined) {
|
|
105
|
+
if (typeof options.belowMinimum !== 'boolean')
|
|
106
|
+
throw new KasseneckValidationError(name, 'belowMinimum muss true oder false sein', 'request');
|
|
107
|
+
// false filtert am Server nicht; gesendet wird nur der Filter selbst.
|
|
108
|
+
if (options.belowMinimum)
|
|
109
|
+
params.belowMinimum = true;
|
|
110
|
+
}
|
|
111
|
+
const daten = await transport(name, params);
|
|
112
|
+
const stock = liste(daten, 'stock', name, (e, i) => bestand(name, e, i));
|
|
113
|
+
const roh = objekt(daten)?.values;
|
|
114
|
+
// Fehlt `values`, fehlt dem Aufrufer das Recht `stockCosts`: `null`, nie `[]`.
|
|
115
|
+
// Etwas anderes als eine Liste ist dagegen kein „kein Recht“, sondern kaputt.
|
|
116
|
+
if (roh === undefined || roh === null)
|
|
117
|
+
return { stock, values: null };
|
|
118
|
+
return { stock, values: liste(daten, 'values', name, (e, i) => wert(name, e, i)) };
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Standort der Kasse setzen -- von dort bucht der Server Verkauf und Storno
|
|
122
|
+
* ab. `stockLocationId: null` setzt zurueck (am Draht der leere Text).
|
|
123
|
+
* Fehler am Code: `location_not_found`, `location_inactive`,
|
|
124
|
+
* `cashregister_not_found`, `cashregister_not_assigned`, `not_permitted`,
|
|
125
|
+
* `module_inactive`.
|
|
126
|
+
*/
|
|
127
|
+
export async function setMyCashregisterStockLocation(transport, options) {
|
|
128
|
+
const name = 'setMyCashregisterStockLocation';
|
|
129
|
+
const ziel = options?.stockLocationId;
|
|
130
|
+
if (ziel !== null && typeof ziel !== 'string') {
|
|
131
|
+
throw new KasseneckValidationError(name, 'stockLocationId fehlt (Kennung, oder null zum Zuruecksetzen)', 'request');
|
|
132
|
+
}
|
|
133
|
+
// Leer setzt zurueck. Nur Leerraum wuerde der Server kuerzen und damit still
|
|
134
|
+
// auf den Standard-Standort zuruecksetzen: das ist kein Standort, sondern ein Fehler.
|
|
135
|
+
if (ziel !== null && ziel !== '' && ziel.trim() === '') {
|
|
136
|
+
throw new KasseneckValidationError(name, 'stockLocationId ist nur Leerraum (Kennung angeben, oder null zum Zuruecksetzen)', 'request');
|
|
137
|
+
}
|
|
138
|
+
const params = { stockLocationId: ziel === null ? '' : ziel };
|
|
139
|
+
if (options.cashregisterId !== undefined) {
|
|
140
|
+
if (typeof options.cashregisterId !== 'string' || options.cashregisterId.trim() === '') {
|
|
141
|
+
throw new KasseneckValidationError(name, 'cashregisterId ist leer', 'request');
|
|
142
|
+
}
|
|
143
|
+
params.cashregisterId = options.cashregisterId;
|
|
144
|
+
}
|
|
145
|
+
const daten = objekt(await transport(name, params));
|
|
146
|
+
if (!daten || typeof daten.cashregisterId !== 'string' || daten.cashregisterId === '') {
|
|
147
|
+
throw antwortfehler(name, 'Antwort enthaelt keine Kasse (data.cashregisterId fehlt)');
|
|
148
|
+
}
|
|
149
|
+
const stand = daten.stockLocationId;
|
|
150
|
+
if (stand !== null && stand !== undefined && typeof stand !== 'string') {
|
|
151
|
+
throw antwortfehler(name, 'Antwort enthaelt einen unbrauchbaren Standort (data.stockLocationId)');
|
|
152
|
+
}
|
|
153
|
+
return { cashregisterId: daten.cashregisterId, stockLocationId: textOderNull(stand) };
|
|
154
|
+
}
|
|
@@ -22,7 +22,7 @@ import { KasseneckApiError } from '../client/errors.js';
|
|
|
22
22
|
* ueber `KasseneckApiError.code` lesbar; die Kasse braucht dafuer einen
|
|
23
23
|
* Rueckfallzweig.
|
|
24
24
|
*/
|
|
25
|
-
export declare const REGISTER_ERROR_CODES: readonly ["account_not_found", "admin_required", "cashregister_in_use", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "device_bound_elsewhere", "device_not_found", "device_not_paired", "device_takeover_required", "dialect_mismatch", "internal_translation_error", "licenses_exhausted", "live_not_enabled", "location_outside", "location_required", "login_failed", "login_mode_select_user", "login_unavailable", "method_not_allowed", "mfa_required", "not_found", "pairing_code_expired", "pairing_code_unknown", "pairing_code_used", "pairing_failed", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "register_user_only", "response_translation_failed", "session_ended", "session_expired", "session_not_running", "session_other_cashregister", "too_many_attempts", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
25
|
+
export declare const REGISTER_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "cashregister_in_use", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "device_bound_elsewhere", "device_not_found", "device_not_paired", "device_takeover_required", "dialect_mismatch", "internal_translation_error", "licenses_exhausted", "live_not_enabled", "location_outside", "location_required", "login_failed", "login_mode_select_user", "login_unavailable", "method_not_allowed", "mfa_required", "not_found", "pairing_code_expired", "pairing_code_unknown", "pairing_code_used", "pairing_failed", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "register_user_only", "response_translation_failed", "session_ended", "session_expired", "session_not_running", "session_other_cashregister", "too_many_attempts", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
|
|
26
26
|
export type RegisterErrorCode = typeof REGISTER_ERROR_CODES[number];
|
|
27
27
|
export declare function isRegisterErrorCode(value: unknown): value is RegisterErrorCode;
|
|
28
28
|
/** Der Code eines geworfenen Fehlers, wenn es einer der Kassen-Anmeldung ist; sonst `undefined`. */
|
|
@@ -26,6 +26,7 @@ import { feldfehlerVon } from '../client/fehlercodes.js';
|
|
|
26
26
|
export const REGISTER_ERROR_CODES = Object.freeze([
|
|
27
27
|
'account_not_found',
|
|
28
28
|
'admin_required',
|
|
29
|
+
'api_not_approved',
|
|
29
30
|
'cashregister_in_use',
|
|
30
31
|
'cashregister_not_assigned',
|
|
31
32
|
'cashregister_not_found',
|
|
@@ -137,10 +137,12 @@ export interface RegisterDeviceUsers {
|
|
|
137
137
|
* nennt den Grund als Menschentext (ausser Betrieb, keine Signaturkarte,
|
|
138
138
|
* Startbeleg fehlt): die Kasse sperrt das Kassieren VOR dem ersten Beleg
|
|
139
139
|
* statt an createReceipt zu scheitern. Fehlt das Feld, gilt bereit.
|
|
140
|
+
* `stockLocationId`: Lager-Standort der Kasse, fehlt = Standard-Standort.
|
|
140
141
|
*/
|
|
141
142
|
cashregister?: {
|
|
142
143
|
ready: boolean;
|
|
143
144
|
reason?: string | null;
|
|
145
|
+
stockLocationId?: string;
|
|
144
146
|
};
|
|
145
147
|
/** Das Geraet haengt an der Test-Umgebung des Betriebs. */
|
|
146
148
|
testEnvironment: boolean;
|
|
@@ -179,6 +181,24 @@ export interface RegisterUserPerms {
|
|
|
179
181
|
discount?: boolean;
|
|
180
182
|
/** Trinkgeld anderen zuweisen. */
|
|
181
183
|
tipAssign?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Lager: Standorte und Mengen sehen (listMyStockLocations, listMyStock).
|
|
186
|
+
* Fehlt das Recht, gilt es als erteilt – anders als alle anderen
|
|
187
|
+
* (siehe [stockViewOf]); ein ausdrueckliches `false` sperrt.
|
|
188
|
+
*/
|
|
189
|
+
stockView?: boolean;
|
|
190
|
+
/** Lager: Einkaufswerte sehen (`values` in listMyStock); gibt nur der Inhaber frei. */
|
|
191
|
+
stockCosts?: boolean;
|
|
192
|
+
/** Lager: Wareneingang, Umbuchen. */
|
|
193
|
+
stockMove?: boolean;
|
|
194
|
+
/** Lager: Abgang, Zustand, Gegenbuchung. */
|
|
195
|
+
stockLoss?: boolean;
|
|
196
|
+
/** Inventur: zaehlen. */
|
|
197
|
+
stocktakeCount?: boolean;
|
|
198
|
+
/** Inventur: abschliessen. */
|
|
199
|
+
stocktakeClose?: boolean;
|
|
200
|
+
/** Standort der Kasse waehlen (setMyCashregisterStockLocation). */
|
|
201
|
+
stockLocation?: boolean;
|
|
182
202
|
[weiteresRecht: string]: boolean | RegisterScope | undefined;
|
|
183
203
|
}
|
|
184
204
|
/**
|
|
@@ -189,10 +209,16 @@ export interface RegisterUserPerms {
|
|
|
189
209
|
* nicht fuehrt (Tippfehler, umbenanntes Recht), kommt hier nicht durch.
|
|
190
210
|
* Die Gegenrichtung schliesst [_RechteVollstaendig] direkt darunter.
|
|
191
211
|
*/
|
|
192
|
-
export declare const REGISTER_PERMS: readonly ["sell", "cancel", "articles", "layout", "reports", "takeover", "cancelScope", "receiptsScope", "drawer", "discount", "tipAssign"];
|
|
212
|
+
export declare const REGISTER_PERMS: readonly ["sell", "cancel", "articles", "layout", "reports", "takeover", "cancelScope", "receiptsScope", "drawer", "discount", "tipAssign", "stockView", "stockCosts", "stockMove", "stockLoss", "stocktakeCount", "stocktakeClose", "stockLocation"];
|
|
193
213
|
/** Reichweite lesen, mit der Migration des Backends (register-auth.js). */
|
|
194
214
|
export declare function cancelScopeOf(perms: RegisterUserPerms | null | undefined): RegisterScope;
|
|
195
215
|
export declare function receiptsScopeOf(perms: RegisterUserPerms | null | undefined): RegisterScope;
|
|
216
|
+
/**
|
|
217
|
+
* Darf der Benutzer Standorte und Mengen sehen? Wie im Backend (lager-core):
|
|
218
|
+
* ohne Schluessel gilt `stockView` als erteilt, ein ausdrueckliches `false`
|
|
219
|
+
* sperrt; alle anderen Lager-Rechte gelten ohne Schluessel als verweigert.
|
|
220
|
+
*/
|
|
221
|
+
export declare function stockViewOf(perms: RegisterUserPerms | null | undefined): boolean;
|
|
196
222
|
/** Der angemeldete Kassen-Benutzer. */
|
|
197
223
|
export interface RegisterUser {
|
|
198
224
|
id: string;
|
|
@@ -49,6 +49,7 @@ const ohneAnmeldung = () => ({ headers: {}, params: {} });
|
|
|
49
49
|
export const REGISTER_PERMS = [
|
|
50
50
|
'sell', 'cancel', 'articles', 'layout', 'reports', 'takeover',
|
|
51
51
|
'cancelScope', 'receiptsScope', 'drawer', 'discount', 'tipAssign',
|
|
52
|
+
'stockView', 'stockCosts', 'stockMove', 'stockLoss', 'stocktakeCount', 'stocktakeClose', 'stockLocation',
|
|
52
53
|
];
|
|
53
54
|
/** Reichweite lesen, mit der Migration des Backends (register-auth.js). */
|
|
54
55
|
export function cancelScopeOf(perms) {
|
|
@@ -65,6 +66,16 @@ export function receiptsScopeOf(perms) {
|
|
|
65
66
|
return 'all';
|
|
66
67
|
return ['none', 'own', 'all'].includes(perms.receiptsScope) ? perms.receiptsScope : 'none';
|
|
67
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Darf der Benutzer Standorte und Mengen sehen? Wie im Backend (lager-core):
|
|
71
|
+
* ohne Schluessel gilt `stockView` als erteilt, ein ausdrueckliches `false`
|
|
72
|
+
* sperrt; alle anderen Lager-Rechte gelten ohne Schluessel als verweigert.
|
|
73
|
+
*/
|
|
74
|
+
export function stockViewOf(perms) {
|
|
75
|
+
if (!perms)
|
|
76
|
+
return false;
|
|
77
|
+
return perms.stockView === undefined ? true : perms.stockView === true;
|
|
78
|
+
}
|
|
68
79
|
/**
|
|
69
80
|
* Geraet koppeln: der Kopplungs-Code wird gegen den dauerhaften Ausweis dieses
|
|
70
81
|
* Geraets getauscht. **Ohne Anmeldung** — der Code ist der Nachweis.
|
|
@@ -199,7 +210,12 @@ function kasseBereit(wert) {
|
|
|
199
210
|
const roh = wert;
|
|
200
211
|
if (typeof roh['ready'] !== 'boolean')
|
|
201
212
|
return undefined;
|
|
202
|
-
|
|
213
|
+
const standort = roh['stockLocationId'];
|
|
214
|
+
return {
|
|
215
|
+
ready: roh['ready'],
|
|
216
|
+
reason: typeof roh['reason'] === 'string' ? roh['reason'] : null,
|
|
217
|
+
...(typeof standort === 'string' && standort !== '' ? { stockLocationId: standort } : {}),
|
|
218
|
+
};
|
|
203
219
|
}
|
|
204
220
|
/** Die Regel aus der Antwort — oder `null`, wenn keine brauchbare kommt. */
|
|
205
221
|
function regel(wert) {
|
|
@@ -10,10 +10,12 @@ export declare function regel(eintrag: SchemaEintrag): {
|
|
|
10
10
|
};
|
|
11
11
|
/** Innere Namen einer Schema-Ebene (was der Server innen an dieser Stelle kennt). */
|
|
12
12
|
export declare function innereNamen(schema: SchemaObjekt): Map<string, string>;
|
|
13
|
+
/** Rueckgabe-Wahl innen -> aussen (Katalog RUECKGABE; stored.test.ts vergleicht mit dem Vertrag). */
|
|
14
|
+
export declare const _RUECKGABE_NACH_AUSSEN: Readonly<Record<string, string>>;
|
|
13
15
|
/**
|
|
14
16
|
* Ein Belegdokument, wie Handler und Rand es vor der Uebersetzung sehen:
|
|
15
|
-
* ohne Storno-Marke (storno-core.
|
|
16
|
-
* ohneStornoMarke). Alles andere bleibt woertlich, auch `pruefangaben` im
|
|
17
|
+
* ohne Storno-Marke und Lager-Standort (storno-core.ohneInterneBelegFelder,
|
|
18
|
+
* Rand ohneStornoMarke). Alles andere bleibt woertlich, auch `pruefangaben` im
|
|
17
19
|
* Beleg selbst (der Server reicht sie so durch). Wirft, wenn es kein
|
|
18
20
|
* Belegdokument ist.
|
|
19
21
|
*/
|
package/dist/esm/stored/draht.js
CHANGED
|
@@ -81,7 +81,7 @@ const aeussereWerte = (name) => new Set(Object.values(KATALOGE[name] ?? {}));
|
|
|
81
81
|
/**
|
|
82
82
|
* Interne Marke der Storno-Reservierung: `stornoMarke` am Storno-Beleg,
|
|
83
83
|
* `marke` im Bezug und in `cancellations[]`. Handler
|
|
84
|
-
* (storno-core.
|
|
84
|
+
* (storno-core.ohneInterneBelegFelder) und Rand (ohneStornoMarke) nehmen sie
|
|
85
85
|
* heraus; der Vertrag nennt die Namen nicht (nur `$function: belegJeKanal`).
|
|
86
86
|
*/
|
|
87
87
|
const STORNO_MARKE = 'stornoMarke';
|
|
@@ -92,6 +92,44 @@ const ohneMarke = (o) => {
|
|
|
92
92
|
const { [MARKE]: _m, ...rest } = o;
|
|
93
93
|
return rest;
|
|
94
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* Interne Dokumentfelder eines Belegs, die keine Antwort traegt (Zwilling von
|
|
97
|
+
* storno-core.INTERNE_BELEG_FELDER): der Lager-Standort der Kasse, den
|
|
98
|
+
* createReceipt fuer die Lagerbuchung an den Beleg kopiert.
|
|
99
|
+
*/
|
|
100
|
+
const INTERNE_BELEG_FELDER = ['lagerStandortId'];
|
|
101
|
+
/** Rueckgabe-Wahl innen -> aussen (Katalog RUECKGABE; stored.test.ts vergleicht mit dem Vertrag). */
|
|
102
|
+
export const _RUECKGABE_NACH_AUSSEN = Object.freeze({ lager: 'restock', defekt: 'defective', entsorgt: 'disposed' });
|
|
103
|
+
/**
|
|
104
|
+
* Zwilling von `rueckgabeUmbenennen` (Rand): `rueckgabe` heisst aussen
|
|
105
|
+
* `returnDisposition`, an Ort und Stelle; ein Wert ausserhalb des Katalogs
|
|
106
|
+
* faellt weg (der Server schreibt dafuer eine Warnzeile).
|
|
107
|
+
*/
|
|
108
|
+
function rueckgabeUmbenennen(o) {
|
|
109
|
+
if (!istObjekt(o) || !hat(o, 'rueckgabe'))
|
|
110
|
+
return o;
|
|
111
|
+
const raus = {};
|
|
112
|
+
for (const [k, w] of Object.entries(o)) {
|
|
113
|
+
if (k !== 'rueckgabe') {
|
|
114
|
+
raus[k] = w;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (typeof w === 'string' && hat(_RUECKGABE_NACH_AUSSEN, w))
|
|
118
|
+
raus.returnDisposition = _RUECKGABE_NACH_AUSSEN[w];
|
|
119
|
+
}
|
|
120
|
+
return raus;
|
|
121
|
+
}
|
|
122
|
+
const zeilenMitRueckgabe = (items) => (Array.isArray(items) ? items.map(rueckgabeUmbenennen) : items);
|
|
123
|
+
/** Zwilling von `belegRueckgabeNachAussen`: Storno-Zeilen und Eintraege in `cancellations[]`. */
|
|
124
|
+
function belegRueckgabeNachAussen(beleg) {
|
|
125
|
+
const raus = { ...beleg };
|
|
126
|
+
if (Array.isArray(beleg.items))
|
|
127
|
+
raus.items = zeilenMitRueckgabe(beleg.items);
|
|
128
|
+
if (Array.isArray(beleg.cancellations)) {
|
|
129
|
+
raus.cancellations = beleg.cancellations.map((c) => (istObjekt(c) && Array.isArray(c.items) ? { ...c, items: zeilenMitRueckgabe(c.items) } : c));
|
|
130
|
+
}
|
|
131
|
+
return raus;
|
|
132
|
+
}
|
|
95
133
|
/**
|
|
96
134
|
* Zwilling von `beleg-pruefangaben.alsIso`: leer (auch 0, '') -> null;
|
|
97
135
|
* Firestore-Zeitstempel, Zahl oder Zeichenkette -> ISO-Zeitpunkt in UTC;
|
|
@@ -109,8 +147,8 @@ function alsIso(ts) {
|
|
|
109
147
|
}
|
|
110
148
|
/**
|
|
111
149
|
* Ein Belegdokument, wie Handler und Rand es vor der Uebersetzung sehen:
|
|
112
|
-
* ohne Storno-Marke (storno-core.
|
|
113
|
-
* ohneStornoMarke). Alles andere bleibt woertlich, auch `pruefangaben` im
|
|
150
|
+
* ohne Storno-Marke und Lager-Standort (storno-core.ohneInterneBelegFelder,
|
|
151
|
+
* Rand ohneStornoMarke). Alles andere bleibt woertlich, auch `pruefangaben` im
|
|
114
152
|
* Beleg selbst (der Server reicht sie so durch). Wirft, wenn es kein
|
|
115
153
|
* Belegdokument ist.
|
|
116
154
|
*/
|
|
@@ -119,6 +157,8 @@ export function _storedReceiptInner(doc, functionName) {
|
|
|
119
157
|
throw new KasseneckValidationError(functionName, 'Kein Belegdokument (receiptId fehlt)', 'response');
|
|
120
158
|
}
|
|
121
159
|
const { [STORNO_MARKE]: _s, ...beleg } = doc;
|
|
160
|
+
for (const feld of INTERNE_BELEG_FELDER)
|
|
161
|
+
delete beleg[feld];
|
|
122
162
|
if (hat(beleg, 'cancellationOf'))
|
|
123
163
|
beleg.cancellationOf = ohneMarke(beleg.cancellationOf);
|
|
124
164
|
if (Array.isArray(beleg.cancellations))
|
|
@@ -140,7 +180,8 @@ export function pruefangabenDerHuelle(p) {
|
|
|
140
180
|
*/
|
|
141
181
|
export function _receiptEnvelopeToWire(huelle) {
|
|
142
182
|
const schema = SCHEMAS.getReceipt;
|
|
143
|
-
|
|
183
|
+
const draht = werteNachAussen(schluesselNachAussen(huelle, schema.data), schema.werte);
|
|
184
|
+
return istObjekt(draht.receipt) ? { ...draht, receipt: belegRueckgabeNachAussen(draht.receipt) } : draht;
|
|
144
185
|
}
|
|
145
186
|
/**
|
|
146
187
|
* Ein Belegdokument (`users/{uid}/cashregisters/{id}/receipts/{id}`) in der
|
|
@@ -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 = "b1049e2f65e9261cf8f729481d9ce1e5afda2cf620333f38ae6bf1afb36c8712";
|
|
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 = "b1049e2f65e9261cf8f729481d9ce1e5afda2cf620333f38ae6bf1afb36c8712";
|
|
5
5
|
/** Schema je Endpunkt (aussen -> innen) und Wertverweise auf die Kataloge. */
|
|
6
6
|
export const SCHEMAS = {
|
|
7
7
|
"getReceipt": {
|
|
@@ -219,7 +219,8 @@ export const SCHEMAS = {
|
|
|
219
219
|
"__": "kasse",
|
|
220
220
|
"visible": "sichtbar",
|
|
221
221
|
"sort": "sort"
|
|
222
|
-
}
|
|
222
|
+
},
|
|
223
|
+
"stockLocationIds": "standorte"
|
|
223
224
|
}
|
|
224
225
|
]
|
|
225
226
|
},
|
|
@@ -256,7 +257,8 @@ export const ARTIKEL_FELDER = [
|
|
|
256
257
|
"revenueGroupId",
|
|
257
258
|
"active",
|
|
258
259
|
"groupId",
|
|
259
|
-
"tile"
|
|
260
|
+
"tile",
|
|
261
|
+
"stockLocationIds"
|
|
260
262
|
];
|
|
261
263
|
/** Wertkataloge innen (deutsch) -> aussen (englisch). */
|
|
262
264
|
export const KATALOGE = {
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"endpoint": "cancelInvoice",
|
|
3
|
+
"description": "Unbekannte Rueckgabe-Wahl beim Vollstorno",
|
|
4
|
+
"request": {
|
|
5
|
+
"idempotencyKey": "ex-16",
|
|
6
|
+
"invoiceId": "invoice_example",
|
|
7
|
+
"reason": "return",
|
|
8
|
+
"returnDisposition": "lost"
|
|
9
|
+
},
|
|
10
|
+
"expected": {
|
|
11
|
+
"ok": false,
|
|
12
|
+
"code": "validation",
|
|
13
|
+
"fields": [
|
|
14
|
+
"returnDisposition"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"endpoint": "createCreditNote",
|
|
3
|
+
"description": "Unbekannte Rueckgabe-Wahl an der Position",
|
|
4
|
+
"request": {
|
|
5
|
+
"idempotencyKey": "ex-15",
|
|
6
|
+
"invoiceId": "invoice_example",
|
|
7
|
+
"reason": "return",
|
|
8
|
+
"items": [
|
|
9
|
+
{
|
|
10
|
+
"description": "Roggenbrot",
|
|
11
|
+
"quantity": 1,
|
|
12
|
+
"unitPriceCents": 450,
|
|
13
|
+
"vatRate": 10,
|
|
14
|
+
"articleId": "rye-bread",
|
|
15
|
+
"returnDisposition": "lost"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"expected": {
|
|
20
|
+
"ok": false,
|
|
21
|
+
"code": "validation",
|
|
22
|
+
"fields": [
|
|
23
|
+
"items[0].returnDisposition"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"endpoint": "createCreditNote",
|
|
3
|
+
"description": "Rueckgabe: Vorgabe zurueck ins Lager, eine Position defekt",
|
|
4
|
+
"request": {
|
|
5
|
+
"idempotencyKey": "ex-14",
|
|
6
|
+
"invoiceId": "invoice_example",
|
|
7
|
+
"reason": "return",
|
|
8
|
+
"returnDisposition": "restock",
|
|
9
|
+
"items": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Roggenbrot",
|
|
12
|
+
"quantity": 1,
|
|
13
|
+
"unitPriceCents": 450,
|
|
14
|
+
"vatRate": 10,
|
|
15
|
+
"articleId": "rye-bread",
|
|
16
|
+
"returnDisposition": "defective"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"expected": {
|
|
21
|
+
"ok": true
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"endpoint": "issueInvoice",
|
|
3
|
+
"description": "Die Rueckgabe-Wahl gehoert an die Gutschrift, nicht an die Rechnung",
|
|
4
|
+
"request": {
|
|
5
|
+
"idempotencyKey": "ex-17",
|
|
6
|
+
"priceMode": "gross",
|
|
7
|
+
"serviceStart": "2026-10-01",
|
|
8
|
+
"items": [
|
|
9
|
+
{
|
|
10
|
+
"description": "Roggenbrot",
|
|
11
|
+
"quantity": 1,
|
|
12
|
+
"unitPriceCents": 450,
|
|
13
|
+
"vatRate": 10,
|
|
14
|
+
"returnDisposition": "restock"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"expected": {
|
|
19
|
+
"ok": false,
|
|
20
|
+
"code": "validation",
|
|
21
|
+
"fields": [
|
|
22
|
+
"items[0].returnDisposition"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"endpoint": "issueInvoice",
|
|
3
|
+
"description": "Lager-Kennungen ohne Schraegstrich und nicht nur Punkte",
|
|
4
|
+
"request": {
|
|
5
|
+
"idempotencyKey": "ex-18",
|
|
6
|
+
"priceMode": "gross",
|
|
7
|
+
"serviceStart": "2026-10-01",
|
|
8
|
+
"stockLocationId": "..",
|
|
9
|
+
"items": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Roggenbrot",
|
|
12
|
+
"quantity": 1,
|
|
13
|
+
"unitPriceCents": 450,
|
|
14
|
+
"vatRate": 10,
|
|
15
|
+
"articleId": "a/b"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"expected": {
|
|
20
|
+
"ok": false,
|
|
21
|
+
"code": "validation",
|
|
22
|
+
"fields": [
|
|
23
|
+
"stockLocationId",
|
|
24
|
+
"items[0].articleId"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"endpoint": "issueInvoice",
|
|
3
|
+
"description": "Bestandsgefuehrter Artikel, abgebucht vom Lieferwagen",
|
|
4
|
+
"request": {
|
|
5
|
+
"idempotencyKey": "ex-13",
|
|
6
|
+
"priceMode": "gross",
|
|
7
|
+
"serviceStart": "2026-10-01",
|
|
8
|
+
"stockLocationId": "van-1",
|
|
9
|
+
"items": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Roggenbrot",
|
|
12
|
+
"quantity": 2,
|
|
13
|
+
"unitPriceCents": 450,
|
|
14
|
+
"vatRate": 10,
|
|
15
|
+
"articleId": "rye-bread"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"expected": {
|
|
20
|
+
"ok": true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "Kasseneck Rechnungs-API",
|
|
4
4
|
"version": 2,
|
|
5
|
-
"package": "1.
|
|
5
|
+
"package": "1.2.1",
|
|
6
6
|
"endpoints": {
|
|
7
7
|
"createCustomer": {
|
|
8
8
|
"request": {
|
|
@@ -461,6 +461,11 @@
|
|
|
461
461
|
"minimum": 0,
|
|
462
462
|
"maximum": 100,
|
|
463
463
|
"x-decimals": 2
|
|
464
|
+
},
|
|
465
|
+
"articleId": {
|
|
466
|
+
"type": "string",
|
|
467
|
+
"minLength": 1,
|
|
468
|
+
"maxLength": 128
|
|
464
469
|
}
|
|
465
470
|
},
|
|
466
471
|
"required": [
|
|
@@ -505,6 +510,11 @@
|
|
|
505
510
|
"minLength": 1,
|
|
506
511
|
"maxLength": 128
|
|
507
512
|
},
|
|
513
|
+
"stockLocationId": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"minLength": 1,
|
|
516
|
+
"maxLength": 128
|
|
517
|
+
},
|
|
508
518
|
"payment": {
|
|
509
519
|
"type": "object",
|
|
510
520
|
"properties": {
|
|
@@ -579,6 +589,13 @@
|
|
|
579
589
|
"note": {
|
|
580
590
|
"type": "string",
|
|
581
591
|
"maxLength": 2000
|
|
592
|
+
},
|
|
593
|
+
"returnDisposition": {
|
|
594
|
+
"enum": [
|
|
595
|
+
"restock",
|
|
596
|
+
"defective",
|
|
597
|
+
"disposed"
|
|
598
|
+
]
|
|
582
599
|
}
|
|
583
600
|
},
|
|
584
601
|
"required": [
|
|
@@ -720,6 +737,18 @@
|
|
|
720
737
|
"minimum": 0,
|
|
721
738
|
"maximum": 100,
|
|
722
739
|
"x-decimals": 2
|
|
740
|
+
},
|
|
741
|
+
"articleId": {
|
|
742
|
+
"type": "string",
|
|
743
|
+
"minLength": 1,
|
|
744
|
+
"maxLength": 128
|
|
745
|
+
},
|
|
746
|
+
"returnDisposition": {
|
|
747
|
+
"enum": [
|
|
748
|
+
"restock",
|
|
749
|
+
"defective",
|
|
750
|
+
"disposed"
|
|
751
|
+
]
|
|
723
752
|
}
|
|
724
753
|
},
|
|
725
754
|
"required": [
|
|
@@ -741,6 +770,13 @@
|
|
|
741
770
|
],
|
|
742
771
|
"additionalProperties": false
|
|
743
772
|
}
|
|
773
|
+
},
|
|
774
|
+
"returnDisposition": {
|
|
775
|
+
"enum": [
|
|
776
|
+
"restock",
|
|
777
|
+
"defective",
|
|
778
|
+
"disposed"
|
|
779
|
+
]
|
|
744
780
|
}
|
|
745
781
|
},
|
|
746
782
|
"required": [
|