@kreiseck/kasseneck-api 0.14.0 → 0.16.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 +47 -0
- package/README.md +75 -0
- package/dist/cjs/client/aufrufe.d.ts +1 -1
- package/dist/cjs/client/aufrufe.js +12 -0
- package/dist/cjs/rechnung/api.d.ts +45 -0
- package/dist/cjs/rechnung/api.js +36 -0
- package/dist/cjs/rechnung/auth.d.ts +21 -0
- package/dist/cjs/rechnung/auth.js +36 -0
- package/dist/cjs/rechnung/endpunkte.d.ts +54 -0
- package/dist/cjs/rechnung/endpunkte.js +147 -0
- package/dist/cjs/rechnung/fehler.d.ts +21 -0
- package/dist/cjs/rechnung/fehler.js +44 -0
- package/dist/cjs/rechnung/index.d.ts +18 -0
- package/dist/cjs/rechnung/index.js +54 -0
- package/dist/cjs/rechnung/typen.d.ts +238 -0
- package/dist/cjs/rechnung/typen.js +9 -0
- package/dist/cjs/rechnung/vertrag.d.ts +113 -0
- package/dist/cjs/rechnung/vertrag.js +218 -0
- package/dist/esm/client/aufrufe.d.ts +1 -1
- package/dist/esm/client/aufrufe.js +12 -0
- package/dist/esm/rechnung/api.d.ts +45 -0
- package/dist/esm/rechnung/api.js +33 -0
- package/dist/esm/rechnung/auth.d.ts +21 -0
- package/dist/esm/rechnung/auth.js +33 -0
- package/dist/esm/rechnung/endpunkte.d.ts +54 -0
- package/dist/esm/rechnung/endpunkte.js +133 -0
- package/dist/esm/rechnung/fehler.d.ts +21 -0
- package/dist/esm/rechnung/fehler.js +39 -0
- package/dist/esm/rechnung/index.d.ts +18 -0
- package/dist/esm/rechnung/index.js +17 -0
- package/dist/esm/rechnung/typen.d.ts +238 -0
- package/dist/esm/rechnung/typen.js +8 -0
- package/dist/esm/rechnung/vertrag.d.ts +113 -0
- package/dist/esm/rechnung/vertrag.js +215 -0
- package/fixtures/hobex-hps-codes.json +1 -1
- package/fixtures/kasse-texte.json +1 -1
- package/fixtures/oberflaeche.json +101 -1
- package/fixtures/rechnung-api-beispiele/credit-fehler-grund.json +24 -0
- package/fixtures/rechnung-api-beispiele/credit-ok.json +20 -0
- package/fixtures/rechnung-api-beispiele/customer-fehler-uid.json +25 -0
- package/fixtures/rechnung-api-beispiele/customer-get-fehler-beide.json +15 -0
- package/fixtures/rechnung-api-beispiele/customer-ok.json +20 -0
- package/fixtures/rechnung-api-beispiele/customer-search-fehler-leer.json +14 -0
- package/fixtures/rechnung-api-beispiele/issue-brutto-20.json +27 -0
- package/fixtures/rechnung-api-beispiele/issue-fehler-cent.json +26 -0
- package/fixtures/rechnung-api-beispiele/issue-fehler-menge.json +26 -0
- package/fixtures/rechnung-api-beispiele/issue-fehler-negativ.json +26 -0
- package/fixtures/rechnung-api-beispiele/issue-fehler-satz.json +26 -0
- package/fixtures/rechnung-api-beispiele/issue-fehler-unbekannt.json +27 -0
- package/fixtures/rechnung-api-beispiele/issue-gemischt.json +33 -0
- package/fixtures/rechnung-api-beispiele/issue-kleinunternehmer.json +27 -0
- package/fixtures/rechnung-api-beispiele/issue-netto-20.json +28 -0
- package/fixtures/rechnung-api-beispiele/issue-rabatt.json +28 -0
- package/fixtures/rechnung-api-beispiele/setup-status-fehler-feld.json +14 -0
- package/fixtures/rechnung-api-beispiele/setup-status-ok.json +8 -0
- package/fixtures/rechnung-api.schema.json +681 -0
- package/package.json +12 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `@kreiseck/kasseneck-api/rechnung` — Rechnungen (§ 11 UStG, keine Belege)
|
|
4
|
+
* und Kunden ueber die Rechnungs-API.
|
|
5
|
+
*
|
|
6
|
+
* Ein eigener Unterpfad wie `partner`: der `api_key` eines Kontos, mit dem
|
|
7
|
+
* Rechnungen ausgestellt werden, gehoert auf einen **Server** und soll nicht
|
|
8
|
+
* versehentlich in ein Browser-Buendel der Kasse wandern.
|
|
9
|
+
*
|
|
10
|
+
* Die Beschreibung der Endpunkte steht in der Referenz des Backends
|
|
11
|
+
* (`docs/api/rechnungen.md`). Was hier steht, ist der Vertrag als Daten und die
|
|
12
|
+
* Benutzung des Clients.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RECHNUNG_MINDESTENS_EINS = exports.RECHNUNG_GENAU_EINS = exports.RECHNUNG_ANFRAGEN = exports.POSITION_FELDER = exports.KUNDE_FELDER = exports.INVOICE_SETUP_REQUIREMENTS = exports.EINVOICE_FORMATS = exports.DOC_TYPES = exports.INVOICE_LIST_STATUS = exports.CUSTOMER_TYPES = exports.VAT_RATES = exports.PRICE_MODES = exports.TAX_SCHEMES = exports.CREDIT_NOTE_REASONS = exports.INVOICE_ERROR_CODES = exports.RECHNUNG_AUFRUFE = exports.RECHNUNG_VERTRAG_VERSION = exports.updateCustomer = exports.searchCustomers = exports.listInvoices = exports.issueInvoice = exports.getInvoiceXml = exports.getInvoiceSetupStatus = exports.getInvoicePdf = exports.getInvoice = exports.getCustomer = exports.createCustomer = exports.createCreditNote = exports.cancelInvoice = exports.rechnungFeldFehler = exports.rechnungFehlerCode = exports.istRechnungFehler = exports.rechnungKeyAuth = exports.createRechnungApi = void 0;
|
|
16
|
+
var api_js_1 = require("./api.js");
|
|
17
|
+
Object.defineProperty(exports, "createRechnungApi", { enumerable: true, get: function () { return api_js_1.createRechnungApi; } });
|
|
18
|
+
var auth_js_1 = require("./auth.js");
|
|
19
|
+
Object.defineProperty(exports, "rechnungKeyAuth", { enumerable: true, get: function () { return auth_js_1.rechnungKeyAuth; } });
|
|
20
|
+
var fehler_js_1 = require("./fehler.js");
|
|
21
|
+
Object.defineProperty(exports, "istRechnungFehler", { enumerable: true, get: function () { return fehler_js_1.istRechnungFehler; } });
|
|
22
|
+
Object.defineProperty(exports, "rechnungFehlerCode", { enumerable: true, get: function () { return fehler_js_1.rechnungFehlerCode; } });
|
|
23
|
+
Object.defineProperty(exports, "rechnungFeldFehler", { enumerable: true, get: function () { return fehler_js_1.rechnungFeldFehler; } });
|
|
24
|
+
var endpunkte_js_1 = require("./endpunkte.js");
|
|
25
|
+
Object.defineProperty(exports, "cancelInvoice", { enumerable: true, get: function () { return endpunkte_js_1.cancelInvoice; } });
|
|
26
|
+
Object.defineProperty(exports, "createCreditNote", { enumerable: true, get: function () { return endpunkte_js_1.createCreditNote; } });
|
|
27
|
+
Object.defineProperty(exports, "createCustomer", { enumerable: true, get: function () { return endpunkte_js_1.createCustomer; } });
|
|
28
|
+
Object.defineProperty(exports, "getCustomer", { enumerable: true, get: function () { return endpunkte_js_1.getCustomer; } });
|
|
29
|
+
Object.defineProperty(exports, "getInvoice", { enumerable: true, get: function () { return endpunkte_js_1.getInvoice; } });
|
|
30
|
+
Object.defineProperty(exports, "getInvoicePdf", { enumerable: true, get: function () { return endpunkte_js_1.getInvoicePdf; } });
|
|
31
|
+
Object.defineProperty(exports, "getInvoiceSetupStatus", { enumerable: true, get: function () { return endpunkte_js_1.getInvoiceSetupStatus; } });
|
|
32
|
+
Object.defineProperty(exports, "getInvoiceXml", { enumerable: true, get: function () { return endpunkte_js_1.getInvoiceXml; } });
|
|
33
|
+
Object.defineProperty(exports, "issueInvoice", { enumerable: true, get: function () { return endpunkte_js_1.issueInvoice; } });
|
|
34
|
+
Object.defineProperty(exports, "listInvoices", { enumerable: true, get: function () { return endpunkte_js_1.listInvoices; } });
|
|
35
|
+
Object.defineProperty(exports, "searchCustomers", { enumerable: true, get: function () { return endpunkte_js_1.searchCustomers; } });
|
|
36
|
+
Object.defineProperty(exports, "updateCustomer", { enumerable: true, get: function () { return endpunkte_js_1.updateCustomer; } });
|
|
37
|
+
var vertrag_js_1 = require("./vertrag.js");
|
|
38
|
+
Object.defineProperty(exports, "RECHNUNG_VERTRAG_VERSION", { enumerable: true, get: function () { return vertrag_js_1.RECHNUNG_VERTRAG_VERSION; } });
|
|
39
|
+
Object.defineProperty(exports, "RECHNUNG_AUFRUFE", { enumerable: true, get: function () { return vertrag_js_1.RECHNUNG_AUFRUFE; } });
|
|
40
|
+
Object.defineProperty(exports, "INVOICE_ERROR_CODES", { enumerable: true, get: function () { return vertrag_js_1.INVOICE_ERROR_CODES; } });
|
|
41
|
+
Object.defineProperty(exports, "CREDIT_NOTE_REASONS", { enumerable: true, get: function () { return vertrag_js_1.CREDIT_NOTE_REASONS; } });
|
|
42
|
+
Object.defineProperty(exports, "TAX_SCHEMES", { enumerable: true, get: function () { return vertrag_js_1.TAX_SCHEMES; } });
|
|
43
|
+
Object.defineProperty(exports, "PRICE_MODES", { enumerable: true, get: function () { return vertrag_js_1.PRICE_MODES; } });
|
|
44
|
+
Object.defineProperty(exports, "VAT_RATES", { enumerable: true, get: function () { return vertrag_js_1.VAT_RATES; } });
|
|
45
|
+
Object.defineProperty(exports, "CUSTOMER_TYPES", { enumerable: true, get: function () { return vertrag_js_1.CUSTOMER_TYPES; } });
|
|
46
|
+
Object.defineProperty(exports, "INVOICE_LIST_STATUS", { enumerable: true, get: function () { return vertrag_js_1.INVOICE_LIST_STATUS; } });
|
|
47
|
+
Object.defineProperty(exports, "DOC_TYPES", { enumerable: true, get: function () { return vertrag_js_1.DOC_TYPES; } });
|
|
48
|
+
Object.defineProperty(exports, "EINVOICE_FORMATS", { enumerable: true, get: function () { return vertrag_js_1.EINVOICE_FORMATS; } });
|
|
49
|
+
Object.defineProperty(exports, "INVOICE_SETUP_REQUIREMENTS", { enumerable: true, get: function () { return vertrag_js_1.INVOICE_SETUP_REQUIREMENTS; } });
|
|
50
|
+
Object.defineProperty(exports, "KUNDE_FELDER", { enumerable: true, get: function () { return vertrag_js_1.KUNDE_FELDER; } });
|
|
51
|
+
Object.defineProperty(exports, "POSITION_FELDER", { enumerable: true, get: function () { return vertrag_js_1.POSITION_FELDER; } });
|
|
52
|
+
Object.defineProperty(exports, "RECHNUNG_ANFRAGEN", { enumerable: true, get: function () { return vertrag_js_1.RECHNUNG_ANFRAGEN; } });
|
|
53
|
+
Object.defineProperty(exports, "RECHNUNG_GENAU_EINS", { enumerable: true, get: function () { return vertrag_js_1.RECHNUNG_GENAU_EINS; } });
|
|
54
|
+
Object.defineProperty(exports, "RECHNUNG_MINDESTENS_EINS", { enumerable: true, get: function () { return vertrag_js_1.RECHNUNG_MINDESTENS_EINS; } });
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typen der Rechnungs-API. Die Anfragen folgen `vertrag.ts` Feld fuer Feld;
|
|
3
|
+
* `test/rechnung-client.test.ts` schickt die Beispiele des Vertrags durch.
|
|
4
|
+
*
|
|
5
|
+
* Betraege sind ueberall ganze Cent. Datumsangaben sind `YYYY-MM-DD` nach
|
|
6
|
+
* Wiener Kalender.
|
|
7
|
+
*/
|
|
8
|
+
import type { CreditNoteReason, CustomerType, DocType, InvoiceSetupRequirement, InvoiceListStatus, PriceMode, TaxScheme, VatRatePercent } from './vertrag.js';
|
|
9
|
+
export interface CustomerInput {
|
|
10
|
+
type: CustomerType;
|
|
11
|
+
name: string;
|
|
12
|
+
legalForm?: string;
|
|
13
|
+
email?: string;
|
|
14
|
+
phone?: string;
|
|
15
|
+
street?: string;
|
|
16
|
+
houseNumber?: string;
|
|
17
|
+
zip?: string;
|
|
18
|
+
city?: string;
|
|
19
|
+
/** ISO-3166-Alpha-2, z. B. `AT`. */
|
|
20
|
+
country: string;
|
|
21
|
+
/** UID-Nummer, z. B. `ATU12345678`. */
|
|
22
|
+
vatId?: string;
|
|
23
|
+
/** Kuerzel fuer die Rechnungsnummer; einmal gesetzt unveraenderlich. */
|
|
24
|
+
shortCode?: string;
|
|
25
|
+
/** Behoerde (B2G) — die E-Rechnung verlangt dann Adresse und `orderReference`. */
|
|
26
|
+
isAuthority?: boolean;
|
|
27
|
+
note?: string;
|
|
28
|
+
/** Kennung im eigenen System; je Konto eindeutig. */
|
|
29
|
+
externalId?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Customer {
|
|
32
|
+
id: string;
|
|
33
|
+
type: CustomerType;
|
|
34
|
+
name: string;
|
|
35
|
+
legalForm: string | null;
|
|
36
|
+
email: string | null;
|
|
37
|
+
phone: string | null;
|
|
38
|
+
street: string | null;
|
|
39
|
+
houseNumber: string | null;
|
|
40
|
+
zip: string | null;
|
|
41
|
+
city: string | null;
|
|
42
|
+
country: string;
|
|
43
|
+
vatId: string | null;
|
|
44
|
+
shortCode: string | null;
|
|
45
|
+
isAuthority: boolean;
|
|
46
|
+
note: string | null;
|
|
47
|
+
externalId: string | null;
|
|
48
|
+
createdAt: string | null;
|
|
49
|
+
updatedAt: string | null;
|
|
50
|
+
}
|
|
51
|
+
export interface CustomerSearch {
|
|
52
|
+
externalId?: string;
|
|
53
|
+
vatId?: string;
|
|
54
|
+
email?: string;
|
|
55
|
+
/** Namensanfang, Gross-/Kleinschreibung und Akzente egal. */
|
|
56
|
+
name?: string;
|
|
57
|
+
limit?: number;
|
|
58
|
+
cursor?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface CustomerPage {
|
|
61
|
+
customers: Customer[];
|
|
62
|
+
nextCursor: string | null;
|
|
63
|
+
}
|
|
64
|
+
export interface InvoiceItemInput {
|
|
65
|
+
description: string;
|
|
66
|
+
subtitle?: string;
|
|
67
|
+
/** Hoechstens drei Nachkommastellen. */
|
|
68
|
+
quantity: number;
|
|
69
|
+
unit?: string;
|
|
70
|
+
/** Einzelpreis in ganzen Cent, im `priceMode` der Rechnung (netto oder brutto). */
|
|
71
|
+
unitPriceCents: number;
|
|
72
|
+
vatRate: VatRatePercent;
|
|
73
|
+
/** Zeilenrabatt in Prozent, hoechstens zwei Nachkommastellen. */
|
|
74
|
+
discountPct?: number;
|
|
75
|
+
}
|
|
76
|
+
export interface IssueInvoiceRequest {
|
|
77
|
+
/** Pflicht: dieselbe Anfrage mit demselben Schluessel erzeugt nie eine zweite Rechnung. */
|
|
78
|
+
idempotencyKey: string;
|
|
79
|
+
/** Pflicht ueber 400 € brutto sowie bei Reverse Charge und ig. Lieferung. */
|
|
80
|
+
customerId?: string;
|
|
81
|
+
taxScheme: TaxScheme;
|
|
82
|
+
priceMode: PriceMode;
|
|
83
|
+
/** Leistungsdatum bzw. Beginn des Leistungszeitraums. */
|
|
84
|
+
serviceStart: string;
|
|
85
|
+
serviceEnd?: string;
|
|
86
|
+
paymentTermDays?: number;
|
|
87
|
+
orderReference?: string;
|
|
88
|
+
intro?: string;
|
|
89
|
+
note?: string;
|
|
90
|
+
/** Verwendungszweck fuer die Ueberweisung; leer = Rechnungsnummer. */
|
|
91
|
+
paymentReference?: string;
|
|
92
|
+
girocode?: boolean;
|
|
93
|
+
tracking?: boolean;
|
|
94
|
+
items: InvoiceItemInput[];
|
|
95
|
+
/** Eigene Merkmale (hoechstens 20), nie gedruckt. */
|
|
96
|
+
metadata?: Record<string, string>;
|
|
97
|
+
}
|
|
98
|
+
export interface CancelInvoiceRequest {
|
|
99
|
+
idempotencyKey: string;
|
|
100
|
+
invoiceId: string;
|
|
101
|
+
reason: CreditNoteReason;
|
|
102
|
+
note?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface CreditNoteRequest extends CancelInvoiceRequest {
|
|
105
|
+
items: InvoiceItemInput[];
|
|
106
|
+
}
|
|
107
|
+
export interface InvoiceTotals {
|
|
108
|
+
netCents: number;
|
|
109
|
+
vatCents: number;
|
|
110
|
+
grossCents: number;
|
|
111
|
+
byRate: {
|
|
112
|
+
rate: number;
|
|
113
|
+
netCents: number;
|
|
114
|
+
vatCents: number;
|
|
115
|
+
}[];
|
|
116
|
+
}
|
|
117
|
+
export interface EInvoiceStatus {
|
|
118
|
+
level: string;
|
|
119
|
+
formats: string[];
|
|
120
|
+
missing: string[];
|
|
121
|
+
}
|
|
122
|
+
export interface Invoice {
|
|
123
|
+
id: string;
|
|
124
|
+
number: string;
|
|
125
|
+
docType: DocType;
|
|
126
|
+
status: string;
|
|
127
|
+
invoiceDate: string;
|
|
128
|
+
dueDate: string | null;
|
|
129
|
+
customerId: string | null;
|
|
130
|
+
totals: InvoiceTotals;
|
|
131
|
+
einvoice: EInvoiceStatus | null;
|
|
132
|
+
statusUrl: string | null;
|
|
133
|
+
statusPassword: string | null;
|
|
134
|
+
metadata: Record<string, string>;
|
|
135
|
+
}
|
|
136
|
+
export interface InvoiceRecipient {
|
|
137
|
+
name: string;
|
|
138
|
+
type: CustomerType;
|
|
139
|
+
street: string | null;
|
|
140
|
+
houseNumber: string | null;
|
|
141
|
+
zip: string | null;
|
|
142
|
+
city: string | null;
|
|
143
|
+
country: string;
|
|
144
|
+
vatId: string | null;
|
|
145
|
+
shortCode: string | null;
|
|
146
|
+
email: string | null;
|
|
147
|
+
isAuthority: boolean;
|
|
148
|
+
}
|
|
149
|
+
/** Eine gespeicherte Position — wie gesendet, fehlende Angaben mit ihrem Standardwert. */
|
|
150
|
+
export interface InvoiceItem {
|
|
151
|
+
description: string;
|
|
152
|
+
subtitle: string;
|
|
153
|
+
quantity: number;
|
|
154
|
+
unit: string;
|
|
155
|
+
unitPriceCents: number;
|
|
156
|
+
vatRate: number;
|
|
157
|
+
discountPct: number;
|
|
158
|
+
}
|
|
159
|
+
export interface InvoiceDetail extends Invoice {
|
|
160
|
+
items: InvoiceItem[];
|
|
161
|
+
customer: InvoiceRecipient | null;
|
|
162
|
+
taxScheme: TaxScheme;
|
|
163
|
+
priceMode: PriceMode;
|
|
164
|
+
serviceStart: string | null;
|
|
165
|
+
serviceEnd: string | null;
|
|
166
|
+
paymentTermDays: number | null;
|
|
167
|
+
orderReference: string | null;
|
|
168
|
+
payments: {
|
|
169
|
+
amountCents: number;
|
|
170
|
+
date: string;
|
|
171
|
+
method: string;
|
|
172
|
+
}[];
|
|
173
|
+
paidCents: number;
|
|
174
|
+
openCents: number;
|
|
175
|
+
overdue: boolean;
|
|
176
|
+
writtenOff: boolean;
|
|
177
|
+
writeOffReasonCode: string | null;
|
|
178
|
+
related: {
|
|
179
|
+
invoiceId: string;
|
|
180
|
+
number: string | null;
|
|
181
|
+
} | null;
|
|
182
|
+
creditNotes: {
|
|
183
|
+
id: string;
|
|
184
|
+
number: string;
|
|
185
|
+
grossCents: number;
|
|
186
|
+
}[];
|
|
187
|
+
source: string | null;
|
|
188
|
+
createdAt: string | null;
|
|
189
|
+
finalizedAt: string | null;
|
|
190
|
+
}
|
|
191
|
+
export interface InvoiceListQuery {
|
|
192
|
+
from?: string;
|
|
193
|
+
to?: string;
|
|
194
|
+
status?: InvoiceListStatus;
|
|
195
|
+
docType?: DocType;
|
|
196
|
+
customerId?: string;
|
|
197
|
+
limit?: number;
|
|
198
|
+
cursor?: string;
|
|
199
|
+
}
|
|
200
|
+
export interface InvoicePage {
|
|
201
|
+
invoices: Invoice[];
|
|
202
|
+
nextCursor: string | null;
|
|
203
|
+
}
|
|
204
|
+
export interface IssueResult {
|
|
205
|
+
invoice: Invoice;
|
|
206
|
+
/** `true`, wenn die Anfrage schon einmal ausgefuehrt wurde und die bestehende Rechnung zurueckkommt. */
|
|
207
|
+
replayed: boolean;
|
|
208
|
+
}
|
|
209
|
+
export interface CancelResult {
|
|
210
|
+
creditNote: Invoice;
|
|
211
|
+
original: {
|
|
212
|
+
id: string;
|
|
213
|
+
status: string;
|
|
214
|
+
};
|
|
215
|
+
/** Bereits auf das Original bezahlt — die Rueckerstattung ist Sache des Betriebs. */
|
|
216
|
+
originalPaidCents: number;
|
|
217
|
+
replayed: boolean;
|
|
218
|
+
}
|
|
219
|
+
export interface CreditNoteResult {
|
|
220
|
+
creditNote: Invoice;
|
|
221
|
+
/** Brutto, das nach dieser Gutschrift noch gutgeschrieben werden kann. */
|
|
222
|
+
remainingCents: number;
|
|
223
|
+
replayed: boolean;
|
|
224
|
+
}
|
|
225
|
+
/** Ein Punkt, der vor dem Ausstellen noch fehlt. */
|
|
226
|
+
export interface InvoiceSetupGap {
|
|
227
|
+
requirement: InvoiceSetupRequirement;
|
|
228
|
+
/** Was fehlt und wo es nachzutragen ist — fuer einen Menschen formuliert. */
|
|
229
|
+
message: string;
|
|
230
|
+
}
|
|
231
|
+
export interface InvoiceSetupStatus {
|
|
232
|
+
/** `true`: Rechnungen koennen ueber die API ausgestellt werden. */
|
|
233
|
+
ready: boolean;
|
|
234
|
+
/** Umgebung des Schluessels (`kr_live_…` bzw. `kr_test_…`). */
|
|
235
|
+
environment: 'live' | 'test';
|
|
236
|
+
/** Was fehlt, in der Reihenfolge von `INVOICE_SETUP_REQUIREMENTS` — leer, wenn `ready`. */
|
|
237
|
+
missing: InvoiceSetupGap[];
|
|
238
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Typen der Rechnungs-API. Die Anfragen folgen `vertrag.ts` Feld fuer Feld;
|
|
4
|
+
* `test/rechnung-client.test.ts` schickt die Beispiele des Vertrags durch.
|
|
5
|
+
*
|
|
6
|
+
* Betraege sind ueberall ganze Cent. Datumsangaben sind `YYYY-MM-DD` nach
|
|
7
|
+
* Wiener Kalender.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Der Vertrag der Rechnungs-API — als Daten, nicht als Prosa.
|
|
3
|
+
*
|
|
4
|
+
* Aus dieser Datei entstehen drei Dinge, damit sie nicht auseinanderlaufen
|
|
5
|
+
* koennen:
|
|
6
|
+
*
|
|
7
|
+
* 1. `fixtures/rechnung-api.schema.json` (`npm run fixtures:rechnung`) — das
|
|
8
|
+
* Backend liest es aus dem vendorierten Paket und vergleicht es in beide
|
|
9
|
+
* Richtungen mit seiner eigenen Pruefung; der Dart-Zwilling zieht es byteweise.
|
|
10
|
+
* 2. Die Listen unter `rechnung` in `fixtures/oberflaeche.json` (Codes, Gruende,
|
|
11
|
+
* Enums) — ueber denselben Namensraum-Scan wie der Partner-Teil.
|
|
12
|
+
* 3. Die TypeScript-Typen in `typen.ts`.
|
|
13
|
+
*
|
|
14
|
+
* Nach aussen spricht die Schnittstelle Englisch: Feldnamen, Codes, Gruende.
|
|
15
|
+
* Deutsch bleibt, was ein Mensch liest (`message`, der Aufdruck eines Grundes).
|
|
16
|
+
*
|
|
17
|
+
* Beschrieben wird die Anfrage. Was der Server daraus macht — Rechnungsdatum,
|
|
18
|
+
* Nummer, Summen — ist bewusst **nicht** setzbar.
|
|
19
|
+
*/
|
|
20
|
+
export declare const RECHNUNG_VERTRAG_VERSION = 1;
|
|
21
|
+
export declare const RECHNUNG_AUFRUFE: readonly ["createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus"];
|
|
22
|
+
export type RechnungAufruf = (typeof RECHNUNG_AUFRUFE)[number];
|
|
23
|
+
/**
|
|
24
|
+
* Stabile Fehlercodes. Das Fremdsystem verzweigt am Code, der Text darf sich
|
|
25
|
+
* aendern. `validation` traegt zusaetzlich `errors: [{ field, message }]`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const INVOICE_ERROR_CODES: readonly ["validation", "idempotency_conflict", "module_inactive", "customer_not_found", "customer_exists", "short_code_taken", "short_code_immutable", "recipient_required", "invoice_requirements_missing", "invoice_not_found", "invoice_ambiguous", "not_cancellable", "partial_credit_exists", "credit_exceeds_invoice", "einvoice_incomplete", "invoice_api_not_enabled", "invoice_setup_incomplete"];
|
|
28
|
+
export type InvoiceErrorCode = (typeof INVOICE_ERROR_CODES)[number];
|
|
29
|
+
/** Gruende einer Gutschrift. Der Server druckt den deutschen Anzeigetext. */
|
|
30
|
+
export declare const CREDIT_NOTE_REASONS: readonly ["cancellation", "price_reduction", "return", "incorrect_invoice", "other"];
|
|
31
|
+
export type CreditNoteReason = (typeof CREDIT_NOTE_REASONS)[number];
|
|
32
|
+
export declare const TAX_SCHEMES: readonly ["normal", "smallBusiness", "reverseCharge", "igLieferung", "exportThirdCountry"];
|
|
33
|
+
export type TaxScheme = (typeof TAX_SCHEMES)[number];
|
|
34
|
+
export declare const PRICE_MODES: readonly ["net", "gross"];
|
|
35
|
+
export type PriceMode = (typeof PRICE_MODES)[number];
|
|
36
|
+
export declare const VAT_RATES: readonly [0, 10, 13, 20];
|
|
37
|
+
export type VatRatePercent = (typeof VAT_RATES)[number];
|
|
38
|
+
export declare const CUSTOMER_TYPES: readonly ["private", "company"];
|
|
39
|
+
export type CustomerType = (typeof CUSTOMER_TYPES)[number];
|
|
40
|
+
export declare const INVOICE_LIST_STATUS: readonly ["final", "paid", "cancelled", "open", "overdue"];
|
|
41
|
+
export type InvoiceListStatus = (typeof INVOICE_LIST_STATUS)[number];
|
|
42
|
+
export declare const DOC_TYPES: readonly ["RE", "GU"];
|
|
43
|
+
export type DocType = (typeof DOC_TYPES)[number];
|
|
44
|
+
export declare const EINVOICE_FORMATS: readonly ["ubl", "cii"];
|
|
45
|
+
export type EInvoiceFormat = (typeof EINVOICE_FORMATS)[number];
|
|
46
|
+
/**
|
|
47
|
+
* Was erfuellt sein muss, bevor ueber die API ausgestellt werden darf — in
|
|
48
|
+
* dieser Reihenfolge meldet `getInvoiceSetupStatus`, was fehlt, und dieselben
|
|
49
|
+
* Schluessel stehen in `invoice_setup_incomplete`.
|
|
50
|
+
*
|
|
51
|
+
* - `module_active` Modul Rechnung aktiv
|
|
52
|
+
* - `api_enabled` Rechnungs-API fuer das Konto von Kasseneck freigegeben (nur live)
|
|
53
|
+
* - `live_enabled` Konto live freigeschaltet (nur live)
|
|
54
|
+
* - `business_name`, `address`, `vat_id` Pflichtangaben des Ausstellers (§ 11 UStG;
|
|
55
|
+
* `vat_id` entfaellt bei Kleinunternehmern)
|
|
56
|
+
* - `bank_account` IBAN und Kontoinhaber
|
|
57
|
+
* - `number_format` Rechnungsnummern-Format bewusst gespeichert
|
|
58
|
+
*/
|
|
59
|
+
export declare const INVOICE_SETUP_REQUIREMENTS: readonly ["module_active", "api_enabled", "live_enabled", "business_name", "address", "vat_id", "bank_account", "number_format"];
|
|
60
|
+
export type InvoiceSetupRequirement = (typeof INVOICE_SETUP_REQUIREMENTS)[number];
|
|
61
|
+
/** Formate, die der Server mit `@kreiseck/validator` bzw. einem Muster prueft. */
|
|
62
|
+
export type Format = 'email' | 'phone' | 'vatId' | 'country' | 'date' | 'shortCode';
|
|
63
|
+
export type Feld = {
|
|
64
|
+
typ: 'string';
|
|
65
|
+
pflicht: boolean;
|
|
66
|
+
min?: number;
|
|
67
|
+
max: number;
|
|
68
|
+
format?: Format;
|
|
69
|
+
} | {
|
|
70
|
+
typ: 'integer';
|
|
71
|
+
pflicht: boolean;
|
|
72
|
+
min: number;
|
|
73
|
+
max: number;
|
|
74
|
+
} | {
|
|
75
|
+
typ: 'number';
|
|
76
|
+
pflicht: boolean;
|
|
77
|
+
min: number;
|
|
78
|
+
max: number;
|
|
79
|
+
nachkomma: number;
|
|
80
|
+
exklusivMin?: boolean;
|
|
81
|
+
} | {
|
|
82
|
+
typ: 'boolean';
|
|
83
|
+
pflicht: boolean;
|
|
84
|
+
} | {
|
|
85
|
+
typ: 'enum';
|
|
86
|
+
pflicht: boolean;
|
|
87
|
+
werte: readonly (string | number)[];
|
|
88
|
+
} | {
|
|
89
|
+
typ: 'object';
|
|
90
|
+
pflicht: boolean;
|
|
91
|
+
felder: Readonly<Record<string, Feld>>;
|
|
92
|
+
} | {
|
|
93
|
+
typ: 'list';
|
|
94
|
+
pflicht: boolean;
|
|
95
|
+
min: number;
|
|
96
|
+
max: number;
|
|
97
|
+
eintrag: Feld;
|
|
98
|
+
} | {
|
|
99
|
+
typ: 'map';
|
|
100
|
+
pflicht: boolean;
|
|
101
|
+
maxSchluessel: number;
|
|
102
|
+
schluesselMuster: string;
|
|
103
|
+
wertMax: number;
|
|
104
|
+
};
|
|
105
|
+
/** Kunde, wie das Fremdsystem ihn schickt. `vatId` ist die UID-Nummer. */
|
|
106
|
+
export declare const KUNDE_FELDER: Readonly<Record<string, Feld>>;
|
|
107
|
+
/** Eine Rechnungs- oder Gutschriftsposition. Preise in ganzen Cent. */
|
|
108
|
+
export declare const POSITION_FELDER: Readonly<Record<string, Feld>>;
|
|
109
|
+
export declare const RECHNUNG_ANFRAGEN: Readonly<Record<RechnungAufruf, Readonly<Record<string, Feld>>>>;
|
|
110
|
+
/** Genau eines dieser Felder muss gesetzt sein (je Aufruf, je Gruppe). */
|
|
111
|
+
export declare const RECHNUNG_GENAU_EINS: Readonly<Partial<Record<RechnungAufruf, readonly (readonly string[])[]>>>;
|
|
112
|
+
/** Mindestens eines dieser Felder muss gesetzt sein (je Aufruf, je Gruppe). */
|
|
113
|
+
export declare const RECHNUNG_MINDESTENS_EINS: Readonly<Partial<Record<RechnungAufruf, readonly (readonly string[])[]>>>;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Der Vertrag der Rechnungs-API — als Daten, nicht als Prosa.
|
|
4
|
+
*
|
|
5
|
+
* Aus dieser Datei entstehen drei Dinge, damit sie nicht auseinanderlaufen
|
|
6
|
+
* koennen:
|
|
7
|
+
*
|
|
8
|
+
* 1. `fixtures/rechnung-api.schema.json` (`npm run fixtures:rechnung`) — das
|
|
9
|
+
* Backend liest es aus dem vendorierten Paket und vergleicht es in beide
|
|
10
|
+
* Richtungen mit seiner eigenen Pruefung; der Dart-Zwilling zieht es byteweise.
|
|
11
|
+
* 2. Die Listen unter `rechnung` in `fixtures/oberflaeche.json` (Codes, Gruende,
|
|
12
|
+
* Enums) — ueber denselben Namensraum-Scan wie der Partner-Teil.
|
|
13
|
+
* 3. Die TypeScript-Typen in `typen.ts`.
|
|
14
|
+
*
|
|
15
|
+
* Nach aussen spricht die Schnittstelle Englisch: Feldnamen, Codes, Gruende.
|
|
16
|
+
* Deutsch bleibt, was ein Mensch liest (`message`, der Aufdruck eines Grundes).
|
|
17
|
+
*
|
|
18
|
+
* Beschrieben wird die Anfrage. Was der Server daraus macht — Rechnungsdatum,
|
|
19
|
+
* Nummer, Summen — ist bewusst **nicht** setzbar.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.RECHNUNG_MINDESTENS_EINS = exports.RECHNUNG_GENAU_EINS = exports.RECHNUNG_ANFRAGEN = exports.POSITION_FELDER = exports.KUNDE_FELDER = exports.INVOICE_SETUP_REQUIREMENTS = exports.EINVOICE_FORMATS = exports.DOC_TYPES = exports.INVOICE_LIST_STATUS = exports.CUSTOMER_TYPES = exports.VAT_RATES = exports.PRICE_MODES = exports.TAX_SCHEMES = exports.CREDIT_NOTE_REASONS = exports.INVOICE_ERROR_CODES = exports.RECHNUNG_AUFRUFE = exports.RECHNUNG_VERTRAG_VERSION = void 0;
|
|
23
|
+
exports.RECHNUNG_VERTRAG_VERSION = 1;
|
|
24
|
+
exports.RECHNUNG_AUFRUFE = [
|
|
25
|
+
'createCustomer',
|
|
26
|
+
'getCustomer',
|
|
27
|
+
'updateCustomer',
|
|
28
|
+
'searchCustomers',
|
|
29
|
+
'issueInvoice',
|
|
30
|
+
'cancelInvoice',
|
|
31
|
+
'createCreditNote',
|
|
32
|
+
'getInvoice',
|
|
33
|
+
'listInvoices',
|
|
34
|
+
'getInvoicePdf',
|
|
35
|
+
'getInvoiceXml',
|
|
36
|
+
'getInvoiceSetupStatus',
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Stabile Fehlercodes. Das Fremdsystem verzweigt am Code, der Text darf sich
|
|
40
|
+
* aendern. `validation` traegt zusaetzlich `errors: [{ field, message }]`.
|
|
41
|
+
*/
|
|
42
|
+
exports.INVOICE_ERROR_CODES = [
|
|
43
|
+
'validation',
|
|
44
|
+
'idempotency_conflict',
|
|
45
|
+
'module_inactive',
|
|
46
|
+
'customer_not_found',
|
|
47
|
+
'customer_exists',
|
|
48
|
+
'short_code_taken',
|
|
49
|
+
'short_code_immutable',
|
|
50
|
+
'recipient_required',
|
|
51
|
+
'invoice_requirements_missing',
|
|
52
|
+
'invoice_not_found',
|
|
53
|
+
'invoice_ambiguous',
|
|
54
|
+
'not_cancellable',
|
|
55
|
+
'partial_credit_exists',
|
|
56
|
+
'credit_exceeds_invoice',
|
|
57
|
+
'einvoice_incomplete',
|
|
58
|
+
'invoice_api_not_enabled',
|
|
59
|
+
'invoice_setup_incomplete',
|
|
60
|
+
];
|
|
61
|
+
/** Gruende einer Gutschrift. Der Server druckt den deutschen Anzeigetext. */
|
|
62
|
+
exports.CREDIT_NOTE_REASONS = [
|
|
63
|
+
'cancellation',
|
|
64
|
+
'price_reduction',
|
|
65
|
+
'return',
|
|
66
|
+
'incorrect_invoice',
|
|
67
|
+
'other',
|
|
68
|
+
];
|
|
69
|
+
exports.TAX_SCHEMES = ['normal', 'smallBusiness', 'reverseCharge', 'igLieferung', 'exportThirdCountry'];
|
|
70
|
+
exports.PRICE_MODES = ['net', 'gross'];
|
|
71
|
+
exports.VAT_RATES = [0, 10, 13, 20];
|
|
72
|
+
exports.CUSTOMER_TYPES = ['private', 'company'];
|
|
73
|
+
exports.INVOICE_LIST_STATUS = ['final', 'paid', 'cancelled', 'open', 'overdue'];
|
|
74
|
+
exports.DOC_TYPES = ['RE', 'GU'];
|
|
75
|
+
exports.EINVOICE_FORMATS = ['ubl', 'cii'];
|
|
76
|
+
/**
|
|
77
|
+
* Was erfuellt sein muss, bevor ueber die API ausgestellt werden darf — in
|
|
78
|
+
* dieser Reihenfolge meldet `getInvoiceSetupStatus`, was fehlt, und dieselben
|
|
79
|
+
* Schluessel stehen in `invoice_setup_incomplete`.
|
|
80
|
+
*
|
|
81
|
+
* - `module_active` Modul Rechnung aktiv
|
|
82
|
+
* - `api_enabled` Rechnungs-API fuer das Konto von Kasseneck freigegeben (nur live)
|
|
83
|
+
* - `live_enabled` Konto live freigeschaltet (nur live)
|
|
84
|
+
* - `business_name`, `address`, `vat_id` Pflichtangaben des Ausstellers (§ 11 UStG;
|
|
85
|
+
* `vat_id` entfaellt bei Kleinunternehmern)
|
|
86
|
+
* - `bank_account` IBAN und Kontoinhaber
|
|
87
|
+
* - `number_format` Rechnungsnummern-Format bewusst gespeichert
|
|
88
|
+
*/
|
|
89
|
+
exports.INVOICE_SETUP_REQUIREMENTS = [
|
|
90
|
+
'module_active',
|
|
91
|
+
'api_enabled',
|
|
92
|
+
'live_enabled',
|
|
93
|
+
'business_name',
|
|
94
|
+
'address',
|
|
95
|
+
'vat_id',
|
|
96
|
+
'bank_account',
|
|
97
|
+
'number_format',
|
|
98
|
+
];
|
|
99
|
+
const text = (max, pflicht = false, extra = {}) => ({ typ: 'string', pflicht, max, ...(pflicht && extra.min === undefined ? { min: 1 } : {}), ...extra });
|
|
100
|
+
const idempotencyKey = (pflicht) => ({ typ: 'string', pflicht, min: 1, max: 120 });
|
|
101
|
+
const id = { typ: 'string', pflicht: false, min: 1, max: 128 };
|
|
102
|
+
const idPflicht = { typ: 'string', pflicht: true, min: 1, max: 128 };
|
|
103
|
+
const datum = (pflicht = false) => ({ typ: 'string', pflicht, min: 10, max: 10, format: 'date' });
|
|
104
|
+
const limit = { typ: 'integer', pflicht: false, min: 1, max: 100 };
|
|
105
|
+
const cursor = { typ: 'string', pflicht: false, min: 1, max: 500 };
|
|
106
|
+
/** Kunde, wie das Fremdsystem ihn schickt. `vatId` ist die UID-Nummer. */
|
|
107
|
+
exports.KUNDE_FELDER = Object.freeze({
|
|
108
|
+
type: { typ: 'enum', pflicht: true, werte: exports.CUSTOMER_TYPES },
|
|
109
|
+
name: text(200, true),
|
|
110
|
+
legalForm: text(40),
|
|
111
|
+
email: text(254, false, { format: 'email' }),
|
|
112
|
+
phone: text(40, false, { format: 'phone' }),
|
|
113
|
+
street: text(200),
|
|
114
|
+
houseNumber: text(20),
|
|
115
|
+
zip: text(10),
|
|
116
|
+
city: text(100),
|
|
117
|
+
country: text(2, true, { min: 2, format: 'country' }),
|
|
118
|
+
vatId: text(20, false, { format: 'vatId' }),
|
|
119
|
+
shortCode: text(8, false, { format: 'shortCode' }),
|
|
120
|
+
isAuthority: { typ: 'boolean', pflicht: false },
|
|
121
|
+
note: text(1000),
|
|
122
|
+
externalId: { typ: 'string', pflicht: false, min: 1, max: 120 },
|
|
123
|
+
});
|
|
124
|
+
/** Beim Aendern ist jedes Kundenfeld optional. */
|
|
125
|
+
const KUNDE_PATCH = Object.freeze(Object.fromEntries(Object.entries(exports.KUNDE_FELDER).map(([name, feld]) => [name, { ...feld, pflicht: false }])));
|
|
126
|
+
/** Eine Rechnungs- oder Gutschriftsposition. Preise in ganzen Cent. */
|
|
127
|
+
exports.POSITION_FELDER = Object.freeze({
|
|
128
|
+
description: text(300, true),
|
|
129
|
+
subtitle: text(1000),
|
|
130
|
+
quantity: { typ: 'number', pflicht: true, min: 0, exklusivMin: true, max: 1_000_000, nachkomma: 3 },
|
|
131
|
+
unit: text(20),
|
|
132
|
+
unitPriceCents: { typ: 'integer', pflicht: true, min: 0, max: 100_000_000 },
|
|
133
|
+
vatRate: { typ: 'enum', pflicht: true, werte: exports.VAT_RATES },
|
|
134
|
+
discountPct: { typ: 'number', pflicht: false, min: 0, max: 100, nachkomma: 2 },
|
|
135
|
+
});
|
|
136
|
+
const positionen = { typ: 'list', pflicht: true, min: 1, max: 500, eintrag: { typ: 'object', pflicht: true, felder: exports.POSITION_FELDER } };
|
|
137
|
+
exports.RECHNUNG_ANFRAGEN = Object.freeze({
|
|
138
|
+
createCustomer: {
|
|
139
|
+
customer: { typ: 'object', pflicht: true, felder: exports.KUNDE_FELDER },
|
|
140
|
+
idempotencyKey: idempotencyKey(false),
|
|
141
|
+
},
|
|
142
|
+
getCustomer: {
|
|
143
|
+
customerId: id,
|
|
144
|
+
externalId: { typ: 'string', pflicht: false, min: 1, max: 120 },
|
|
145
|
+
},
|
|
146
|
+
updateCustomer: {
|
|
147
|
+
customerId: idPflicht,
|
|
148
|
+
customer: { typ: 'object', pflicht: true, felder: KUNDE_PATCH },
|
|
149
|
+
},
|
|
150
|
+
searchCustomers: {
|
|
151
|
+
externalId: { typ: 'string', pflicht: false, min: 1, max: 120 },
|
|
152
|
+
vatId: text(20),
|
|
153
|
+
email: text(254),
|
|
154
|
+
name: text(200),
|
|
155
|
+
limit,
|
|
156
|
+
cursor,
|
|
157
|
+
},
|
|
158
|
+
issueInvoice: {
|
|
159
|
+
idempotencyKey: idempotencyKey(true),
|
|
160
|
+
customerId: id,
|
|
161
|
+
taxScheme: { typ: 'enum', pflicht: true, werte: exports.TAX_SCHEMES },
|
|
162
|
+
priceMode: { typ: 'enum', pflicht: true, werte: exports.PRICE_MODES },
|
|
163
|
+
serviceStart: datum(true),
|
|
164
|
+
serviceEnd: datum(),
|
|
165
|
+
paymentTermDays: { typ: 'integer', pflicht: false, min: 0, max: 365 },
|
|
166
|
+
orderReference: text(200),
|
|
167
|
+
intro: text(2000),
|
|
168
|
+
note: text(2000),
|
|
169
|
+
paymentReference: text(140),
|
|
170
|
+
girocode: { typ: 'boolean', pflicht: false },
|
|
171
|
+
tracking: { typ: 'boolean', pflicht: false },
|
|
172
|
+
items: positionen,
|
|
173
|
+
metadata: { typ: 'map', pflicht: false, maxSchluessel: 20, schluesselMuster: '^[a-zA-Z0-9_]{1,40}$', wertMax: 500 },
|
|
174
|
+
},
|
|
175
|
+
cancelInvoice: {
|
|
176
|
+
idempotencyKey: idempotencyKey(true),
|
|
177
|
+
invoiceId: idPflicht,
|
|
178
|
+
reason: { typ: 'enum', pflicht: true, werte: exports.CREDIT_NOTE_REASONS },
|
|
179
|
+
note: text(2000),
|
|
180
|
+
},
|
|
181
|
+
createCreditNote: {
|
|
182
|
+
idempotencyKey: idempotencyKey(true),
|
|
183
|
+
invoiceId: idPflicht,
|
|
184
|
+
reason: { typ: 'enum', pflicht: true, werte: exports.CREDIT_NOTE_REASONS },
|
|
185
|
+
note: text(2000),
|
|
186
|
+
items: positionen,
|
|
187
|
+
},
|
|
188
|
+
getInvoice: {
|
|
189
|
+
invoiceId: id,
|
|
190
|
+
number: { typ: 'string', pflicht: false, min: 1, max: 100 },
|
|
191
|
+
},
|
|
192
|
+
listInvoices: {
|
|
193
|
+
from: datum(),
|
|
194
|
+
to: datum(),
|
|
195
|
+
status: { typ: 'enum', pflicht: false, werte: exports.INVOICE_LIST_STATUS },
|
|
196
|
+
docType: { typ: 'enum', pflicht: false, werte: exports.DOC_TYPES },
|
|
197
|
+
customerId: id,
|
|
198
|
+
limit,
|
|
199
|
+
cursor,
|
|
200
|
+
},
|
|
201
|
+
getInvoicePdf: {
|
|
202
|
+
invoiceId: idPflicht,
|
|
203
|
+
},
|
|
204
|
+
getInvoiceXml: {
|
|
205
|
+
invoiceId: idPflicht,
|
|
206
|
+
format: { typ: 'enum', pflicht: false, werte: exports.EINVOICE_FORMATS },
|
|
207
|
+
},
|
|
208
|
+
getInvoiceSetupStatus: {},
|
|
209
|
+
});
|
|
210
|
+
/** Genau eines dieser Felder muss gesetzt sein (je Aufruf, je Gruppe). */
|
|
211
|
+
exports.RECHNUNG_GENAU_EINS = Object.freeze({
|
|
212
|
+
getCustomer: [['customerId', 'externalId']],
|
|
213
|
+
getInvoice: [['invoiceId', 'number']],
|
|
214
|
+
});
|
|
215
|
+
/** Mindestens eines dieser Felder muss gesetzt sein (je Aufruf, je Gruppe). */
|
|
216
|
+
exports.RECHNUNG_MINDESTENS_EINS = Object.freeze({
|
|
217
|
+
searchCustomers: [['externalId', 'vatId', 'email', 'name']],
|
|
218
|
+
});
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* umhuellt, muss ihn weiterhin absetzen koennen.
|
|
14
14
|
*/
|
|
15
15
|
import type { TransportBodyFields } from './transport.js';
|
|
16
|
-
export declare const AUFRUFE: readonly ["activateCashregister", "cancelReceipt", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCustomerCredentials", "getCustomerSignatureStatus", "getFirstReceiptDate", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "hobexPayApi", "hobexRefundApi", "listCustomerCashregisters", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "requestCustomerSignature", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updatePartnerWebhook"];
|
|
16
|
+
export declare const AUFRUFE: readonly ["activateCashregister", "cancelInvoice", "cancelReceipt", "createCreditNote", "createCustomer", "createCustomerCashregister", "createPartnerCustomer", "checkPartnerCustomerEmail", "createPartnerWebhook", "createPaymentLinkStripe", "createPrintJob", "createReceipt", "deletePartnerWebhook", "downloadDailyReport", "downloadReport", "endRegisterSession", "financeWebService", "generateFullReceiptId", "getCustomer", "getCustomerCredentials", "getCustomerSignatureStatus", "getFirstReceiptDate", "getInvoice", "getInvoicePdf", "getInvoiceSetupStatus", "getInvoiceXml", "getKasseSettings", "getPartnerCustomer", "getPartnerInfo", "getPrintJob", "getReceipt", "hobexPayApi", "hobexRefundApi", "issueInvoice", "listCustomerCashregisters", "listInvoices", "listMyArticleGroups", "listMyArticles", "listMyCashregisters", "listMyPrinters", "listMyReceipts", "listMyTipRecipients", "listPartnerCustomers", "listPartnerWebhookDeliveries", "listPartnerWebhooks", "listRegisterUsersForDevice", "listRegisterSessionsForDevice", "pairRegisterDevice", "registerPinLogin", "registerUserLogin", "renewRegisterSession", "requestCustomerSignature", "searchCustomers", "sendPartnerCustomerFonLink", "sendPartnerWebhookTest", "sendReceiptEmail", "setMyKasseSettings", "setMyRegisterDeviceSettings", "stripeCaptureIntent", "unpairRegisterDevice", "rotatePartnerWebhookSecret", "updateCustomer", "updatePartnerWebhook"];
|
|
17
17
|
export type Aufruf = typeof AUFRUFE[number];
|
|
18
18
|
/** Wie [KasseneckTransport], nur mit bekanntem Aufrufnamen. Nicht exportiert nach aussen. */
|
|
19
19
|
export type InternerTransport = <T = unknown>(functionName: Aufruf, params?: Record<string, unknown>, extraBodyFields?: TransportBodyFields, secretParams?: readonly string[]) => Promise<T>;
|