@dodobrands/pos-receipts-plugin-contracts 5.13.0 → 5.13.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/dist/index.cjs CHANGED
@@ -1,99 +1 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- Business: () => Business,
24
- DigitalReceiptNotificationPreference: () => DigitalReceiptNotificationPreference,
25
- KnownCountryCodes: () => KnownCountryCodes,
26
- OrderSource: () => OrderSource,
27
- OrderType: () => OrderType,
28
- OwnerType: () => OwnerType,
29
- PaymentType: () => PaymentType
30
- });
31
- module.exports = __toCommonJS(src_exports);
32
-
33
- // ../../shared/pos-plugins-shared-models/dist/index.js
34
- var Business = /* @__PURE__ */ ((Business2) => {
35
- Business2["DodoPizza"] = `dodoPizza`;
36
- Business2["Drinkit"] = `drinkit`;
37
- Business2["Doner42"] = `doner42`;
38
- return Business2;
39
- })(Business || {});
40
- var KnownCountryCodes = /* @__PURE__ */ ((KnownCountryCodes2) => {
41
- KnownCountryCodes2[KnownCountryCodes2["Belarus"] = 112] = "Belarus";
42
- KnownCountryCodes2[KnownCountryCodes2["Kazakhstan"] = 398] = "Kazakhstan";
43
- KnownCountryCodes2[KnownCountryCodes2["Russia"] = 643] = "Russia";
44
- KnownCountryCodes2[KnownCountryCodes2["Uzbekistan"] = 860] = "Uzbekistan";
45
- KnownCountryCodes2[KnownCountryCodes2["Kyrgyzstan"] = 417] = "Kyrgyzstan";
46
- return KnownCountryCodes2;
47
- })(KnownCountryCodes || {});
48
- var OwnerType = /* @__PURE__ */ ((OwnerType2) => {
49
- OwnerType2[OwnerType2["Resail"] = 0] = "Resail";
50
- OwnerType2[OwnerType2["OwnProduction"] = 1] = "OwnProduction";
51
- OwnerType2[OwnerType2["Service"] = 2] = "Service";
52
- return OwnerType2;
53
- })(OwnerType || {});
54
- var OrderType = /* @__PURE__ */ ((OrderType2) => {
55
- OrderType2[OrderType2["Delivery"] = 1] = "Delivery";
56
- OrderType2[OrderType2["Pickup"] = 2] = "Pickup";
57
- OrderType2[OrderType2["Stationary"] = 3] = "Stationary";
58
- OrderType2[OrderType2["PersonalFood"] = 4] = "PersonalFood";
59
- OrderType2[OrderType2["ShopWindowSupply"] = 5] = "ShopWindowSupply";
60
- return OrderType2;
61
- })(OrderType || {});
62
- var OrderSource = /* @__PURE__ */ ((OrderSource2) => {
63
- OrderSource2[OrderSource2["Telephone"] = 0] = "Telephone";
64
- OrderSource2[OrderSource2["Site"] = 1] = "Site";
65
- OrderSource2[OrderSource2["Restaurant"] = 2] = "Restaurant";
66
- OrderSource2[OrderSource2["DefectOrder"] = 3] = "DefectOrder";
67
- OrderSource2[OrderSource2["Mobile"] = 4] = "Mobile";
68
- OrderSource2[OrderSource2["Pizzeria"] = 5] = "Pizzeria";
69
- OrderSource2[OrderSource2["Aggregator"] = 6] = "Aggregator";
70
- OrderSource2[OrderSource2["Kiosk"] = 7] = "Kiosk";
71
- return OrderSource2;
72
- })(OrderSource || {});
73
- var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
74
- PaymentType2[PaymentType2["Cash"] = 0] = "Cash";
75
- PaymentType2[PaymentType2["BankCard"] = 1] = "BankCard";
76
- PaymentType2[PaymentType2["InternetAcquiring"] = 2] = "InternetAcquiring";
77
- PaymentType2[PaymentType2["Aggregator"] = 3] = "Aggregator";
78
- return PaymentType2;
79
- })(PaymentType || {});
80
-
81
- // src/PrintParams.ts
82
- var DigitalReceiptNotificationPreference = /* @__PURE__ */ ((DigitalReceiptNotificationPreference2) => {
83
- DigitalReceiptNotificationPreference2["NotSpecified"] = `NotSpecified`;
84
- DigitalReceiptNotificationPreference2["None"] = `None`;
85
- DigitalReceiptNotificationPreference2["Email"] = `Email`;
86
- DigitalReceiptNotificationPreference2["PhoneSms"] = `PhoneSms`;
87
- return DigitalReceiptNotificationPreference2;
88
- })(DigitalReceiptNotificationPreference || {});
89
- // Annotate the CommonJS export names for ESM import in node:
90
- 0 && (module.exports = {
91
- Business,
92
- DigitalReceiptNotificationPreference,
93
- KnownCountryCodes,
94
- OrderSource,
95
- OrderType,
96
- OwnerType,
97
- PaymentType
98
- });
99
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";var e=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var h=(t,o)=>{for(var a in o)e(t,a,{get:o[a],enumerable:!0})},z=(t,o,a,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of l(o))!k.call(t,r)&&r!==a&&e(t,r,{get:()=>o[r],enumerable:!(m=d(o,r))||m.enumerable});return t};var R=t=>z(e({},"__esModule",{value:!0}),t);var v={};h(v,{Business:()=>i,DigitalReceiptNotificationPreference:()=>g,KnownCountryCodes:()=>p,OrderSource:()=>f,OrderType:()=>s,OwnerType:()=>n,PaymentType:()=>x});module.exports=R(v);var i=(t=>(t.DodoPizza="dodoPizza",t.Drinkit="drinkit",t.Doner42="doner42",t))(i||{}),p=(t=>(t[t.Belarus=112]="Belarus",t[t.Kazakhstan=398]="Kazakhstan",t[t.Russia=643]="Russia",t[t.Uzbekistan=860]="Uzbekistan",t[t.Kyrgyzstan=417]="Kyrgyzstan",t))(p||{}),n=(t=>(t[t.Resail=0]="Resail",t[t.OwnProduction=1]="OwnProduction",t[t.Service=2]="Service",t))(n||{});var s=(t=>(t[t.Delivery=1]="Delivery",t[t.Pickup=2]="Pickup",t[t.Stationary=3]="Stationary",t[t.PersonalFood=4]="PersonalFood",t[t.ShopWindowSupply=5]="ShopWindowSupply",t))(s||{}),f=(t=>(t[t.Telephone=0]="Telephone",t[t.Site=1]="Site",t[t.Restaurant=2]="Restaurant",t[t.DefectOrder=3]="DefectOrder",t[t.Mobile=4]="Mobile",t[t.Pizzeria=5]="Pizzeria",t[t.Aggregator=6]="Aggregator",t[t.Kiosk=7]="Kiosk",t))(f||{}),x=(t=>(t[t.Cash=0]="Cash",t[t.BankCard=1]="BankCard",t[t.InternetAcquiring=2]="InternetAcquiring",t[t.Aggregator=3]="Aggregator",t))(x||{});var g=(r=>(r.NotSpecified="NotSpecified",r.None="None",r.Email="Email",r.PhoneSms="PhoneSms",r))(g||{});0&&(module.exports={Business,DigitalReceiptNotificationPreference,KnownCountryCodes,OrderSource,OrderType,OwnerType,PaymentType});
package/dist/index.d.cts CHANGED
@@ -1,5 +1,480 @@
1
- import { Taxpayer, PaymentProvider, PaymentStatus, OrderRefundResult, RefundSource, Receipt, OrderPaymentResult, PaymentSource, Business, Country, ILogger } from '@dodobrands/pos-plugins-shared-models';
2
- export { AddedIngredient, Business, CashRegister, Cashier, Country, CountryIsoCode, Customer, Image, KazakhstanProductData, KnownCountryCodes, KyrgyzstanProductData, Loyalty, MarkingCodes, Order, OrderPrice, OrderSource, OrderType, Organization, OwnerType, PaymentType, PreviousReceipt, Product, ProductPrice, ProductSpecificData, Receipt, Store, Tax, Taxpayer, UzbekistanProductData } from '@dodobrands/pos-plugins-shared-models';
1
+ /**
2
+ * Enum with supported business types.
3
+ */
4
+ declare enum Business {
5
+ /**
6
+ * Dodo Pizza business.
7
+ */
8
+ DodoPizza = "dodoPizza",
9
+ /**
10
+ * Drinkit business.
11
+ */
12
+ Drinkit = "drinkit",
13
+ /**
14
+ * Doner42 business.
15
+ */
16
+ Doner42 = "doner42"
17
+ }
18
+
19
+ /**
20
+ * Card information.
21
+ */
22
+ type CardInfo = {
23
+ /**
24
+ * Masked card number, e.g. ************1234.
25
+ */
26
+ maskedPan: string;
27
+ /**
28
+ * Card expiration date in format MM/YY.
29
+ */
30
+ expDate: string | null;
31
+ };
32
+
33
+ /**
34
+ * Country model
35
+ */
36
+ interface Country {
37
+ code: CountryIsoCode;
38
+ }
39
+ /** Country code based on [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)
40
+ * @example 643, 705, 566
41
+ */
42
+ type CountryIsoCode = number;
43
+ declare enum KnownCountryCodes {
44
+ Belarus = 112,
45
+ Kazakhstan = 398,
46
+ Russia = 643,
47
+ Uzbekistan = 860,
48
+ Kyrgyzstan = 417
49
+ }
50
+
51
+ type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;
52
+ interface UzbekistanProductData {
53
+ /** Identification code of products and services for Uzbekistan */
54
+ ikpu: string;
55
+ /** 0 - resail; 1 - own production; 2 - service */
56
+ ownerType?: OwnerType;
57
+ /** code of measurement type */
58
+ units: string;
59
+ /** related with ikpu */
60
+ barcode: string;
61
+ }
62
+ declare enum OwnerType {
63
+ Resail = 0,
64
+ OwnProduction = 1,
65
+ Service = 2
66
+ }
67
+ interface KazakhstanProductData {
68
+ /** Identification code of products */
69
+ gtin?: string;
70
+ ntin?: string;
71
+ }
72
+ interface KyrgyzstanProductData {
73
+ /** `product` — if entry is resold, `service` — if entry is prepared in-house. */
74
+ entryType?: 'product' | 'service';
75
+ }
76
+ type MessageMetadata = {
77
+ area?: string;
78
+ };
79
+ type MessageMetadataWith<T> = MessageMetadata & T;
80
+ type ErrorMessageMetadataWith<T> = MessageMetadataWith<T> & {
81
+ error?: Error;
82
+ };
83
+ type CreateScopeOptions = {
84
+ /** If this feature is on: each time when the logger is created,
85
+ * all enabled plugins will launch the optional `registerLogger` call.
86
+ *
87
+ * This allows the plugins to respect the scope of child loggers and select
88
+ * which logger to use under-the-hood while being registered from the original logger.
89
+ *
90
+ * Defaults to `false` */
91
+ propagateUpdatedScopeToPlugins?: boolean;
92
+ };
93
+ interface ILogger<TScope extends Record<string, unknown> = never> {
94
+ createScope<TNewScope>(scope: TNewScope, options?: CreateScopeOptions): ILogger<TScope & TNewScope>;
95
+ diminishScope<TOldScope extends Record<string, unknown>>(scopeToDiminish: TOldScope, options?: CreateScopeOptions): ILogger<Omit<TScope, keyof TOldScope>>;
96
+ trace<T>(message: string, metadata?: MessageMetadataWith<T>): void;
97
+ debug<T>(message: string, metadata?: MessageMetadataWith<T>): void;
98
+ info<T>(message: string, metadata?: MessageMetadataWith<T>): void;
99
+ warn<T>(message: string, metadata?: MessageMetadataWith<T>): void;
100
+ error<T>(message: string, error?: unknown, metadata?: ErrorMessageMetadataWith<T>): void;
101
+ fatal<T>(message: string, error?: unknown, metadata?: ErrorMessageMetadataWith<T>): void;
102
+ }
103
+
104
+ /**
105
+ * Unique identifier of the transaction
106
+ */
107
+ type TransactionId = string;
108
+ type TransactionIdIdentifier = {
109
+ /**
110
+ * Unique identifier of the transaction
111
+ */
112
+ transactionId: TransactionId;
113
+ /**
114
+ * Retrieval Reference Number (RRN) of the transaction
115
+ */
116
+ rrn?: never;
117
+ };
118
+ /**
119
+ * Retrieval Reference Number (RRN) of the transaction
120
+ */
121
+ type RRN = string;
122
+ type RRNIdentifier = {
123
+ /**
124
+ * Unique identifier of the transaction
125
+ */
126
+ transactionId?: never;
127
+ /**
128
+ * Retrieval Reference Number (RRN) of the transaction
129
+ */
130
+ rrn: RRN;
131
+ };
132
+ type OperationIdentifiers = TransactionIdIdentifier | RRNIdentifier | {
133
+ /**
134
+ * Unique identifier of the transaction
135
+ */
136
+ transactionId: TransactionId;
137
+ /**
138
+ * Retrieval Reference Number (RRN) of the transaction
139
+ */
140
+ rrn: RRN;
141
+ };
142
+
143
+ type PaymentInfo = OperationIdentifiers;
144
+
145
+ type QRIdType = 'qrId';
146
+ type HTMLContentType = 'htmlContent';
147
+ type QRIdData = {
148
+ type: QRIdType;
149
+ /**
150
+ * URL or ID of the QR code.
151
+ */
152
+ qrId: string;
153
+ };
154
+ type HTMLContentData = {
155
+ type: HTMLContentType;
156
+ /**
157
+ * HTML content that can be used to display the QR code.
158
+ */
159
+ html: string;
160
+ };
161
+ /**
162
+ * QR code data.
163
+ */
164
+ type QRData = QRIdData | HTMLContentData;
165
+
166
+ type TextSlipType = 'text';
167
+ type TextSlipData = {
168
+ type: TextSlipType;
169
+ textLines: string[];
170
+ };
171
+ /**
172
+ * Represents the slip data for CARD payment request
173
+ * In the future it could be extended with other types like HtmlSlipData or PdfSlipData
174
+ */
175
+ type SlipData = TextSlipData;
176
+
177
+ type QrPaymentResult = {
178
+ /**
179
+ * Information about the payment.
180
+ */
181
+ paymentInfo: PaymentInfo;
182
+ /**
183
+ * QR code data
184
+ */
185
+ qrData: QRData;
186
+ };
187
+ /**
188
+ * Represents the payment result for CARD payment request
189
+ */
190
+ type CardPaymentResult = {
191
+ /**
192
+ * Information about the payment.
193
+ */
194
+ paymentInfo: PaymentInfo;
195
+ /**
196
+ * Data for slip
197
+ */
198
+ slip: SlipData | null;
199
+ /**
200
+ * Card information
201
+ */
202
+ card: CardInfo | null;
203
+ };
204
+
205
+ /**
206
+ * The result of a payment operation for an order.
207
+ * Discriminated union on the shape of the result — add new payment results here as needed.
208
+ */
209
+ type OrderPaymentResult = CardPaymentResult | QrPaymentResult;
210
+
211
+ type RefundInfo = OperationIdentifiers;
212
+ type BaseRefundResult = {
213
+ refundInfo: RefundInfo;
214
+ };
215
+ type CardRefundResult = BaseRefundResult & {
216
+ slip: SlipData | null;
217
+ };
218
+ type QrRefundResult = BaseRefundResult;
219
+
220
+ /**
221
+ * The result of a refund operation for an order.
222
+ * Discriminated union on the shape of the result — add new refund results here as needed.
223
+ */
224
+ type OrderRefundResult = CardRefundResult | QrRefundResult;
225
+
226
+ /** The name of the payment provider (e.g. "Ibox", "KaspiQr", "Json_Electron_PosPlugin"). */
227
+ type PaymentProvider = string;
228
+
229
+ declare enum PaymentSource {
230
+ RestaurantCashier = 0,
231
+ Kiosk = 1
232
+ }
233
+
234
+ declare enum PaymentStatus {
235
+ NotFound = "NotFound",
236
+ PaymentPending = "PaymentPending",
237
+ PaymentCompleted = "PaymentCompleted",
238
+ RefundPending = "RefundPending",
239
+ RefundCompleted = "RefundCompleted",
240
+ NotNeeded = "NotNeeded"
241
+ }
242
+
243
+ declare enum RefundSource {
244
+ RestaurantCashier = "RestaurantCashier",
245
+ RefundJob = "RefundJob",
246
+ Kiosk = "Kiosk"
247
+ }
248
+
249
+ interface Taxpayer {
250
+ /** A tax identification number. It is used for value added tax purposes.
251
+ * The formal name may differ from country to country: It could be NIP for Poland, INN for Russia, or VAT number.
252
+ * https://en.wikipedia.org/wiki/VAT_identification_number */
253
+ IdentificationNumber: string | null;
254
+ }
255
+
256
+ interface Receipt {
257
+ /** Order for this receipt */
258
+ Order: Order;
259
+ /** Country code based on ISO 3166-1 numeric */
260
+ CountryCode: number;
261
+ /** Customer information */
262
+ Customer: Customer;
263
+ /** Taxpayer information */
264
+ Taxpayer: Taxpayer;
265
+ /** Cash register from which the receipt is printed */
266
+ CashRegister: CashRegister;
267
+ /** Previous receipts that were printed for this order, including refunds */
268
+ PreviousReceipts: PreviousReceipt[];
269
+ /** Information about the organization that printed the receipt */
270
+ Organization: Organization;
271
+ /** Information about the store in which the purchase is occurring */
272
+ Store: Store;
273
+ /** Information needed for the loyalty program. */
274
+ Loyalty?: Loyalty;
275
+ /** Cash from the customer (if paid in cash) */
276
+ CashFromCustomer: number;
277
+ /** Information about the person taking the order. */
278
+ Cashier?: Cashier;
279
+ /** Url of the image to print on the receipt. */
280
+ Image?: Image;
281
+ }
282
+ interface Cashier {
283
+ /** Cashier name */
284
+ Name: string;
285
+ /** Cashier INN in russia and its analogues in other countries. */
286
+ TaxIdentificationNumber?: string;
287
+ }
288
+ interface Image {
289
+ /** Url of the image to print on the receipt. */
290
+ Url?: string;
291
+ /** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */
292
+ Base64Data?: string;
293
+ }
294
+ interface Loyalty {
295
+ /** Customer Phone number */
296
+ PhoneNumber: string;
297
+ /** Amount of the bonus points awarded for the loyalty program. */
298
+ AwardedBonus: number;
299
+ }
300
+ interface Order {
301
+ /** Internal order identifier */
302
+ Id: string;
303
+ /** Order number seen by customers (e.g. "1-3") */
304
+ Number: string;
305
+ /** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
306
+ CreateDate: string;
307
+ /** Products in cart */
308
+ Products: Product[];
309
+ Price: OrderPrice;
310
+ /** @deprecated Please switch to PaymentTypeEnum. */
311
+ PaymentType: 'Cash' | 'BankCard';
312
+ PaymentTypeEnum: PaymentType;
313
+ OrderSource: OrderSource;
314
+ /** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
315
+ DeliveryDate?: string;
316
+ OrderType: OrderType;
317
+ }
318
+ declare enum OrderType {
319
+ Delivery = 1,
320
+ Pickup = 2,
321
+ Stationary = 3,
322
+ PersonalFood = 4,
323
+ ShopWindowSupply = 5
324
+ }
325
+ /** Shows the source from where the order has been taken. */
326
+ declare enum OrderSource {
327
+ Telephone = 0,
328
+ Site = 1,
329
+ Restaurant = 2,
330
+ DefectOrder = 3,
331
+ Mobile = 4,
332
+ /** Shift manager order from call center. */
333
+ Pizzeria = 5,
334
+ Aggregator = 6,
335
+ Kiosk = 7
336
+ }
337
+ /** Shows how the order has been paid. Please expect frequent updates in the future. */
338
+ declare enum PaymentType {
339
+ Cash = 0,
340
+ BankCard = 1,
341
+ InternetAcquiring = 2,
342
+ Aggregator = 3
343
+ }
344
+ interface OrderPrice {
345
+ /** The total price of the order (how much the customer actually paid) */
346
+ TotalPrice: number;
347
+ /** Total price of the order excluding tax */
348
+ TotalPriceWithoutTax?: number;
349
+ /** Total discount for the entire order (excluding discounts for individual products in the order) */
350
+ Discount: number;
351
+ /** Total sales tax amount for the order */
352
+ SaleTax?: number;
353
+ /** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */
354
+ RoundedCashAmount?: number;
355
+ }
356
+ interface Product {
357
+ /** Internal product identifier */
358
+ Id: string;
359
+ /** The product's name */
360
+ Name: string;
361
+ /** The quantity of this product in the order */
362
+ Quantity: number;
363
+ PricePerProduct: ProductPrice;
364
+ /** List of ingredients removed from the product */
365
+ RemovedIngredients: string[];
366
+ /** Additional ingredients added to the product */
367
+ AddedIngredients: AddedIngredient[];
368
+ /** The marking data used in some countries to pass scanned barcode value to the cash register. */
369
+ Marking?: MarkingCodes;
370
+ /** The product excise information */
371
+ Excise?: {
372
+ isExcise: boolean;
373
+ };
374
+ /** Additional data that can be defined for specific country */
375
+ CountrySpecific?: {
376
+ Uzbekistan?: UzbekistanProductData;
377
+ Kazakhstan?: KazakhstanProductData;
378
+ Kyrgyzstan?: KyrgyzstanProductData;
379
+ };
380
+ }
381
+ interface ProductPrice {
382
+ /** Price for 1 product excluding discount but with added ingredients */
383
+ Price: number;
384
+ /** Discount for 1 product (excluding the discount for the entire order) */
385
+ Discount: number;
386
+ Taxes: Tax[];
387
+ }
388
+ interface Tax {
389
+ /** Type of tax: value added or sales */
390
+ Type: 'VAT' | 'Sales' | 'Unknown';
391
+ /** Rate in percents */
392
+ Rate: number;
393
+ }
394
+ interface AddedIngredient {
395
+ /** Ingredient name */
396
+ Name: string;
397
+ /** The amount of ingredients added in portions */
398
+ Quantity: number;
399
+ /** Ingredient price added to the product */
400
+ Price: number;
401
+ }
402
+ interface Customer {
403
+ /** The name of the customer that he gave to the cashier */
404
+ Name: string;
405
+ /** Customer's mailing address, which he set in his personal account */
406
+ Email: string | null;
407
+ /** Any additional identifiers, e.g. customer's Tax Identification Number */
408
+ Identifiers: {
409
+ [index: string]: string;
410
+ };
411
+ }
412
+ interface CashRegister {
413
+ /** Internal cash register identifier */
414
+ UUId: string;
415
+ /** */
416
+ Number: string;
417
+ /** To calculate or not to calculate VAT */
418
+ ShouldCalculateTax: boolean;
419
+ }
420
+ interface PreviousReceipt {
421
+ /** ID of the receipt returned by the POS printer. `null` if a print error has occurred. It is temporary field. Then it will be removed. Use `Identifier` instead of `Id` */
422
+ Id: number | null;
423
+ /** Printed receipt type: sales receipt or refund receipt */
424
+ Type: 'Sell' | 'Refund';
425
+ /** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */
426
+ PrintDateTime: string;
427
+ /** ID of the receipt returned by the POS printer */
428
+ Identifier: string | null;
429
+ CashboxId: string;
430
+ /** Data returned by cash register after printing receipt */
431
+ CashRegisterOutput?: string;
432
+ /** Previous receipt payment type */
433
+ PaymentType: PaymentType;
434
+ }
435
+ interface Organization {
436
+ /** Full name of the organization */
437
+ Name: string;
438
+ /** Legal address */
439
+ Address: string;
440
+ /** Organization payment details */
441
+ Requisites: {
442
+ [index: string]: string;
443
+ };
444
+ }
445
+ interface Store {
446
+ /** Actual address */
447
+ Address: string;
448
+ }
449
+ type RussiaMarkingCode = {
450
+ /** Russian country iso code */
451
+ country: 643;
452
+ /** In Russia it's the string of digits, letters, special symbols and group separator. */
453
+ markingCode: string;
454
+ };
455
+ type BelarusMarkingCodes = {
456
+ /** Belarus country iso code */
457
+ country: 112;
458
+ /** Маркировка унифицированными контрольными знаками (УКЗ) */
459
+ ukzCode?: string;
460
+ /** Маркировка средствами идентификации (СИ) */
461
+ siCode?: string;
462
+ /** Маркировка с использованием штрихкода GTIN */
463
+ gtinCode?: string;
464
+ };
465
+ type ArmeniaMarkingCode = {
466
+ /** Armenia country iso code */
467
+ country: 51;
468
+ /** In Armenia it's the string of digits letters, special symbols and group separator. */
469
+ markingCode: string;
470
+ };
471
+ type UzbekistanMarkingCode = {
472
+ /** Uzbekistan country iso code */
473
+ country: 860;
474
+ /** In Uzbekistan it's the string of digits letters, special symbols and group separator. */
475
+ markingCode: string;
476
+ };
477
+ type MarkingCodes = RussiaMarkingCode | BelarusMarkingCodes | ArmeniaMarkingCode | UzbekistanMarkingCode | undefined;
3
478
 
4
479
  type Money = {
5
480
  amount: number;
@@ -252,4 +727,4 @@ declare enum DigitalReceiptNotificationPreference {
252
727
  PhoneSms = "PhoneSms"
253
728
  }
254
729
 
255
- export { type CashRegisterSettings, type DepositCashOptions, DigitalReceiptNotificationPreference, type DigitalReceiptView, type DigitalReceiptViewType, type Fields, type HandleRefundRequest, type HandleRefundRequestClear, type HandleSaleRequest, type HandleSaleRequestClear, type ICashRegister, type IDigitalReceipt, type InitializationOptions, type JobRefundInfo, type KioskPaymentInfo, type KioskRefundInfo, type MakeZReportOptions, type Money, type PrintParams, type PrintTextOptions, type PrintedFiscalReceipt, type PrintedNonFiscalReceipt, type PrintedReceipt, type PrintedRefundReceipt, type ReceiptPaymentInfo, type ReceiptRefundInfo, type RestaurantCashierPaymentInfo, type RestaurantCashierRefundInfo, type WithdrawCashOptions };
730
+ export { type AddedIngredient, Business, type CashRegister, type CashRegisterSettings, type Cashier, type Country, type CountryIsoCode, type Customer, type DepositCashOptions, DigitalReceiptNotificationPreference, type DigitalReceiptView, type DigitalReceiptViewType, type Fields, type HandleRefundRequest, type HandleRefundRequestClear, type HandleSaleRequest, type HandleSaleRequestClear, type ICashRegister, type IDigitalReceipt, type Image, type InitializationOptions, type JobRefundInfo, type KazakhstanProductData, type KioskPaymentInfo, type KioskRefundInfo, KnownCountryCodes, type KyrgyzstanProductData, type Loyalty, type MakeZReportOptions, type MarkingCodes, type Money, type Order, type OrderPrice, OrderSource, OrderType, type Organization, OwnerType, PaymentType, type PreviousReceipt, type PrintParams, type PrintTextOptions, type PrintedFiscalReceipt, type PrintedNonFiscalReceipt, type PrintedReceipt, type PrintedRefundReceipt, type Product, type ProductPrice, type ProductSpecificData, type Receipt, type ReceiptPaymentInfo, type ReceiptRefundInfo, type RestaurantCashierPaymentInfo, type RestaurantCashierRefundInfo, type Store, type Tax, type Taxpayer, type UzbekistanProductData, type WithdrawCashOptions };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,480 @@
1
- import { Taxpayer, PaymentProvider, PaymentStatus, OrderRefundResult, RefundSource, Receipt, OrderPaymentResult, PaymentSource, Business, Country, ILogger } from '@dodobrands/pos-plugins-shared-models';
2
- export { AddedIngredient, Business, CashRegister, Cashier, Country, CountryIsoCode, Customer, Image, KazakhstanProductData, KnownCountryCodes, KyrgyzstanProductData, Loyalty, MarkingCodes, Order, OrderPrice, OrderSource, OrderType, Organization, OwnerType, PaymentType, PreviousReceipt, Product, ProductPrice, ProductSpecificData, Receipt, Store, Tax, Taxpayer, UzbekistanProductData } from '@dodobrands/pos-plugins-shared-models';
1
+ /**
2
+ * Enum with supported business types.
3
+ */
4
+ declare enum Business {
5
+ /**
6
+ * Dodo Pizza business.
7
+ */
8
+ DodoPizza = "dodoPizza",
9
+ /**
10
+ * Drinkit business.
11
+ */
12
+ Drinkit = "drinkit",
13
+ /**
14
+ * Doner42 business.
15
+ */
16
+ Doner42 = "doner42"
17
+ }
18
+
19
+ /**
20
+ * Card information.
21
+ */
22
+ type CardInfo = {
23
+ /**
24
+ * Masked card number, e.g. ************1234.
25
+ */
26
+ maskedPan: string;
27
+ /**
28
+ * Card expiration date in format MM/YY.
29
+ */
30
+ expDate: string | null;
31
+ };
32
+
33
+ /**
34
+ * Country model
35
+ */
36
+ interface Country {
37
+ code: CountryIsoCode;
38
+ }
39
+ /** Country code based on [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)
40
+ * @example 643, 705, 566
41
+ */
42
+ type CountryIsoCode = number;
43
+ declare enum KnownCountryCodes {
44
+ Belarus = 112,
45
+ Kazakhstan = 398,
46
+ Russia = 643,
47
+ Uzbekistan = 860,
48
+ Kyrgyzstan = 417
49
+ }
50
+
51
+ type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;
52
+ interface UzbekistanProductData {
53
+ /** Identification code of products and services for Uzbekistan */
54
+ ikpu: string;
55
+ /** 0 - resail; 1 - own production; 2 - service */
56
+ ownerType?: OwnerType;
57
+ /** code of measurement type */
58
+ units: string;
59
+ /** related with ikpu */
60
+ barcode: string;
61
+ }
62
+ declare enum OwnerType {
63
+ Resail = 0,
64
+ OwnProduction = 1,
65
+ Service = 2
66
+ }
67
+ interface KazakhstanProductData {
68
+ /** Identification code of products */
69
+ gtin?: string;
70
+ ntin?: string;
71
+ }
72
+ interface KyrgyzstanProductData {
73
+ /** `product` — if entry is resold, `service` — if entry is prepared in-house. */
74
+ entryType?: 'product' | 'service';
75
+ }
76
+ type MessageMetadata = {
77
+ area?: string;
78
+ };
79
+ type MessageMetadataWith<T> = MessageMetadata & T;
80
+ type ErrorMessageMetadataWith<T> = MessageMetadataWith<T> & {
81
+ error?: Error;
82
+ };
83
+ type CreateScopeOptions = {
84
+ /** If this feature is on: each time when the logger is created,
85
+ * all enabled plugins will launch the optional `registerLogger` call.
86
+ *
87
+ * This allows the plugins to respect the scope of child loggers and select
88
+ * which logger to use under-the-hood while being registered from the original logger.
89
+ *
90
+ * Defaults to `false` */
91
+ propagateUpdatedScopeToPlugins?: boolean;
92
+ };
93
+ interface ILogger<TScope extends Record<string, unknown> = never> {
94
+ createScope<TNewScope>(scope: TNewScope, options?: CreateScopeOptions): ILogger<TScope & TNewScope>;
95
+ diminishScope<TOldScope extends Record<string, unknown>>(scopeToDiminish: TOldScope, options?: CreateScopeOptions): ILogger<Omit<TScope, keyof TOldScope>>;
96
+ trace<T>(message: string, metadata?: MessageMetadataWith<T>): void;
97
+ debug<T>(message: string, metadata?: MessageMetadataWith<T>): void;
98
+ info<T>(message: string, metadata?: MessageMetadataWith<T>): void;
99
+ warn<T>(message: string, metadata?: MessageMetadataWith<T>): void;
100
+ error<T>(message: string, error?: unknown, metadata?: ErrorMessageMetadataWith<T>): void;
101
+ fatal<T>(message: string, error?: unknown, metadata?: ErrorMessageMetadataWith<T>): void;
102
+ }
103
+
104
+ /**
105
+ * Unique identifier of the transaction
106
+ */
107
+ type TransactionId = string;
108
+ type TransactionIdIdentifier = {
109
+ /**
110
+ * Unique identifier of the transaction
111
+ */
112
+ transactionId: TransactionId;
113
+ /**
114
+ * Retrieval Reference Number (RRN) of the transaction
115
+ */
116
+ rrn?: never;
117
+ };
118
+ /**
119
+ * Retrieval Reference Number (RRN) of the transaction
120
+ */
121
+ type RRN = string;
122
+ type RRNIdentifier = {
123
+ /**
124
+ * Unique identifier of the transaction
125
+ */
126
+ transactionId?: never;
127
+ /**
128
+ * Retrieval Reference Number (RRN) of the transaction
129
+ */
130
+ rrn: RRN;
131
+ };
132
+ type OperationIdentifiers = TransactionIdIdentifier | RRNIdentifier | {
133
+ /**
134
+ * Unique identifier of the transaction
135
+ */
136
+ transactionId: TransactionId;
137
+ /**
138
+ * Retrieval Reference Number (RRN) of the transaction
139
+ */
140
+ rrn: RRN;
141
+ };
142
+
143
+ type PaymentInfo = OperationIdentifiers;
144
+
145
+ type QRIdType = 'qrId';
146
+ type HTMLContentType = 'htmlContent';
147
+ type QRIdData = {
148
+ type: QRIdType;
149
+ /**
150
+ * URL or ID of the QR code.
151
+ */
152
+ qrId: string;
153
+ };
154
+ type HTMLContentData = {
155
+ type: HTMLContentType;
156
+ /**
157
+ * HTML content that can be used to display the QR code.
158
+ */
159
+ html: string;
160
+ };
161
+ /**
162
+ * QR code data.
163
+ */
164
+ type QRData = QRIdData | HTMLContentData;
165
+
166
+ type TextSlipType = 'text';
167
+ type TextSlipData = {
168
+ type: TextSlipType;
169
+ textLines: string[];
170
+ };
171
+ /**
172
+ * Represents the slip data for CARD payment request
173
+ * In the future it could be extended with other types like HtmlSlipData or PdfSlipData
174
+ */
175
+ type SlipData = TextSlipData;
176
+
177
+ type QrPaymentResult = {
178
+ /**
179
+ * Information about the payment.
180
+ */
181
+ paymentInfo: PaymentInfo;
182
+ /**
183
+ * QR code data
184
+ */
185
+ qrData: QRData;
186
+ };
187
+ /**
188
+ * Represents the payment result for CARD payment request
189
+ */
190
+ type CardPaymentResult = {
191
+ /**
192
+ * Information about the payment.
193
+ */
194
+ paymentInfo: PaymentInfo;
195
+ /**
196
+ * Data for slip
197
+ */
198
+ slip: SlipData | null;
199
+ /**
200
+ * Card information
201
+ */
202
+ card: CardInfo | null;
203
+ };
204
+
205
+ /**
206
+ * The result of a payment operation for an order.
207
+ * Discriminated union on the shape of the result — add new payment results here as needed.
208
+ */
209
+ type OrderPaymentResult = CardPaymentResult | QrPaymentResult;
210
+
211
+ type RefundInfo = OperationIdentifiers;
212
+ type BaseRefundResult = {
213
+ refundInfo: RefundInfo;
214
+ };
215
+ type CardRefundResult = BaseRefundResult & {
216
+ slip: SlipData | null;
217
+ };
218
+ type QrRefundResult = BaseRefundResult;
219
+
220
+ /**
221
+ * The result of a refund operation for an order.
222
+ * Discriminated union on the shape of the result — add new refund results here as needed.
223
+ */
224
+ type OrderRefundResult = CardRefundResult | QrRefundResult;
225
+
226
+ /** The name of the payment provider (e.g. "Ibox", "KaspiQr", "Json_Electron_PosPlugin"). */
227
+ type PaymentProvider = string;
228
+
229
+ declare enum PaymentSource {
230
+ RestaurantCashier = 0,
231
+ Kiosk = 1
232
+ }
233
+
234
+ declare enum PaymentStatus {
235
+ NotFound = "NotFound",
236
+ PaymentPending = "PaymentPending",
237
+ PaymentCompleted = "PaymentCompleted",
238
+ RefundPending = "RefundPending",
239
+ RefundCompleted = "RefundCompleted",
240
+ NotNeeded = "NotNeeded"
241
+ }
242
+
243
+ declare enum RefundSource {
244
+ RestaurantCashier = "RestaurantCashier",
245
+ RefundJob = "RefundJob",
246
+ Kiosk = "Kiosk"
247
+ }
248
+
249
+ interface Taxpayer {
250
+ /** A tax identification number. It is used for value added tax purposes.
251
+ * The formal name may differ from country to country: It could be NIP for Poland, INN for Russia, or VAT number.
252
+ * https://en.wikipedia.org/wiki/VAT_identification_number */
253
+ IdentificationNumber: string | null;
254
+ }
255
+
256
+ interface Receipt {
257
+ /** Order for this receipt */
258
+ Order: Order;
259
+ /** Country code based on ISO 3166-1 numeric */
260
+ CountryCode: number;
261
+ /** Customer information */
262
+ Customer: Customer;
263
+ /** Taxpayer information */
264
+ Taxpayer: Taxpayer;
265
+ /** Cash register from which the receipt is printed */
266
+ CashRegister: CashRegister;
267
+ /** Previous receipts that were printed for this order, including refunds */
268
+ PreviousReceipts: PreviousReceipt[];
269
+ /** Information about the organization that printed the receipt */
270
+ Organization: Organization;
271
+ /** Information about the store in which the purchase is occurring */
272
+ Store: Store;
273
+ /** Information needed for the loyalty program. */
274
+ Loyalty?: Loyalty;
275
+ /** Cash from the customer (if paid in cash) */
276
+ CashFromCustomer: number;
277
+ /** Information about the person taking the order. */
278
+ Cashier?: Cashier;
279
+ /** Url of the image to print on the receipt. */
280
+ Image?: Image;
281
+ }
282
+ interface Cashier {
283
+ /** Cashier name */
284
+ Name: string;
285
+ /** Cashier INN in russia and its analogues in other countries. */
286
+ TaxIdentificationNumber?: string;
287
+ }
288
+ interface Image {
289
+ /** Url of the image to print on the receipt. */
290
+ Url?: string;
291
+ /** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */
292
+ Base64Data?: string;
293
+ }
294
+ interface Loyalty {
295
+ /** Customer Phone number */
296
+ PhoneNumber: string;
297
+ /** Amount of the bonus points awarded for the loyalty program. */
298
+ AwardedBonus: number;
299
+ }
300
+ interface Order {
301
+ /** Internal order identifier */
302
+ Id: string;
303
+ /** Order number seen by customers (e.g. "1-3") */
304
+ Number: string;
305
+ /** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
306
+ CreateDate: string;
307
+ /** Products in cart */
308
+ Products: Product[];
309
+ Price: OrderPrice;
310
+ /** @deprecated Please switch to PaymentTypeEnum. */
311
+ PaymentType: 'Cash' | 'BankCard';
312
+ PaymentTypeEnum: PaymentType;
313
+ OrderSource: OrderSource;
314
+ /** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
315
+ DeliveryDate?: string;
316
+ OrderType: OrderType;
317
+ }
318
+ declare enum OrderType {
319
+ Delivery = 1,
320
+ Pickup = 2,
321
+ Stationary = 3,
322
+ PersonalFood = 4,
323
+ ShopWindowSupply = 5
324
+ }
325
+ /** Shows the source from where the order has been taken. */
326
+ declare enum OrderSource {
327
+ Telephone = 0,
328
+ Site = 1,
329
+ Restaurant = 2,
330
+ DefectOrder = 3,
331
+ Mobile = 4,
332
+ /** Shift manager order from call center. */
333
+ Pizzeria = 5,
334
+ Aggregator = 6,
335
+ Kiosk = 7
336
+ }
337
+ /** Shows how the order has been paid. Please expect frequent updates in the future. */
338
+ declare enum PaymentType {
339
+ Cash = 0,
340
+ BankCard = 1,
341
+ InternetAcquiring = 2,
342
+ Aggregator = 3
343
+ }
344
+ interface OrderPrice {
345
+ /** The total price of the order (how much the customer actually paid) */
346
+ TotalPrice: number;
347
+ /** Total price of the order excluding tax */
348
+ TotalPriceWithoutTax?: number;
349
+ /** Total discount for the entire order (excluding discounts for individual products in the order) */
350
+ Discount: number;
351
+ /** Total sales tax amount for the order */
352
+ SaleTax?: number;
353
+ /** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */
354
+ RoundedCashAmount?: number;
355
+ }
356
+ interface Product {
357
+ /** Internal product identifier */
358
+ Id: string;
359
+ /** The product's name */
360
+ Name: string;
361
+ /** The quantity of this product in the order */
362
+ Quantity: number;
363
+ PricePerProduct: ProductPrice;
364
+ /** List of ingredients removed from the product */
365
+ RemovedIngredients: string[];
366
+ /** Additional ingredients added to the product */
367
+ AddedIngredients: AddedIngredient[];
368
+ /** The marking data used in some countries to pass scanned barcode value to the cash register. */
369
+ Marking?: MarkingCodes;
370
+ /** The product excise information */
371
+ Excise?: {
372
+ isExcise: boolean;
373
+ };
374
+ /** Additional data that can be defined for specific country */
375
+ CountrySpecific?: {
376
+ Uzbekistan?: UzbekistanProductData;
377
+ Kazakhstan?: KazakhstanProductData;
378
+ Kyrgyzstan?: KyrgyzstanProductData;
379
+ };
380
+ }
381
+ interface ProductPrice {
382
+ /** Price for 1 product excluding discount but with added ingredients */
383
+ Price: number;
384
+ /** Discount for 1 product (excluding the discount for the entire order) */
385
+ Discount: number;
386
+ Taxes: Tax[];
387
+ }
388
+ interface Tax {
389
+ /** Type of tax: value added or sales */
390
+ Type: 'VAT' | 'Sales' | 'Unknown';
391
+ /** Rate in percents */
392
+ Rate: number;
393
+ }
394
+ interface AddedIngredient {
395
+ /** Ingredient name */
396
+ Name: string;
397
+ /** The amount of ingredients added in portions */
398
+ Quantity: number;
399
+ /** Ingredient price added to the product */
400
+ Price: number;
401
+ }
402
+ interface Customer {
403
+ /** The name of the customer that he gave to the cashier */
404
+ Name: string;
405
+ /** Customer's mailing address, which he set in his personal account */
406
+ Email: string | null;
407
+ /** Any additional identifiers, e.g. customer's Tax Identification Number */
408
+ Identifiers: {
409
+ [index: string]: string;
410
+ };
411
+ }
412
+ interface CashRegister {
413
+ /** Internal cash register identifier */
414
+ UUId: string;
415
+ /** */
416
+ Number: string;
417
+ /** To calculate or not to calculate VAT */
418
+ ShouldCalculateTax: boolean;
419
+ }
420
+ interface PreviousReceipt {
421
+ /** ID of the receipt returned by the POS printer. `null` if a print error has occurred. It is temporary field. Then it will be removed. Use `Identifier` instead of `Id` */
422
+ Id: number | null;
423
+ /** Printed receipt type: sales receipt or refund receipt */
424
+ Type: 'Sell' | 'Refund';
425
+ /** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */
426
+ PrintDateTime: string;
427
+ /** ID of the receipt returned by the POS printer */
428
+ Identifier: string | null;
429
+ CashboxId: string;
430
+ /** Data returned by cash register after printing receipt */
431
+ CashRegisterOutput?: string;
432
+ /** Previous receipt payment type */
433
+ PaymentType: PaymentType;
434
+ }
435
+ interface Organization {
436
+ /** Full name of the organization */
437
+ Name: string;
438
+ /** Legal address */
439
+ Address: string;
440
+ /** Organization payment details */
441
+ Requisites: {
442
+ [index: string]: string;
443
+ };
444
+ }
445
+ interface Store {
446
+ /** Actual address */
447
+ Address: string;
448
+ }
449
+ type RussiaMarkingCode = {
450
+ /** Russian country iso code */
451
+ country: 643;
452
+ /** In Russia it's the string of digits, letters, special symbols and group separator. */
453
+ markingCode: string;
454
+ };
455
+ type BelarusMarkingCodes = {
456
+ /** Belarus country iso code */
457
+ country: 112;
458
+ /** Маркировка унифицированными контрольными знаками (УКЗ) */
459
+ ukzCode?: string;
460
+ /** Маркировка средствами идентификации (СИ) */
461
+ siCode?: string;
462
+ /** Маркировка с использованием штрихкода GTIN */
463
+ gtinCode?: string;
464
+ };
465
+ type ArmeniaMarkingCode = {
466
+ /** Armenia country iso code */
467
+ country: 51;
468
+ /** In Armenia it's the string of digits letters, special symbols and group separator. */
469
+ markingCode: string;
470
+ };
471
+ type UzbekistanMarkingCode = {
472
+ /** Uzbekistan country iso code */
473
+ country: 860;
474
+ /** In Uzbekistan it's the string of digits letters, special symbols and group separator. */
475
+ markingCode: string;
476
+ };
477
+ type MarkingCodes = RussiaMarkingCode | BelarusMarkingCodes | ArmeniaMarkingCode | UzbekistanMarkingCode | undefined;
3
478
 
4
479
  type Money = {
5
480
  amount: number;
@@ -252,4 +727,4 @@ declare enum DigitalReceiptNotificationPreference {
252
727
  PhoneSms = "PhoneSms"
253
728
  }
254
729
 
255
- export { type CashRegisterSettings, type DepositCashOptions, DigitalReceiptNotificationPreference, type DigitalReceiptView, type DigitalReceiptViewType, type Fields, type HandleRefundRequest, type HandleRefundRequestClear, type HandleSaleRequest, type HandleSaleRequestClear, type ICashRegister, type IDigitalReceipt, type InitializationOptions, type JobRefundInfo, type KioskPaymentInfo, type KioskRefundInfo, type MakeZReportOptions, type Money, type PrintParams, type PrintTextOptions, type PrintedFiscalReceipt, type PrintedNonFiscalReceipt, type PrintedReceipt, type PrintedRefundReceipt, type ReceiptPaymentInfo, type ReceiptRefundInfo, type RestaurantCashierPaymentInfo, type RestaurantCashierRefundInfo, type WithdrawCashOptions };
730
+ export { type AddedIngredient, Business, type CashRegister, type CashRegisterSettings, type Cashier, type Country, type CountryIsoCode, type Customer, type DepositCashOptions, DigitalReceiptNotificationPreference, type DigitalReceiptView, type DigitalReceiptViewType, type Fields, type HandleRefundRequest, type HandleRefundRequestClear, type HandleSaleRequest, type HandleSaleRequestClear, type ICashRegister, type IDigitalReceipt, type Image, type InitializationOptions, type JobRefundInfo, type KazakhstanProductData, type KioskPaymentInfo, type KioskRefundInfo, KnownCountryCodes, type KyrgyzstanProductData, type Loyalty, type MakeZReportOptions, type MarkingCodes, type Money, type Order, type OrderPrice, OrderSource, OrderType, type Organization, OwnerType, PaymentType, type PreviousReceipt, type PrintParams, type PrintTextOptions, type PrintedFiscalReceipt, type PrintedNonFiscalReceipt, type PrintedReceipt, type PrintedRefundReceipt, type Product, type ProductPrice, type ProductSpecificData, type Receipt, type ReceiptPaymentInfo, type ReceiptRefundInfo, type RestaurantCashierPaymentInfo, type RestaurantCashierRefundInfo, type Store, type Tax, type Taxpayer, type UzbekistanProductData, type WithdrawCashOptions };
package/dist/index.js CHANGED
@@ -1,66 +1 @@
1
- // ../../shared/pos-plugins-shared-models/dist/index.js
2
- var Business = /* @__PURE__ */ ((Business2) => {
3
- Business2["DodoPizza"] = `dodoPizza`;
4
- Business2["Drinkit"] = `drinkit`;
5
- Business2["Doner42"] = `doner42`;
6
- return Business2;
7
- })(Business || {});
8
- var KnownCountryCodes = /* @__PURE__ */ ((KnownCountryCodes2) => {
9
- KnownCountryCodes2[KnownCountryCodes2["Belarus"] = 112] = "Belarus";
10
- KnownCountryCodes2[KnownCountryCodes2["Kazakhstan"] = 398] = "Kazakhstan";
11
- KnownCountryCodes2[KnownCountryCodes2["Russia"] = 643] = "Russia";
12
- KnownCountryCodes2[KnownCountryCodes2["Uzbekistan"] = 860] = "Uzbekistan";
13
- KnownCountryCodes2[KnownCountryCodes2["Kyrgyzstan"] = 417] = "Kyrgyzstan";
14
- return KnownCountryCodes2;
15
- })(KnownCountryCodes || {});
16
- var OwnerType = /* @__PURE__ */ ((OwnerType2) => {
17
- OwnerType2[OwnerType2["Resail"] = 0] = "Resail";
18
- OwnerType2[OwnerType2["OwnProduction"] = 1] = "OwnProduction";
19
- OwnerType2[OwnerType2["Service"] = 2] = "Service";
20
- return OwnerType2;
21
- })(OwnerType || {});
22
- var OrderType = /* @__PURE__ */ ((OrderType2) => {
23
- OrderType2[OrderType2["Delivery"] = 1] = "Delivery";
24
- OrderType2[OrderType2["Pickup"] = 2] = "Pickup";
25
- OrderType2[OrderType2["Stationary"] = 3] = "Stationary";
26
- OrderType2[OrderType2["PersonalFood"] = 4] = "PersonalFood";
27
- OrderType2[OrderType2["ShopWindowSupply"] = 5] = "ShopWindowSupply";
28
- return OrderType2;
29
- })(OrderType || {});
30
- var OrderSource = /* @__PURE__ */ ((OrderSource2) => {
31
- OrderSource2[OrderSource2["Telephone"] = 0] = "Telephone";
32
- OrderSource2[OrderSource2["Site"] = 1] = "Site";
33
- OrderSource2[OrderSource2["Restaurant"] = 2] = "Restaurant";
34
- OrderSource2[OrderSource2["DefectOrder"] = 3] = "DefectOrder";
35
- OrderSource2[OrderSource2["Mobile"] = 4] = "Mobile";
36
- OrderSource2[OrderSource2["Pizzeria"] = 5] = "Pizzeria";
37
- OrderSource2[OrderSource2["Aggregator"] = 6] = "Aggregator";
38
- OrderSource2[OrderSource2["Kiosk"] = 7] = "Kiosk";
39
- return OrderSource2;
40
- })(OrderSource || {});
41
- var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
42
- PaymentType2[PaymentType2["Cash"] = 0] = "Cash";
43
- PaymentType2[PaymentType2["BankCard"] = 1] = "BankCard";
44
- PaymentType2[PaymentType2["InternetAcquiring"] = 2] = "InternetAcquiring";
45
- PaymentType2[PaymentType2["Aggregator"] = 3] = "Aggregator";
46
- return PaymentType2;
47
- })(PaymentType || {});
48
-
49
- // src/PrintParams.ts
50
- var DigitalReceiptNotificationPreference = /* @__PURE__ */ ((DigitalReceiptNotificationPreference2) => {
51
- DigitalReceiptNotificationPreference2["NotSpecified"] = `NotSpecified`;
52
- DigitalReceiptNotificationPreference2["None"] = `None`;
53
- DigitalReceiptNotificationPreference2["Email"] = `Email`;
54
- DigitalReceiptNotificationPreference2["PhoneSms"] = `PhoneSms`;
55
- return DigitalReceiptNotificationPreference2;
56
- })(DigitalReceiptNotificationPreference || {});
57
- export {
58
- Business,
59
- DigitalReceiptNotificationPreference,
60
- KnownCountryCodes,
61
- OrderSource,
62
- OrderType,
63
- OwnerType,
64
- PaymentType
65
- };
66
- //# sourceMappingURL=index.js.map
1
+ var o=(t=>(t.DodoPizza="dodoPizza",t.Drinkit="drinkit",t.Doner42="doner42",t))(o||{}),a=(t=>(t[t.Belarus=112]="Belarus",t[t.Kazakhstan=398]="Kazakhstan",t[t.Russia=643]="Russia",t[t.Uzbekistan=860]="Uzbekistan",t[t.Kyrgyzstan=417]="Kyrgyzstan",t))(a||{}),e=(t=>(t[t.Resail=0]="Resail",t[t.OwnProduction=1]="OwnProduction",t[t.Service=2]="Service",t))(e||{});var i=(t=>(t[t.Delivery=1]="Delivery",t[t.Pickup=2]="Pickup",t[t.Stationary=3]="Stationary",t[t.PersonalFood=4]="PersonalFood",t[t.ShopWindowSupply=5]="ShopWindowSupply",t))(i||{}),p=(t=>(t[t.Telephone=0]="Telephone",t[t.Site=1]="Site",t[t.Restaurant=2]="Restaurant",t[t.DefectOrder=3]="DefectOrder",t[t.Mobile=4]="Mobile",t[t.Pizzeria=5]="Pizzeria",t[t.Aggregator=6]="Aggregator",t[t.Kiosk=7]="Kiosk",t))(p||{}),n=(t=>(t[t.Cash=0]="Cash",t[t.BankCard=1]="BankCard",t[t.InternetAcquiring=2]="InternetAcquiring",t[t.Aggregator=3]="Aggregator",t))(n||{});var s=(r=>(r.NotSpecified="NotSpecified",r.None="None",r.Email="Email",r.PhoneSms="PhoneSms",r))(s||{});export{o as Business,s as DigitalReceiptNotificationPreference,a as KnownCountryCodes,p as OrderSource,i as OrderType,e as OwnerType,n as PaymentType};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodobrands/pos-receipts-plugin-contracts",
3
- "version": "5.13.0",
3
+ "version": "5.13.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "scripts": {
34
- "build": "tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
34
+ "build": "tsup src/index.ts --format cjs,esm --dts --dts-resolve --clean --minify",
35
35
  "lint": "eslint \"{**/*,*}.{ts,tsx,js,jsx,json,mjs,cjs}\"",
36
36
  "lint:fix": "yarn lint --fix"
37
37
  },
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../../../shared/pos-plugins-shared-models/src/Business.ts","../../../shared/pos-plugins-shared-models/src/Country.ts","../../../shared/pos-plugins-shared-models/src/CountrySpecificData.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentMode.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentSource.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentStatus.ts","../../../shared/pos-plugins-shared-models/src/payment/RefundSource.ts","../../../shared/pos-plugins-shared-models/src/receipt/Receipt.ts","../src/PrintParams.ts"],"sourcesContent":["export { Business } from '@dodobrands/pos-plugins-shared-models';\nexport { Country, CountryIsoCode, KnownCountryCodes } from '@dodobrands/pos-plugins-shared-models';\n\nexport * from './cashCollection/DepositCashOptions';\nexport * from './cashCollection/Money';\nexport * from './cashCollection/WithdrawCashOptions';\nexport * from './CashRegisterSettings';\nexport * from './CountrySpecificData';\nexport * from './HandleRefundRequest';\nexport * from './HandleSaleRequest';\nexport * from './ICashRegister';\nexport * from './IDigitalReceipt';\nexport * from './InitializationOptions';\nexport * from './MakeZReportOptions';\nexport * from './PrintedReceipt';\nexport * from './PrintedRefundReceipt';\nexport * from './PrintParams';\nexport * from './PrintTextOptions';\nexport * from './Receipt';\nexport * from './ReceiptPaymentInfo';\nexport * from './ReceiptRefundInfo';\nexport * from './Taxpayer';\n","/**\n * Enum with supported business types.\n */\nexport enum Business {\n\t/**\n\t * Dodo Pizza business.\n\t */\n\tDodoPizza = `dodoPizza`,\n\t/**\n\t * Drinkit business.\n\t */\n\tDrinkit = `drinkit`,\n\t/**\n\t * Doner42 business.\n\t */\n\tDoner42 = `doner42`,\n}\n","/**\n * Country model\n */\nexport interface Country {\n\tcode: CountryIsoCode;\n}\n\n/** Country code based on [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)\n * @example 643, 705, 566\n */\nexport type CountryIsoCode = number;\n\nexport enum KnownCountryCodes {\n\tBelarus = 112,\n\tKazakhstan = 398,\n\tRussia = 643,\n\tUzbekistan = 860,\n\tKyrgyzstan = 417,\n}\n","export type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;\n\nexport interface UzbekistanProductData {\n\t/** Identification code of products and services for Uzbekistan */\n\tikpu: string;\n\t/** 0 - resail; 1 - own production; 2 - service */\n\townerType?: OwnerType;\n\t/** code of measurement type */\n\tunits: string;\n\t/** related with ikpu */\n\tbarcode: string;\n}\n\nexport enum OwnerType {\n\tResail = 0,\n\tOwnProduction = 1,\n\tService = 2,\n}\n\nexport interface KazakhstanProductData {\n\t/** Identification code of products */\n\tgtin?: string;\n\tntin?: string;\n}\n\nexport interface KyrgyzstanProductData {\n\t/** `product` — if entry is resold, `service` — if entry is prepared in-house. */\n\tentryType?: 'product' | 'service';\n}\n","export enum PaymentMode {\n\tCard = `Card`,\n\tQR = `QR`,\n}\n","export enum PaymentSource {\n\tRestaurantCashier = 0,\n\tKiosk = 1,\n}\n","export enum PaymentStatus {\n\tNotFound = `NotFound`,\n\tPaymentPending = `PaymentPending`,\n\tPaymentCompleted = `PaymentCompleted`,\n\tRefundPending = `RefundPending`,\n\tRefundCompleted = `RefundCompleted`,\n\tNotNeeded = `NotNeeded`,\n}\n","export enum RefundSource {\n\tRestaurantCashier = `RestaurantCashier`,\n\tRefundJob = `RefundJob`,\n\tKiosk = `Kiosk`,\n}\n","/* eslint-disable @typescript-eslint/no-magic-numbers */\nimport {\n\ttype KazakhstanProductData,\n\ttype KyrgyzstanProductData,\n\ttype UzbekistanProductData,\n} from '../CountrySpecificData';\nimport { type Taxpayer } from './Taxpayer';\n\nexport interface Receipt {\n\t/** Order for this receipt */\n\tOrder: Order;\n\t/** Customer information */\n\tCustomer: Customer;\n\t/** Taxpayer information */\n\tTaxpayer: Taxpayer;\n\t/** Cash register from which the receipt is printed */\n\tCashRegister: CashRegister;\n\t/** Previous receipts that were printed for this order, including refunds */\n\tPreviousReceipts: PreviousReceipt[];\n\t/** Information about the organization that printed the receipt */\n\tOrganization: Organization;\n\t/** Information about the store in which the purchase is occurring */\n\tStore: Store;\n\n\t/** Information needed for the loyalty program. */\n\tLoyalty?: Loyalty;\n\n\t/** Cash from the customer (if paid in cash) */\n\tCashFromCustomer: number;\n\n\t/** Information about the person taking the order. */\n\tCashier?: Cashier;\n\n\t/** Url of the image to print on the receipt. */\n\tImage?: Image;\n}\n\nexport interface Cashier {\n\t/** Cashier name */\n\tName: string;\n\n\t/** Cashier INN in russia and its analogues in other countries. */\n\tTaxIdentificationNumber?: string;\n}\n\nexport interface Image {\n\t/** Url of the image to print on the receipt. */\n\tUrl?: string;\n\n\t/** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */\n\tBase64Data?: string;\n}\n\nexport interface Loyalty {\n\t/** Customer Phone number */\n\tPhoneNumber: string;\n\t/** Amount of the bonus points awarded for the loyalty program. */\n\tAwardedBonus: number;\n}\n\nexport interface Order {\n\t/** Internal order identifier */\n\tId: string;\n\t/** Order number seen by customers (e.g. \"1-3\") */\n\tNumber: string; // from OrderNumber\n\t/** Current time in ISO 8601 format (e.g. \"2021-04-30T10:50:00.0000000+04:00\") */\n\tCreateDate: string;\n\t/** Products in cart */\n\tProducts: Product[];\n\tPrice: OrderPrice;\n\t/** @deprecated Please switch to PaymentTypeEnum. */\n\tPaymentType: 'Cash' | 'BankCard';\n\tPaymentTypeEnum: PaymentType;\n\tOrderSource: OrderSource;\n\n\t/** Current time in ISO 8601 format (e.g. \"2021-04-30T10:50:00.0000000+04:00\") */\n\tDeliveryDate?: string;\n\tOrderType: OrderType;\n}\n\nexport enum OrderType {\n\tDelivery = 1,\n\tPickup = 2,\n\tStationary = 3,\n\tPersonalFood = 4,\n\tShopWindowSupply = 5,\n}\n\n/** Shows the source from where the order has been taken. */\nexport enum OrderSource {\n\tTelephone = 0,\n\tSite = 1,\n\tRestaurant = 2,\n\tDefectOrder = 3,\n\tMobile = 4,\n\t/** Shift manager order from call center. */\n\tPizzeria = 5,\n\tAggregator = 6,\n\tKiosk = 7,\n}\n\n/** Shows how the order has been paid. Please expect frequent updates in the future. */\nexport enum PaymentType {\n\tCash = 0,\n\tBankCard = 1,\n\tInternetAcquiring = 2,\n\tAggregator = 3,\n}\n\nexport interface OrderPrice {\n\t/** The total price of the order (how much the customer actually paid) */\n\tTotalPrice: number;\n\t/** Total price of the order excluding tax */\n\tTotalPriceWithoutTax?: number;\n\t/** Total discount for the entire order (excluding discounts for individual products in the order) */\n\tDiscount: number;\n\t/** Total sales tax amount for the order */\n\tSaleTax?: number;\n\t/** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */\n\tRoundedCashAmount?: number;\n}\n\nexport interface Product {\n\t/** Internal product identifier */\n\tId: string;\n\t/** The product's name */\n\tName: string;\n\t/** The quantity of this product in the order */\n\tQuantity: number;\n\tPricePerProduct: ProductPrice;\n\t/** List of ingredients removed from the product */\n\tRemovedIngredients: string[];\n\t/** Additional ingredients added to the product */\n\tAddedIngredients: AddedIngredient[];\n\n\t/** The marking data used in some countries to pass scanned barcode value to the cash register. */\n\tMarking?: MarkingCodes;\n\n\t/** The product excise information */\n\tExcise?: {\n\t\tisExcise: boolean;\n\t};\n\n\t/** Additional data that can be defined for specific country */\n\tCountrySpecific?: {\n\t\tUzbekistan?: UzbekistanProductData;\n\t\tKazakhstan?: KazakhstanProductData;\n\t\tKyrgyzstan?: KyrgyzstanProductData;\n\t};\n}\n\nexport interface ProductPrice {\n\t/** Price for 1 product excluding discount but with added ingredients */\n\tPrice: number;\n\t/** Discount for 1 product (excluding the discount for the entire order) */\n\tDiscount: number;\n\tTaxes: Tax[];\n}\n\nexport interface Tax {\n\t/** Type of tax: value added or sales */\n\tType: 'VAT' | 'Sales' | 'Unknown';\n\t/** Rate in percents */\n\tRate: number;\n\t// TODO add later: Value: number\n}\n\nexport interface AddedIngredient {\n\t/** Ingredient name */\n\tName: string;\n\t/** The amount of ingredients added in portions */\n\tQuantity: number;\n\t/** Ingredient price added to the product */\n\tPrice: number;\n}\n\nexport interface Customer {\n\t/** The name of the customer that he gave to the cashier */\n\tName: string;\n\t/** Customer's mailing address, which he set in his personal account */\n\tEmail: string | null;\n\t/** Any additional identifiers, e.g. customer's Tax Identification Number */\n\tIdentifiers: { [index: string]: string };\n}\n\nexport interface CashRegister {\n\t/** Internal cash register identifier */\n\tUUId: string;\n\t/** */\n\tNumber: string;\n\t/** To calculate or not to calculate VAT */\n\tShouldCalculateTax: boolean;\n}\n\nexport interface PreviousReceipt {\n\t/** ID of the receipt returned by the POS printer. `null` if a print error has occurred. It is temporary field. Then it will be removed. Use `Identifier` instead of `Id` */\n\tId: number | null;\n\t/** Printed receipt type: sales receipt or refund receipt */\n\tType: 'Sell' | 'Refund';\n\t/** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */\n\tPrintDateTime: string;\n\t/** ID of the receipt returned by the POS printer */\n\tIdentifier: string | null;\n\n\tCashboxId: string;\n\n\t/** Data returned by cash register after printing receipt */\n\tCashRegisterOutput?: string;\n\t/** Previous receipt payment type */\n\tPaymentType: PaymentType;\n}\n\nexport interface Organization {\n\t/** Full name of the organization */\n\tName: string;\n\t/** Legal address */\n\tAddress: string;\n\t/** Organization payment details */\n\tRequisites: { [index: string]: string };\n}\n\nexport interface Store {\n\t/** Actual address */\n\tAddress: string;\n}\n\ntype RussiaMarkingCode = {\n\t/** Russian country iso code */\n\tcountry: 643;\n\t/** In Russia it's the string of digits, letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\ntype BelarusMarkingCodes = {\n\t/** Belarus country iso code */\n\tcountry: 112;\n\t/** Маркировка унифицированными контрольными знаками (УКЗ) */\n\tukzCode?: string;\n\t/** Маркировка средствами идентификации (СИ) */\n\tsiCode?: string;\n\t/** Маркировка с использованием штрихкода GTIN */\n\tgtinCode?: string;\n};\n\ntype ArmeniaMarkingCode = {\n\t/** Armenia country iso code */\n\tcountry: 51;\n\t/** In Armenia it's the string of digits letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\ntype UzbekistanMarkingCode = {\n\t/** Uzbekistan country iso code */\n\tcountry: 860;\n\t/** In Uzbekistan it's the string of digits letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\nexport type MarkingCodes =\n\t| RussiaMarkingCode\n\t| BelarusMarkingCodes\n\t| ArmeniaMarkingCode\n\t| UzbekistanMarkingCode\n\t| undefined;\n","export interface PrintParams {\n\t/** Has true value when receipt was sent to plugin in background for building Digital version of receipt */\n\tWithoutPaper: boolean;\n\tDigitalReceiptNotificationPreference: DigitalReceiptNotificationPreference;\n}\n\n/** The way we can notify the client about the receipt for the accepted order. */\nexport enum DigitalReceiptNotificationPreference {\n\t/** Client did not specify how they want to receive digital receipt. Default value. Should be set as `NotSpecified` when the receipt is expected to be NOT digital. */\n\tNotSpecified = `NotSpecified`,\n\t/** Client selected 'I don't want a receipt' */\n\tNone = `None`,\n\t/** Client selected 'I want the receipt on my email' */\n\tEmail = `Email`,\n\t/** Client selected 'I want the receipt link by phone via SMS' */\n\tPhoneSms = `PhoneSms`,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAK,WAAL,kBAAKA,cAAL;AAINA,YAAA,WAAA,IAAY;AAIZA,YAAA,SAAA,IAAU;AAIVA,YAAA,SAAA,IAAU;AAZC,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;ACSL,IAAK,oBAAL,kBAAKC,uBAAL;AACNA,qBAAAA,mBAAA,SAAA,IAAU,GAAA,IAAV;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AACAA,qBAAAA,mBAAA,QAAA,IAAS,GAAA,IAAT;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AALW,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;ACCL,IAAK,YAAL,kBAAKC,eAAL;AACNA,aAAAA,WAAA,QAAA,IAAS,CAAA,IAAT;AACAA,aAAAA,WAAA,eAAA,IAAgB,CAAA,IAAhB;AACAA,aAAAA,WAAA,SAAA,IAAU,CAAA,IAAV;AAHW,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AKmEL,IAAK,YAAL,kBAAKC,eAAL;AACNA,aAAAA,WAAA,UAAA,IAAW,CAAA,IAAX;AACAA,aAAAA,WAAA,QAAA,IAAS,CAAA,IAAT;AACAA,aAAAA,WAAA,YAAA,IAAa,CAAA,IAAb;AACAA,aAAAA,WAAA,cAAA,IAAe,CAAA,IAAf;AACAA,aAAAA,WAAA,kBAAA,IAAmB,CAAA,IAAnB;AALW,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AASL,IAAK,cAAL,kBAAKC,iBAAL;AACNA,eAAAA,aAAA,WAAA,IAAY,CAAA,IAAZ;AACAA,eAAAA,aAAA,MAAA,IAAO,CAAA,IAAP;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AACAA,eAAAA,aAAA,aAAA,IAAc,CAAA,IAAd;AACAA,eAAAA,aAAA,QAAA,IAAS,CAAA,IAAT;AAEAA,eAAAA,aAAA,UAAA,IAAW,CAAA,IAAX;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AACAA,eAAAA,aAAA,OAAA,IAAQ,CAAA,IAAR;AATW,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAaL,IAAK,cAAL,kBAAKC,iBAAL;AACNA,eAAAA,aAAA,MAAA,IAAO,CAAA,IAAP;AACAA,eAAAA,aAAA,UAAA,IAAW,CAAA,IAAX;AACAA,eAAAA,aAAA,mBAAA,IAAoB,CAAA,IAApB;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AAJW,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;;;AC/FL,IAAK,uCAAL,kBAAKC,0CAAL;AAEN,EAAAA,sCAAA,kBAAe;AAEf,EAAAA,sCAAA,UAAO;AAEP,EAAAA,sCAAA,WAAQ;AAER,EAAAA,sCAAA,cAAW;AARA,SAAAA;AAAA,GAAA;","names":["Business","KnownCountryCodes","OwnerType","OrderType","OrderSource","PaymentType","DigitalReceiptNotificationPreference"]}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../shared/pos-plugins-shared-models/src/Business.ts","../../../shared/pos-plugins-shared-models/src/Country.ts","../../../shared/pos-plugins-shared-models/src/CountrySpecificData.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentMode.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentSource.ts","../../../shared/pos-plugins-shared-models/src/payment/PaymentStatus.ts","../../../shared/pos-plugins-shared-models/src/payment/RefundSource.ts","../../../shared/pos-plugins-shared-models/src/receipt/Receipt.ts","../src/PrintParams.ts"],"sourcesContent":["/**\n * Enum with supported business types.\n */\nexport enum Business {\n\t/**\n\t * Dodo Pizza business.\n\t */\n\tDodoPizza = `dodoPizza`,\n\t/**\n\t * Drinkit business.\n\t */\n\tDrinkit = `drinkit`,\n\t/**\n\t * Doner42 business.\n\t */\n\tDoner42 = `doner42`,\n}\n","/**\n * Country model\n */\nexport interface Country {\n\tcode: CountryIsoCode;\n}\n\n/** Country code based on [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric)\n * @example 643, 705, 566\n */\nexport type CountryIsoCode = number;\n\nexport enum KnownCountryCodes {\n\tBelarus = 112,\n\tKazakhstan = 398,\n\tRussia = 643,\n\tUzbekistan = 860,\n\tKyrgyzstan = 417,\n}\n","export type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;\n\nexport interface UzbekistanProductData {\n\t/** Identification code of products and services for Uzbekistan */\n\tikpu: string;\n\t/** 0 - resail; 1 - own production; 2 - service */\n\townerType?: OwnerType;\n\t/** code of measurement type */\n\tunits: string;\n\t/** related with ikpu */\n\tbarcode: string;\n}\n\nexport enum OwnerType {\n\tResail = 0,\n\tOwnProduction = 1,\n\tService = 2,\n}\n\nexport interface KazakhstanProductData {\n\t/** Identification code of products */\n\tgtin?: string;\n\tntin?: string;\n}\n\nexport interface KyrgyzstanProductData {\n\t/** `product` — if entry is resold, `service` — if entry is prepared in-house. */\n\tentryType?: 'product' | 'service';\n}\n","export enum PaymentMode {\n\tCard = `Card`,\n\tQR = `QR`,\n}\n","export enum PaymentSource {\n\tRestaurantCashier = 0,\n\tKiosk = 1,\n}\n","export enum PaymentStatus {\n\tNotFound = `NotFound`,\n\tPaymentPending = `PaymentPending`,\n\tPaymentCompleted = `PaymentCompleted`,\n\tRefundPending = `RefundPending`,\n\tRefundCompleted = `RefundCompleted`,\n\tNotNeeded = `NotNeeded`,\n}\n","export enum RefundSource {\n\tRestaurantCashier = `RestaurantCashier`,\n\tRefundJob = `RefundJob`,\n\tKiosk = `Kiosk`,\n}\n","/* eslint-disable @typescript-eslint/no-magic-numbers */\nimport {\n\ttype KazakhstanProductData,\n\ttype KyrgyzstanProductData,\n\ttype UzbekistanProductData,\n} from '../CountrySpecificData';\nimport { type Taxpayer } from './Taxpayer';\n\nexport interface Receipt {\n\t/** Order for this receipt */\n\tOrder: Order;\n\t/** Customer information */\n\tCustomer: Customer;\n\t/** Taxpayer information */\n\tTaxpayer: Taxpayer;\n\t/** Cash register from which the receipt is printed */\n\tCashRegister: CashRegister;\n\t/** Previous receipts that were printed for this order, including refunds */\n\tPreviousReceipts: PreviousReceipt[];\n\t/** Information about the organization that printed the receipt */\n\tOrganization: Organization;\n\t/** Information about the store in which the purchase is occurring */\n\tStore: Store;\n\n\t/** Information needed for the loyalty program. */\n\tLoyalty?: Loyalty;\n\n\t/** Cash from the customer (if paid in cash) */\n\tCashFromCustomer: number;\n\n\t/** Information about the person taking the order. */\n\tCashier?: Cashier;\n\n\t/** Url of the image to print on the receipt. */\n\tImage?: Image;\n}\n\nexport interface Cashier {\n\t/** Cashier name */\n\tName: string;\n\n\t/** Cashier INN in russia and its analogues in other countries. */\n\tTaxIdentificationNumber?: string;\n}\n\nexport interface Image {\n\t/** Url of the image to print on the receipt. */\n\tUrl?: string;\n\n\t/** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */\n\tBase64Data?: string;\n}\n\nexport interface Loyalty {\n\t/** Customer Phone number */\n\tPhoneNumber: string;\n\t/** Amount of the bonus points awarded for the loyalty program. */\n\tAwardedBonus: number;\n}\n\nexport interface Order {\n\t/** Internal order identifier */\n\tId: string;\n\t/** Order number seen by customers (e.g. \"1-3\") */\n\tNumber: string; // from OrderNumber\n\t/** Current time in ISO 8601 format (e.g. \"2021-04-30T10:50:00.0000000+04:00\") */\n\tCreateDate: string;\n\t/** Products in cart */\n\tProducts: Product[];\n\tPrice: OrderPrice;\n\t/** @deprecated Please switch to PaymentTypeEnum. */\n\tPaymentType: 'Cash' | 'BankCard';\n\tPaymentTypeEnum: PaymentType;\n\tOrderSource: OrderSource;\n\n\t/** Current time in ISO 8601 format (e.g. \"2021-04-30T10:50:00.0000000+04:00\") */\n\tDeliveryDate?: string;\n\tOrderType: OrderType;\n}\n\nexport enum OrderType {\n\tDelivery = 1,\n\tPickup = 2,\n\tStationary = 3,\n\tPersonalFood = 4,\n\tShopWindowSupply = 5,\n}\n\n/** Shows the source from where the order has been taken. */\nexport enum OrderSource {\n\tTelephone = 0,\n\tSite = 1,\n\tRestaurant = 2,\n\tDefectOrder = 3,\n\tMobile = 4,\n\t/** Shift manager order from call center. */\n\tPizzeria = 5,\n\tAggregator = 6,\n\tKiosk = 7,\n}\n\n/** Shows how the order has been paid. Please expect frequent updates in the future. */\nexport enum PaymentType {\n\tCash = 0,\n\tBankCard = 1,\n\tInternetAcquiring = 2,\n\tAggregator = 3,\n}\n\nexport interface OrderPrice {\n\t/** The total price of the order (how much the customer actually paid) */\n\tTotalPrice: number;\n\t/** Total price of the order excluding tax */\n\tTotalPriceWithoutTax?: number;\n\t/** Total discount for the entire order (excluding discounts for individual products in the order) */\n\tDiscount: number;\n\t/** Total sales tax amount for the order */\n\tSaleTax?: number;\n\t/** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */\n\tRoundedCashAmount?: number;\n}\n\nexport interface Product {\n\t/** Internal product identifier */\n\tId: string;\n\t/** The product's name */\n\tName: string;\n\t/** The quantity of this product in the order */\n\tQuantity: number;\n\tPricePerProduct: ProductPrice;\n\t/** List of ingredients removed from the product */\n\tRemovedIngredients: string[];\n\t/** Additional ingredients added to the product */\n\tAddedIngredients: AddedIngredient[];\n\n\t/** The marking data used in some countries to pass scanned barcode value to the cash register. */\n\tMarking?: MarkingCodes;\n\n\t/** The product excise information */\n\tExcise?: {\n\t\tisExcise: boolean;\n\t};\n\n\t/** Additional data that can be defined for specific country */\n\tCountrySpecific?: {\n\t\tUzbekistan?: UzbekistanProductData;\n\t\tKazakhstan?: KazakhstanProductData;\n\t\tKyrgyzstan?: KyrgyzstanProductData;\n\t};\n}\n\nexport interface ProductPrice {\n\t/** Price for 1 product excluding discount but with added ingredients */\n\tPrice: number;\n\t/** Discount for 1 product (excluding the discount for the entire order) */\n\tDiscount: number;\n\tTaxes: Tax[];\n}\n\nexport interface Tax {\n\t/** Type of tax: value added or sales */\n\tType: 'VAT' | 'Sales' | 'Unknown';\n\t/** Rate in percents */\n\tRate: number;\n\t// TODO add later: Value: number\n}\n\nexport interface AddedIngredient {\n\t/** Ingredient name */\n\tName: string;\n\t/** The amount of ingredients added in portions */\n\tQuantity: number;\n\t/** Ingredient price added to the product */\n\tPrice: number;\n}\n\nexport interface Customer {\n\t/** The name of the customer that he gave to the cashier */\n\tName: string;\n\t/** Customer's mailing address, which he set in his personal account */\n\tEmail: string | null;\n\t/** Any additional identifiers, e.g. customer's Tax Identification Number */\n\tIdentifiers: { [index: string]: string };\n}\n\nexport interface CashRegister {\n\t/** Internal cash register identifier */\n\tUUId: string;\n\t/** */\n\tNumber: string;\n\t/** To calculate or not to calculate VAT */\n\tShouldCalculateTax: boolean;\n}\n\nexport interface PreviousReceipt {\n\t/** ID of the receipt returned by the POS printer. `null` if a print error has occurred. It is temporary field. Then it will be removed. Use `Identifier` instead of `Id` */\n\tId: number | null;\n\t/** Printed receipt type: sales receipt or refund receipt */\n\tType: 'Sell' | 'Refund';\n\t/** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */\n\tPrintDateTime: string;\n\t/** ID of the receipt returned by the POS printer */\n\tIdentifier: string | null;\n\n\tCashboxId: string;\n\n\t/** Data returned by cash register after printing receipt */\n\tCashRegisterOutput?: string;\n\t/** Previous receipt payment type */\n\tPaymentType: PaymentType;\n}\n\nexport interface Organization {\n\t/** Full name of the organization */\n\tName: string;\n\t/** Legal address */\n\tAddress: string;\n\t/** Organization payment details */\n\tRequisites: { [index: string]: string };\n}\n\nexport interface Store {\n\t/** Actual address */\n\tAddress: string;\n}\n\ntype RussiaMarkingCode = {\n\t/** Russian country iso code */\n\tcountry: 643;\n\t/** In Russia it's the string of digits, letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\ntype BelarusMarkingCodes = {\n\t/** Belarus country iso code */\n\tcountry: 112;\n\t/** Маркировка унифицированными контрольными знаками (УКЗ) */\n\tukzCode?: string;\n\t/** Маркировка средствами идентификации (СИ) */\n\tsiCode?: string;\n\t/** Маркировка с использованием штрихкода GTIN */\n\tgtinCode?: string;\n};\n\ntype ArmeniaMarkingCode = {\n\t/** Armenia country iso code */\n\tcountry: 51;\n\t/** In Armenia it's the string of digits letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\ntype UzbekistanMarkingCode = {\n\t/** Uzbekistan country iso code */\n\tcountry: 860;\n\t/** In Uzbekistan it's the string of digits letters, special symbols and group separator. */\n\tmarkingCode: string;\n};\n\nexport type MarkingCodes =\n\t| RussiaMarkingCode\n\t| BelarusMarkingCodes\n\t| ArmeniaMarkingCode\n\t| UzbekistanMarkingCode\n\t| undefined;\n","export interface PrintParams {\n\t/** Has true value when receipt was sent to plugin in background for building Digital version of receipt */\n\tWithoutPaper: boolean;\n\tDigitalReceiptNotificationPreference: DigitalReceiptNotificationPreference;\n}\n\n/** The way we can notify the client about the receipt for the accepted order. */\nexport enum DigitalReceiptNotificationPreference {\n\t/** Client did not specify how they want to receive digital receipt. Default value. Should be set as `NotSpecified` when the receipt is expected to be NOT digital. */\n\tNotSpecified = `NotSpecified`,\n\t/** Client selected 'I don't want a receipt' */\n\tNone = `None`,\n\t/** Client selected 'I want the receipt on my email' */\n\tEmail = `Email`,\n\t/** Client selected 'I want the receipt link by phone via SMS' */\n\tPhoneSms = `PhoneSms`,\n}\n"],"mappings":";AAGO,IAAK,WAAL,kBAAKA,cAAL;AAINA,YAAA,WAAA,IAAY;AAIZA,YAAA,SAAA,IAAU;AAIVA,YAAA,SAAA,IAAU;AAZC,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;ACSL,IAAK,oBAAL,kBAAKC,uBAAL;AACNA,qBAAAA,mBAAA,SAAA,IAAU,GAAA,IAAV;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AACAA,qBAAAA,mBAAA,QAAA,IAAS,GAAA,IAAT;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AACAA,qBAAAA,mBAAA,YAAA,IAAa,GAAA,IAAb;AALW,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;ACCL,IAAK,YAAL,kBAAKC,eAAL;AACNA,aAAAA,WAAA,QAAA,IAAS,CAAA,IAAT;AACAA,aAAAA,WAAA,eAAA,IAAgB,CAAA,IAAhB;AACAA,aAAAA,WAAA,SAAA,IAAU,CAAA,IAAV;AAHW,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AKmEL,IAAK,YAAL,kBAAKC,eAAL;AACNA,aAAAA,WAAA,UAAA,IAAW,CAAA,IAAX;AACAA,aAAAA,WAAA,QAAA,IAAS,CAAA,IAAT;AACAA,aAAAA,WAAA,YAAA,IAAa,CAAA,IAAb;AACAA,aAAAA,WAAA,cAAA,IAAe,CAAA,IAAf;AACAA,aAAAA,WAAA,kBAAA,IAAmB,CAAA,IAAnB;AALW,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AASL,IAAK,cAAL,kBAAKC,iBAAL;AACNA,eAAAA,aAAA,WAAA,IAAY,CAAA,IAAZ;AACAA,eAAAA,aAAA,MAAA,IAAO,CAAA,IAAP;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AACAA,eAAAA,aAAA,aAAA,IAAc,CAAA,IAAd;AACAA,eAAAA,aAAA,QAAA,IAAS,CAAA,IAAT;AAEAA,eAAAA,aAAA,UAAA,IAAW,CAAA,IAAX;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AACAA,eAAAA,aAAA,OAAA,IAAQ,CAAA,IAAR;AATW,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAaL,IAAK,cAAL,kBAAKC,iBAAL;AACNA,eAAAA,aAAA,MAAA,IAAO,CAAA,IAAP;AACAA,eAAAA,aAAA,UAAA,IAAW,CAAA,IAAX;AACAA,eAAAA,aAAA,mBAAA,IAAoB,CAAA,IAApB;AACAA,eAAAA,aAAA,YAAA,IAAa,CAAA,IAAb;AAJW,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;;;AC/FL,IAAK,uCAAL,kBAAKC,0CAAL;AAEN,EAAAA,sCAAA,kBAAe;AAEf,EAAAA,sCAAA,UAAO;AAEP,EAAAA,sCAAA,WAAQ;AAER,EAAAA,sCAAA,cAAW;AARA,SAAAA;AAAA,GAAA;","names":["Business","KnownCountryCodes","OwnerType","OrderType","OrderSource","PaymentType","DigitalReceiptNotificationPreference"]}