@reservation-studio/electron-types 0.0.30 → 0.0.32
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/README.md +2 -2
- package/dist/api/exports.d.ts +2 -5
- package/dist/api/exports.js +1 -4
- package/dist/interfaces/{api.interface.d.ts → public/api.interface.d.ts} +17 -16
- package/dist/interfaces/public/fiscal-device/device.types.d.ts +222 -0
- package/dist/interfaces/public/fiscal-device/diagnostics.types.d.ts +47 -0
- package/dist/interfaces/public/fiscal-device/diagnostics.types.js +2 -0
- package/dist/interfaces/public/fiscal-device/errors.types.d.ts +78 -0
- package/dist/interfaces/public/fiscal-device/errors.types.js +50 -0
- package/dist/interfaces/public/fiscal-device/index.d.ts +5 -0
- package/dist/interfaces/public/fiscal-device/index.js +21 -0
- package/dist/interfaces/public/fiscal-device/receipts.types.d.ts +170 -0
- package/dist/interfaces/{fiscal-device.interface.js → public/fiscal-device/receipts.types.js} +2 -9
- package/dist/interfaces/public/fiscal-device/shared.types.d.ts +36 -0
- package/dist/interfaces/public/fiscal-device/shared.types.js +10 -0
- package/dist/interfaces/public/http.interface.js +2 -0
- package/dist/interfaces/public/index.d.ts +4 -0
- package/dist/interfaces/public/index.js +20 -0
- package/package.json +1 -1
- package/dist/interfaces/fiscal-device.interface.d.ts +0 -469
- /package/dist/interfaces/{api.interface.js → public/api.interface.js} +0 -0
- /package/dist/interfaces/{certificate-info.interface.d.ts → public/certificate-info.interface.d.ts} +0 -0
- /package/dist/interfaces/{certificate-info.interface.js → public/certificate-info.interface.js} +0 -0
- /package/dist/interfaces/{http.interface.js → public/fiscal-device/device.types.js} +0 -0
- /package/dist/interfaces/{http.interface.d.ts → public/http.interface.d.ts} +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { BarcodeData, OperatorInfo } from './shared.types';
|
|
2
|
+
/**
|
|
3
|
+
* Common payload fields shared by fiscal and non-fiscal receipts.
|
|
4
|
+
*/
|
|
5
|
+
export interface BaseReceipt {
|
|
6
|
+
/**
|
|
7
|
+
* Operator information
|
|
8
|
+
*/
|
|
9
|
+
operator: OperatorInfo;
|
|
10
|
+
/**
|
|
11
|
+
* The items in the receipt
|
|
12
|
+
*/
|
|
13
|
+
items: FiscalReceiptItem[];
|
|
14
|
+
/**
|
|
15
|
+
* The client information (for invoice receipts)
|
|
16
|
+
*/
|
|
17
|
+
client?: FiscalClient;
|
|
18
|
+
/**
|
|
19
|
+
* Optional text lines to be printed immediately after the receipt header.
|
|
20
|
+
*/
|
|
21
|
+
headerText?: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Optional text lines to be printed at the end of the receipt (before payments).
|
|
24
|
+
*/
|
|
25
|
+
footerText?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Optional barcode to be printed at the end of the receipt (footer).
|
|
28
|
+
* Useful for loyalty programs, order tracking, or return vouchers.
|
|
29
|
+
*/
|
|
30
|
+
footerBarcode?: BarcodeData;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Interface for fiscal receipt
|
|
34
|
+
*/
|
|
35
|
+
export interface FiscalReceipt extends BaseReceipt {
|
|
36
|
+
/**
|
|
37
|
+
* Numeric string up to 7 digits, used as part of the UNP.
|
|
38
|
+
*/
|
|
39
|
+
uniqueSaleNumber: string;
|
|
40
|
+
/**
|
|
41
|
+
* The payments in the receipt. The total must cover the receipt amount to close.
|
|
42
|
+
*/
|
|
43
|
+
payments: FiscalPayment[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Interface for non-fiscal (service) receipt
|
|
47
|
+
*/
|
|
48
|
+
export interface NonFiscalReceipt extends BaseReceipt {
|
|
49
|
+
/**
|
|
50
|
+
* Optional informational payments printed on the receipt.
|
|
51
|
+
*/
|
|
52
|
+
payments?: FiscalPayment[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Interface for fiscal receipt item
|
|
56
|
+
*/
|
|
57
|
+
export interface FiscalReceiptItem {
|
|
58
|
+
/**
|
|
59
|
+
* The name of the item
|
|
60
|
+
*/
|
|
61
|
+
name: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional description providing additional information or context.
|
|
64
|
+
* This can be used to supply user-friendly details or explanations
|
|
65
|
+
* associated with a particular resource, item, or operation.
|
|
66
|
+
*/
|
|
67
|
+
description?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The price of the item including tax (VAT inclusive).
|
|
70
|
+
* This price will be sent directly to the fiscal device and must include all applicable taxes.
|
|
71
|
+
*/
|
|
72
|
+
unitPrice: number;
|
|
73
|
+
/**
|
|
74
|
+
* The quantity of the item
|
|
75
|
+
*/
|
|
76
|
+
quantity: number;
|
|
77
|
+
/**
|
|
78
|
+
* The VAT group of the item
|
|
79
|
+
*/
|
|
80
|
+
vatGroup: FiscalVATGroup;
|
|
81
|
+
/**
|
|
82
|
+
* Discount percentage (optional). Use 0-100, no surcharges.
|
|
83
|
+
*/
|
|
84
|
+
discount?: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Interface for fiscal payment
|
|
88
|
+
*/
|
|
89
|
+
export interface FiscalPayment {
|
|
90
|
+
/**
|
|
91
|
+
* The payment type
|
|
92
|
+
*/
|
|
93
|
+
type: FiscalPaymentType;
|
|
94
|
+
/**
|
|
95
|
+
* The amount of the payment
|
|
96
|
+
*/
|
|
97
|
+
amount: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Enum for fiscal payment types
|
|
101
|
+
*/
|
|
102
|
+
export declare enum FiscalPaymentType {
|
|
103
|
+
CASH = "cash",
|
|
104
|
+
CARD = "card",
|
|
105
|
+
CHECK = "check",
|
|
106
|
+
TRANSFER = "transfer"
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Interface for fiscal client information
|
|
110
|
+
*/
|
|
111
|
+
export interface FiscalClient {
|
|
112
|
+
/**
|
|
113
|
+
* The name of the client
|
|
114
|
+
*/
|
|
115
|
+
name: string;
|
|
116
|
+
/**
|
|
117
|
+
* The address of the client
|
|
118
|
+
*/
|
|
119
|
+
address?: string;
|
|
120
|
+
/**
|
|
121
|
+
* The tax number of the client
|
|
122
|
+
*/
|
|
123
|
+
taxNumber?: string;
|
|
124
|
+
/**
|
|
125
|
+
* The VAT number of the client
|
|
126
|
+
*/
|
|
127
|
+
vatNumber?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Interface for reversal receipt
|
|
131
|
+
*/
|
|
132
|
+
export interface ReversalReceipt extends FiscalReceipt {
|
|
133
|
+
/**
|
|
134
|
+
* The reason for the reversal
|
|
135
|
+
*/
|
|
136
|
+
reason: ReversalReason;
|
|
137
|
+
/**
|
|
138
|
+
* The original receipt number
|
|
139
|
+
*/
|
|
140
|
+
originalReceiptNumber: string;
|
|
141
|
+
/**
|
|
142
|
+
* The original receipt date and time
|
|
143
|
+
*/
|
|
144
|
+
originalReceiptDateTime: Date;
|
|
145
|
+
/**
|
|
146
|
+
* The original fiscal memory serial number
|
|
147
|
+
*/
|
|
148
|
+
originalFiscalMemorySerialNumber: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Enum for reversal reasons
|
|
152
|
+
*/
|
|
153
|
+
export declare enum ReversalReason {
|
|
154
|
+
VOID = "void",
|
|
155
|
+
REFUND = "refund",
|
|
156
|
+
TAX_BASE_REDUCTION = "tax-base-reduction"
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Enum for fiscal VAT groups
|
|
160
|
+
*/
|
|
161
|
+
export declare enum FiscalVATGroup {
|
|
162
|
+
A = "1",// 20%
|
|
163
|
+
B = "2",// 9%
|
|
164
|
+
C = "3",// 0%
|
|
165
|
+
D = "4",// Exempt
|
|
166
|
+
E = "5",// Special rate 1
|
|
167
|
+
F = "6",// Special rate 2
|
|
168
|
+
G = "7",// Special rate 3
|
|
169
|
+
H = "8"
|
|
170
|
+
}
|
package/dist/interfaces/{fiscal-device.interface.js → public/fiscal-device/receipts.types.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FiscalVATGroup = exports.ReversalReason = exports.FiscalPaymentType = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Enum for fiscal payment types
|
|
6
6
|
*/
|
|
@@ -16,7 +16,7 @@ var FiscalPaymentType;
|
|
|
16
16
|
*/
|
|
17
17
|
var ReversalReason;
|
|
18
18
|
(function (ReversalReason) {
|
|
19
|
-
ReversalReason["
|
|
19
|
+
ReversalReason["VOID"] = "void";
|
|
20
20
|
ReversalReason["REFUND"] = "refund";
|
|
21
21
|
ReversalReason["TAX_BASE_REDUCTION"] = "tax-base-reduction";
|
|
22
22
|
})(ReversalReason || (exports.ReversalReason = ReversalReason = {}));
|
|
@@ -34,10 +34,3 @@ var FiscalVATGroup;
|
|
|
34
34
|
FiscalVATGroup["G"] = "7";
|
|
35
35
|
FiscalVATGroup["H"] = "8"; // Special rate 4
|
|
36
36
|
})(FiscalVATGroup || (exports.FiscalVATGroup = FiscalVATGroup = {}));
|
|
37
|
-
var BarcodeType;
|
|
38
|
-
(function (BarcodeType) {
|
|
39
|
-
BarcodeType["EAN8"] = "EAN8";
|
|
40
|
-
BarcodeType["EAN13"] = "EAN13";
|
|
41
|
-
BarcodeType["CODE128"] = "CODE128";
|
|
42
|
-
BarcodeType["QR"] = "QR";
|
|
43
|
-
})(BarcodeType || (exports.BarcodeType = BarcodeType = {}));
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for fiscal device communication between renderer and main process.
|
|
3
|
+
*/
|
|
4
|
+
export type DeviceId = string;
|
|
5
|
+
export type TransportType = 'serial' | 'tcp' | 'bluetooth-spp' | 'bluetooth-ble' | 'hid' | 'sdk';
|
|
6
|
+
/**
|
|
7
|
+
* Interface for operator information
|
|
8
|
+
*/
|
|
9
|
+
export interface OperatorInfo {
|
|
10
|
+
/**
|
|
11
|
+
* The operator number
|
|
12
|
+
*/
|
|
13
|
+
number: number;
|
|
14
|
+
/**
|
|
15
|
+
* A string representing the password for authentication or security purposes.
|
|
16
|
+
* This variable typically holds sensitive information and should be handled securely.
|
|
17
|
+
* Ensure this value is kept private and not exposed in any logs or outputs.
|
|
18
|
+
*/
|
|
19
|
+
password: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional operator code. If not provided, driver may derive it from operator number.
|
|
22
|
+
*/
|
|
23
|
+
code?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare enum BarcodeType {
|
|
26
|
+
EAN8 = "EAN8",
|
|
27
|
+
EAN13 = "EAN13",
|
|
28
|
+
CODE128 = "CODE128",
|
|
29
|
+
QR = "QR"
|
|
30
|
+
}
|
|
31
|
+
export interface BarcodeData {
|
|
32
|
+
type: BarcodeType;
|
|
33
|
+
data: string;
|
|
34
|
+
height?: number;
|
|
35
|
+
printText?: boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BarcodeType = void 0;
|
|
4
|
+
var BarcodeType;
|
|
5
|
+
(function (BarcodeType) {
|
|
6
|
+
BarcodeType["EAN8"] = "EAN8";
|
|
7
|
+
BarcodeType["EAN13"] = "EAN13";
|
|
8
|
+
BarcodeType["CODE128"] = "CODE128";
|
|
9
|
+
BarcodeType["QR"] = "QR";
|
|
10
|
+
})(BarcodeType || (exports.BarcodeType = BarcodeType = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api.interface"), exports);
|
|
18
|
+
__exportStar(require("./certificate-info.interface"), exports);
|
|
19
|
+
__exportStar(require("./http.interface"), exports);
|
|
20
|
+
__exportStar(require("./fiscal-device"), exports);
|