@dodobrands/pos-receipts-plugin-contracts 5.12.11 → 5.13.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/dist/index.cjs +9 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -256
- package/dist/index.d.ts +57 -256
- package/dist/index.js +9 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -45,25 +45,12 @@ var KnownCountryCodes = /* @__PURE__ */ ((KnownCountryCodes2) => {
|
|
|
45
45
|
KnownCountryCodes2[KnownCountryCodes2["Kyrgyzstan"] = 417] = "Kyrgyzstan";
|
|
46
46
|
return KnownCountryCodes2;
|
|
47
47
|
})(KnownCountryCodes || {});
|
|
48
|
-
|
|
49
|
-
// src/CountrySpecificData.ts
|
|
50
48
|
var OwnerType = /* @__PURE__ */ ((OwnerType2) => {
|
|
51
49
|
OwnerType2[OwnerType2["Resail"] = 0] = "Resail";
|
|
52
50
|
OwnerType2[OwnerType2["OwnProduction"] = 1] = "OwnProduction";
|
|
53
51
|
OwnerType2[OwnerType2["Service"] = 2] = "Service";
|
|
54
52
|
return OwnerType2;
|
|
55
53
|
})(OwnerType || {});
|
|
56
|
-
|
|
57
|
-
// src/PrintParams.ts
|
|
58
|
-
var DigitalReceiptNotificationPreference = /* @__PURE__ */ ((DigitalReceiptNotificationPreference2) => {
|
|
59
|
-
DigitalReceiptNotificationPreference2["NotSpecified"] = `NotSpecified`;
|
|
60
|
-
DigitalReceiptNotificationPreference2["None"] = `None`;
|
|
61
|
-
DigitalReceiptNotificationPreference2["Email"] = `Email`;
|
|
62
|
-
DigitalReceiptNotificationPreference2["PhoneSms"] = `PhoneSms`;
|
|
63
|
-
return DigitalReceiptNotificationPreference2;
|
|
64
|
-
})(DigitalReceiptNotificationPreference || {});
|
|
65
|
-
|
|
66
|
-
// src/Receipt.ts
|
|
67
54
|
var OrderType = /* @__PURE__ */ ((OrderType2) => {
|
|
68
55
|
OrderType2[OrderType2["Delivery"] = 1] = "Delivery";
|
|
69
56
|
OrderType2[OrderType2["Pickup"] = 2] = "Pickup";
|
|
@@ -90,6 +77,15 @@ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
|
|
|
90
77
|
PaymentType2[PaymentType2["Aggregator"] = 3] = "Aggregator";
|
|
91
78
|
return PaymentType2;
|
|
92
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 || {});
|
|
93
89
|
// Annotate the CommonJS export names for ESM import in node:
|
|
94
90
|
0 && (module.exports = {
|
|
95
91
|
Business,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../../../shared/pos-plugins-shared-models/src/Business.ts","../../../shared/pos-plugins-shared-models/src/Country.ts","../src/CountrySpecificData.ts","../src/PrintParams.ts","../src/Receipt.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 './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 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","/* 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"],"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;AACN,EAAAA,sBAAA,YAAS,KAAT;AACA,EAAAA,sBAAA,mBAAgB,KAAhB;AACA,EAAAA,sBAAA,aAAU,KAAV;AAHW,SAAAA;AAAA,GAAA;;;ACNL,IAAK,uCAAL,kBAAKC,0CAAL;AAEN,EAAAA,sCAAA,kBAAe;AAEf,EAAAA,sCAAA,UAAO;AAEP,EAAAA,sCAAA,WAAQ;AAER,EAAAA,sCAAA,cAAW;AARA,SAAAA;AAAA,GAAA;;;ACyEL,IAAK,YAAL,kBAAKC,eAAL;AACN,EAAAA,sBAAA,cAAW,KAAX;AACA,EAAAA,sBAAA,YAAS,KAAT;AACA,EAAAA,sBAAA,gBAAa,KAAb;AACA,EAAAA,sBAAA,kBAAe,KAAf;AACA,EAAAA,sBAAA,sBAAmB,KAAnB;AALW,SAAAA;AAAA,GAAA;AASL,IAAK,cAAL,kBAAKC,iBAAL;AACN,EAAAA,0BAAA,eAAY,KAAZ;AACA,EAAAA,0BAAA,UAAO,KAAP;AACA,EAAAA,0BAAA,gBAAa,KAAb;AACA,EAAAA,0BAAA,iBAAc,KAAd;AACA,EAAAA,0BAAA,YAAS,KAAT;AAEA,EAAAA,0BAAA,cAAW,KAAX;AACA,EAAAA,0BAAA,gBAAa,KAAb;AACA,EAAAA,0BAAA,WAAQ,KAAR;AATW,SAAAA;AAAA,GAAA;AAaL,IAAK,cAAL,kBAAKC,iBAAL;AACN,EAAAA,0BAAA,UAAO,KAAP;AACA,EAAAA,0BAAA,cAAW,KAAX;AACA,EAAAA,0BAAA,uBAAoB,KAApB;AACA,EAAAA,0BAAA,gBAAa,KAAb;AAJW,SAAAA;AAAA,GAAA;","names":["Business","KnownCountryCodes","OwnerType","DigitalReceiptNotificationPreference","OrderType","OrderSource","PaymentType"]}
|
|
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.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Business, Country, ILogger } from '@dodobrands/pos-plugins-shared-models';
|
|
2
|
-
export { Business, Country, CountryIsoCode, KnownCountryCodes } from '@dodobrands/pos-plugins-shared-models';
|
|
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';
|
|
3
3
|
|
|
4
4
|
type Money = {
|
|
5
5
|
amount: number;
|
|
@@ -17,13 +17,6 @@ interface WithdrawCashOptions {
|
|
|
17
17
|
cashierName?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
interface Taxpayer {
|
|
21
|
-
/** A tax identification number. It is used for value added tax purposes.
|
|
22
|
-
* The formal name may differ from country to country: It could be NIP for Poland, INN for Russia, or VAT number.
|
|
23
|
-
* https://en.wikipedia.org/wiki/VAT_identification_number */
|
|
24
|
-
IdentificationNumber: string | null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
20
|
/** The information about organization */
|
|
28
21
|
interface OrganizationInfo {
|
|
29
22
|
/** The name of organization */
|
|
@@ -45,31 +38,32 @@ interface CashRegisterSettings {
|
|
|
45
38
|
};
|
|
46
39
|
}
|
|
47
40
|
|
|
48
|
-
type
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
type BaseReceiptRefundInfo = {
|
|
42
|
+
/** The payment provider used for this transaction (e.g. "Ibox", "KaspiQr"). */
|
|
43
|
+
paymentProvider: PaymentProvider;
|
|
44
|
+
/** The final status of the payment at the time of printing. */
|
|
45
|
+
paymentStatus: PaymentStatus;
|
|
46
|
+
/**
|
|
47
|
+
* The result of the refund operation for this order.
|
|
48
|
+
* Shape varies by refund mode — add new modes to {@link OrderRefundResult} as needed.
|
|
49
|
+
*/
|
|
50
|
+
orderRefundResult?: OrderRefundResult;
|
|
51
|
+
};
|
|
52
|
+
type KioskRefundInfo = BaseReceiptRefundInfo & {
|
|
53
|
+
refundSource: RefundSource.Kiosk;
|
|
54
|
+
};
|
|
55
|
+
type RestaurantCashierRefundInfo = BaseReceiptRefundInfo & {
|
|
56
|
+
refundSource: RefundSource.RestaurantCashier;
|
|
57
|
+
};
|
|
58
|
+
type JobRefundInfo = BaseReceiptRefundInfo & {
|
|
59
|
+
refundSource: RefundSource.RefundJob;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Refund context passed to the receipt plugin when printing a refund receipt.
|
|
63
|
+
* Discriminated union on `refundSource` — add source-specific fields to the
|
|
64
|
+
* corresponding branch as needed.
|
|
65
|
+
*/
|
|
66
|
+
type ReceiptRefundInfo = KioskRefundInfo | RestaurantCashierRefundInfo | JobRefundInfo;
|
|
73
67
|
|
|
74
68
|
/**
|
|
75
69
|
* Obsolete Receipt interface backward compatibility.
|
|
@@ -79,8 +73,34 @@ type HandleRefundRequest = HandleRefundRequestClear | Receipt;
|
|
|
79
73
|
interface HandleRefundRequestClear {
|
|
80
74
|
receipt: Receipt;
|
|
81
75
|
printParams: PrintParams;
|
|
76
|
+
/** Optional refund context — provider, status and source at the time of printing. */
|
|
77
|
+
refundInfo?: ReceiptRefundInfo;
|
|
82
78
|
}
|
|
83
79
|
|
|
80
|
+
type BaseReceiptPaymentInfo = {
|
|
81
|
+
/** The payment provider used for this transaction (e.g. "Ibox", "KaspiQr"). */
|
|
82
|
+
paymentProvider: PaymentProvider;
|
|
83
|
+
/** The final status of the payment at the time of printing. */
|
|
84
|
+
paymentStatus: PaymentStatus;
|
|
85
|
+
/**
|
|
86
|
+
* The result of the payment operation for this order.
|
|
87
|
+
* Shape varies by payment mode — add new modes to {@link OrderPaymentResult} as needed.
|
|
88
|
+
*/
|
|
89
|
+
orderPaymentResult?: OrderPaymentResult;
|
|
90
|
+
};
|
|
91
|
+
type KioskPaymentInfo = BaseReceiptPaymentInfo & {
|
|
92
|
+
paymentSource: PaymentSource.Kiosk;
|
|
93
|
+
};
|
|
94
|
+
type RestaurantCashierPaymentInfo = BaseReceiptPaymentInfo & {
|
|
95
|
+
paymentSource: PaymentSource.RestaurantCashier;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Payment context passed to the receipt plugin when printing a receipt.
|
|
99
|
+
* Discriminated union on `paymentSource` — add source-specific fields to the
|
|
100
|
+
* corresponding branch as needed.
|
|
101
|
+
*/
|
|
102
|
+
type ReceiptPaymentInfo = KioskPaymentInfo | RestaurantCashierPaymentInfo;
|
|
103
|
+
|
|
84
104
|
/**
|
|
85
105
|
* Obsolete Receipt interface backward compatibility.
|
|
86
106
|
* Delete after moving all plugins to using new HandleRefundRequest and inner receipt property
|
|
@@ -89,6 +109,8 @@ type HandleSaleRequest = HandleSaleRequestClear | Receipt;
|
|
|
89
109
|
interface HandleSaleRequestClear {
|
|
90
110
|
receipt: Receipt;
|
|
91
111
|
printParams: PrintParams;
|
|
112
|
+
/** Optional payment context — provider, status and source at the time of printing. */
|
|
113
|
+
paymentInfo?: ReceiptPaymentInfo;
|
|
92
114
|
}
|
|
93
115
|
|
|
94
116
|
interface InitializationOptions {
|
|
@@ -230,225 +252,4 @@ declare enum DigitalReceiptNotificationPreference {
|
|
|
230
252
|
PhoneSms = "PhoneSms"
|
|
231
253
|
}
|
|
232
254
|
|
|
233
|
-
|
|
234
|
-
/** Order for this receipt */
|
|
235
|
-
Order: Order;
|
|
236
|
-
/** Customer information */
|
|
237
|
-
Customer: Customer;
|
|
238
|
-
/** Taxpayer information */
|
|
239
|
-
Taxpayer: Taxpayer;
|
|
240
|
-
/** Cash register from which the receipt is printed */
|
|
241
|
-
CashRegister: CashRegister;
|
|
242
|
-
/** Previous receipts that were printed for this order, including refunds */
|
|
243
|
-
PreviousReceipts: PreviousReceipt[];
|
|
244
|
-
/** Information about the organization that printed the receipt */
|
|
245
|
-
Organization: Organization;
|
|
246
|
-
/** Information about the store in which the purchase is occurring */
|
|
247
|
-
Store: Store;
|
|
248
|
-
/** Information needed for the loyalty program. */
|
|
249
|
-
Loyalty?: Loyalty;
|
|
250
|
-
/** Cash from the customer (if paid in cash) */
|
|
251
|
-
CashFromCustomer: number;
|
|
252
|
-
/** Information about the person taking the order. */
|
|
253
|
-
Cashier?: Cashier;
|
|
254
|
-
/** Url of the image to print on the receipt. */
|
|
255
|
-
Image?: Image;
|
|
256
|
-
}
|
|
257
|
-
interface Cashier {
|
|
258
|
-
/** Cashier name */
|
|
259
|
-
Name: string;
|
|
260
|
-
/** Cashier INN in russia and its analogues in other countries. */
|
|
261
|
-
TaxIdentificationNumber?: string;
|
|
262
|
-
}
|
|
263
|
-
interface Image {
|
|
264
|
-
/** Url of the image to print on the receipt. */
|
|
265
|
-
Url?: string;
|
|
266
|
-
/** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */
|
|
267
|
-
Base64Data?: string;
|
|
268
|
-
}
|
|
269
|
-
interface Loyalty {
|
|
270
|
-
/** Customer Phone number */
|
|
271
|
-
PhoneNumber: string;
|
|
272
|
-
/** Amount of the bonus points awarded for the loyalty program. */
|
|
273
|
-
AwardedBonus: number;
|
|
274
|
-
}
|
|
275
|
-
interface Order {
|
|
276
|
-
/** Internal order identifier */
|
|
277
|
-
Id: string;
|
|
278
|
-
/** Order number seen by customers (e.g. "1-3") */
|
|
279
|
-
Number: string;
|
|
280
|
-
/** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
|
|
281
|
-
CreateDate: string;
|
|
282
|
-
/** Products in cart */
|
|
283
|
-
Products: Product[];
|
|
284
|
-
Price: OrderPrice;
|
|
285
|
-
/** @deprecated Please switch to PaymentTypeEnum. */
|
|
286
|
-
PaymentType: 'Cash' | 'BankCard';
|
|
287
|
-
PaymentTypeEnum: PaymentType;
|
|
288
|
-
OrderSource: OrderSource;
|
|
289
|
-
/** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
|
|
290
|
-
DeliveryDate?: string;
|
|
291
|
-
OrderType: OrderType;
|
|
292
|
-
}
|
|
293
|
-
declare enum OrderType {
|
|
294
|
-
Delivery = 1,
|
|
295
|
-
Pickup = 2,
|
|
296
|
-
Stationary = 3,
|
|
297
|
-
PersonalFood = 4,
|
|
298
|
-
ShopWindowSupply = 5
|
|
299
|
-
}
|
|
300
|
-
/** Shows the source from where the order has been taken. */
|
|
301
|
-
declare enum OrderSource {
|
|
302
|
-
Telephone = 0,
|
|
303
|
-
Site = 1,
|
|
304
|
-
Restaurant = 2,
|
|
305
|
-
DefectOrder = 3,
|
|
306
|
-
Mobile = 4,
|
|
307
|
-
/** Shift manager order from call center. */
|
|
308
|
-
Pizzeria = 5,
|
|
309
|
-
Aggregator = 6,
|
|
310
|
-
Kiosk = 7
|
|
311
|
-
}
|
|
312
|
-
/** Shows how the order has been paid. Please expect frequent updates in the future. */
|
|
313
|
-
declare enum PaymentType {
|
|
314
|
-
Cash = 0,
|
|
315
|
-
BankCard = 1,
|
|
316
|
-
InternetAcquiring = 2,
|
|
317
|
-
Aggregator = 3
|
|
318
|
-
}
|
|
319
|
-
interface OrderPrice {
|
|
320
|
-
/** The total price of the order (how much the customer actually paid) */
|
|
321
|
-
TotalPrice: number;
|
|
322
|
-
/** Total price of the order excluding tax */
|
|
323
|
-
TotalPriceWithoutTax?: number;
|
|
324
|
-
/** Total discount for the entire order (excluding discounts for individual products in the order) */
|
|
325
|
-
Discount: number;
|
|
326
|
-
/** Total sales tax amount for the order */
|
|
327
|
-
SaleTax?: number;
|
|
328
|
-
/** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */
|
|
329
|
-
RoundedCashAmount?: number;
|
|
330
|
-
}
|
|
331
|
-
interface Product {
|
|
332
|
-
/** Internal product identifier */
|
|
333
|
-
Id: string;
|
|
334
|
-
/** The product's name */
|
|
335
|
-
Name: string;
|
|
336
|
-
/** The quantity of this product in the order */
|
|
337
|
-
Quantity: number;
|
|
338
|
-
PricePerProduct: ProductPrice;
|
|
339
|
-
/** List of ingredients removed from the product */
|
|
340
|
-
RemovedIngredients: string[];
|
|
341
|
-
/** Additional ingredients added to the product */
|
|
342
|
-
AddedIngredients: AddedIngredient[];
|
|
343
|
-
/** The marking data used in some countries to pass scanned barcode value to the cash register. */
|
|
344
|
-
Marking?: MarkingCodes;
|
|
345
|
-
/** The product excise information */
|
|
346
|
-
Excise?: {
|
|
347
|
-
isExcise: boolean;
|
|
348
|
-
};
|
|
349
|
-
/** Additional data that can be defined for specific country */
|
|
350
|
-
CountrySpecific?: {
|
|
351
|
-
Uzbekistan?: UzbekistanProductData;
|
|
352
|
-
Kazakhstan?: KazakhstanProductData;
|
|
353
|
-
Kyrgyzstan?: KyrgyzstanProductData;
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
interface ProductPrice {
|
|
357
|
-
/** Price for 1 product excluding discount but with added ingredients */
|
|
358
|
-
Price: number;
|
|
359
|
-
/** Discount for 1 product (excluding the discount for the entire order) */
|
|
360
|
-
Discount: number;
|
|
361
|
-
Taxes: Tax[];
|
|
362
|
-
}
|
|
363
|
-
interface Tax {
|
|
364
|
-
/** Type of tax: value added or sales */
|
|
365
|
-
Type: 'VAT' | 'Sales' | 'Unknown';
|
|
366
|
-
/** Rate in percents */
|
|
367
|
-
Rate: number;
|
|
368
|
-
}
|
|
369
|
-
interface AddedIngredient {
|
|
370
|
-
/** Ingredient name */
|
|
371
|
-
Name: string;
|
|
372
|
-
/** The amount of ingredients added in portions */
|
|
373
|
-
Quantity: number;
|
|
374
|
-
/** Ingredient price added to the product */
|
|
375
|
-
Price: number;
|
|
376
|
-
}
|
|
377
|
-
interface Customer {
|
|
378
|
-
/** The name of the customer that he gave to the cashier */
|
|
379
|
-
Name: string;
|
|
380
|
-
/** Customer's mailing address, which he set in his personal account */
|
|
381
|
-
Email: string | null;
|
|
382
|
-
/** Any additional identifiers, e.g. customer's Tax Identification Number */
|
|
383
|
-
Identifiers: {
|
|
384
|
-
[index: string]: string;
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
interface CashRegister {
|
|
388
|
-
/** Internal cash register identifier */
|
|
389
|
-
UUId: string;
|
|
390
|
-
/** */
|
|
391
|
-
Number: string;
|
|
392
|
-
/** To calculate or not to calculate VAT */
|
|
393
|
-
ShouldCalculateTax: boolean;
|
|
394
|
-
}
|
|
395
|
-
interface PreviousReceipt {
|
|
396
|
-
/** 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` */
|
|
397
|
-
Id: number | null;
|
|
398
|
-
/** Printed receipt type: sales receipt or refund receipt */
|
|
399
|
-
Type: 'Sell' | 'Refund';
|
|
400
|
-
/** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */
|
|
401
|
-
PrintDateTime: string;
|
|
402
|
-
/** ID of the receipt returned by the POS printer */
|
|
403
|
-
Identifier: string | null;
|
|
404
|
-
CashboxId: string;
|
|
405
|
-
/** Data returned by cash register after printing receipt */
|
|
406
|
-
CashRegisterOutput?: string;
|
|
407
|
-
/** Previous receipt payment type */
|
|
408
|
-
PaymentType: PaymentType;
|
|
409
|
-
}
|
|
410
|
-
interface Organization {
|
|
411
|
-
/** Full name of the organization */
|
|
412
|
-
Name: string;
|
|
413
|
-
/** Legal address */
|
|
414
|
-
Address: string;
|
|
415
|
-
/** Organization payment details */
|
|
416
|
-
Requisites: {
|
|
417
|
-
[index: string]: string;
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
interface Store {
|
|
421
|
-
/** Actual address */
|
|
422
|
-
Address: string;
|
|
423
|
-
}
|
|
424
|
-
type RussiaMarkingCode = {
|
|
425
|
-
/** Russian country iso code */
|
|
426
|
-
country: 643;
|
|
427
|
-
/** In Russia it's the string of digits, letters, special symbols and group separator. */
|
|
428
|
-
markingCode: string;
|
|
429
|
-
};
|
|
430
|
-
type BelarusMarkingCodes = {
|
|
431
|
-
/** Belarus country iso code */
|
|
432
|
-
country: 112;
|
|
433
|
-
/** Маркировка унифицированными контрольными знаками (УКЗ) */
|
|
434
|
-
ukzCode?: string;
|
|
435
|
-
/** Маркировка средствами идентификации (СИ) */
|
|
436
|
-
siCode?: string;
|
|
437
|
-
/** Маркировка с использованием штрихкода GTIN */
|
|
438
|
-
gtinCode?: string;
|
|
439
|
-
};
|
|
440
|
-
type ArmeniaMarkingCode = {
|
|
441
|
-
/** Armenia country iso code */
|
|
442
|
-
country: 51;
|
|
443
|
-
/** In Armenia it's the string of digits letters, special symbols and group separator. */
|
|
444
|
-
markingCode: string;
|
|
445
|
-
};
|
|
446
|
-
type UzbekistanMarkingCode = {
|
|
447
|
-
/** Uzbekistan country iso code */
|
|
448
|
-
country: 860;
|
|
449
|
-
/** In Uzbekistan it's the string of digits letters, special symbols and group separator. */
|
|
450
|
-
markingCode: string;
|
|
451
|
-
};
|
|
452
|
-
type MarkingCodes = RussiaMarkingCode | BelarusMarkingCodes | ArmeniaMarkingCode | UzbekistanMarkingCode | undefined;
|
|
453
|
-
|
|
454
|
-
export { type AddedIngredient, type CashRegister, type CashRegisterSettings, type Cashier, 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 KazakhstanProductData, 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 Store, type Tax, type Taxpayer, type UzbekistanProductData, type WithdrawCashOptions };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Business, Country, ILogger } from '@dodobrands/pos-plugins-shared-models';
|
|
2
|
-
export { Business, Country, CountryIsoCode, KnownCountryCodes } from '@dodobrands/pos-plugins-shared-models';
|
|
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';
|
|
3
3
|
|
|
4
4
|
type Money = {
|
|
5
5
|
amount: number;
|
|
@@ -17,13 +17,6 @@ interface WithdrawCashOptions {
|
|
|
17
17
|
cashierName?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
interface Taxpayer {
|
|
21
|
-
/** A tax identification number. It is used for value added tax purposes.
|
|
22
|
-
* The formal name may differ from country to country: It could be NIP for Poland, INN for Russia, or VAT number.
|
|
23
|
-
* https://en.wikipedia.org/wiki/VAT_identification_number */
|
|
24
|
-
IdentificationNumber: string | null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
20
|
/** The information about organization */
|
|
28
21
|
interface OrganizationInfo {
|
|
29
22
|
/** The name of organization */
|
|
@@ -45,31 +38,32 @@ interface CashRegisterSettings {
|
|
|
45
38
|
};
|
|
46
39
|
}
|
|
47
40
|
|
|
48
|
-
type
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
type BaseReceiptRefundInfo = {
|
|
42
|
+
/** The payment provider used for this transaction (e.g. "Ibox", "KaspiQr"). */
|
|
43
|
+
paymentProvider: PaymentProvider;
|
|
44
|
+
/** The final status of the payment at the time of printing. */
|
|
45
|
+
paymentStatus: PaymentStatus;
|
|
46
|
+
/**
|
|
47
|
+
* The result of the refund operation for this order.
|
|
48
|
+
* Shape varies by refund mode — add new modes to {@link OrderRefundResult} as needed.
|
|
49
|
+
*/
|
|
50
|
+
orderRefundResult?: OrderRefundResult;
|
|
51
|
+
};
|
|
52
|
+
type KioskRefundInfo = BaseReceiptRefundInfo & {
|
|
53
|
+
refundSource: RefundSource.Kiosk;
|
|
54
|
+
};
|
|
55
|
+
type RestaurantCashierRefundInfo = BaseReceiptRefundInfo & {
|
|
56
|
+
refundSource: RefundSource.RestaurantCashier;
|
|
57
|
+
};
|
|
58
|
+
type JobRefundInfo = BaseReceiptRefundInfo & {
|
|
59
|
+
refundSource: RefundSource.RefundJob;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Refund context passed to the receipt plugin when printing a refund receipt.
|
|
63
|
+
* Discriminated union on `refundSource` — add source-specific fields to the
|
|
64
|
+
* corresponding branch as needed.
|
|
65
|
+
*/
|
|
66
|
+
type ReceiptRefundInfo = KioskRefundInfo | RestaurantCashierRefundInfo | JobRefundInfo;
|
|
73
67
|
|
|
74
68
|
/**
|
|
75
69
|
* Obsolete Receipt interface backward compatibility.
|
|
@@ -79,8 +73,34 @@ type HandleRefundRequest = HandleRefundRequestClear | Receipt;
|
|
|
79
73
|
interface HandleRefundRequestClear {
|
|
80
74
|
receipt: Receipt;
|
|
81
75
|
printParams: PrintParams;
|
|
76
|
+
/** Optional refund context — provider, status and source at the time of printing. */
|
|
77
|
+
refundInfo?: ReceiptRefundInfo;
|
|
82
78
|
}
|
|
83
79
|
|
|
80
|
+
type BaseReceiptPaymentInfo = {
|
|
81
|
+
/** The payment provider used for this transaction (e.g. "Ibox", "KaspiQr"). */
|
|
82
|
+
paymentProvider: PaymentProvider;
|
|
83
|
+
/** The final status of the payment at the time of printing. */
|
|
84
|
+
paymentStatus: PaymentStatus;
|
|
85
|
+
/**
|
|
86
|
+
* The result of the payment operation for this order.
|
|
87
|
+
* Shape varies by payment mode — add new modes to {@link OrderPaymentResult} as needed.
|
|
88
|
+
*/
|
|
89
|
+
orderPaymentResult?: OrderPaymentResult;
|
|
90
|
+
};
|
|
91
|
+
type KioskPaymentInfo = BaseReceiptPaymentInfo & {
|
|
92
|
+
paymentSource: PaymentSource.Kiosk;
|
|
93
|
+
};
|
|
94
|
+
type RestaurantCashierPaymentInfo = BaseReceiptPaymentInfo & {
|
|
95
|
+
paymentSource: PaymentSource.RestaurantCashier;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Payment context passed to the receipt plugin when printing a receipt.
|
|
99
|
+
* Discriminated union on `paymentSource` — add source-specific fields to the
|
|
100
|
+
* corresponding branch as needed.
|
|
101
|
+
*/
|
|
102
|
+
type ReceiptPaymentInfo = KioskPaymentInfo | RestaurantCashierPaymentInfo;
|
|
103
|
+
|
|
84
104
|
/**
|
|
85
105
|
* Obsolete Receipt interface backward compatibility.
|
|
86
106
|
* Delete after moving all plugins to using new HandleRefundRequest and inner receipt property
|
|
@@ -89,6 +109,8 @@ type HandleSaleRequest = HandleSaleRequestClear | Receipt;
|
|
|
89
109
|
interface HandleSaleRequestClear {
|
|
90
110
|
receipt: Receipt;
|
|
91
111
|
printParams: PrintParams;
|
|
112
|
+
/** Optional payment context — provider, status and source at the time of printing. */
|
|
113
|
+
paymentInfo?: ReceiptPaymentInfo;
|
|
92
114
|
}
|
|
93
115
|
|
|
94
116
|
interface InitializationOptions {
|
|
@@ -230,225 +252,4 @@ declare enum DigitalReceiptNotificationPreference {
|
|
|
230
252
|
PhoneSms = "PhoneSms"
|
|
231
253
|
}
|
|
232
254
|
|
|
233
|
-
|
|
234
|
-
/** Order for this receipt */
|
|
235
|
-
Order: Order;
|
|
236
|
-
/** Customer information */
|
|
237
|
-
Customer: Customer;
|
|
238
|
-
/** Taxpayer information */
|
|
239
|
-
Taxpayer: Taxpayer;
|
|
240
|
-
/** Cash register from which the receipt is printed */
|
|
241
|
-
CashRegister: CashRegister;
|
|
242
|
-
/** Previous receipts that were printed for this order, including refunds */
|
|
243
|
-
PreviousReceipts: PreviousReceipt[];
|
|
244
|
-
/** Information about the organization that printed the receipt */
|
|
245
|
-
Organization: Organization;
|
|
246
|
-
/** Information about the store in which the purchase is occurring */
|
|
247
|
-
Store: Store;
|
|
248
|
-
/** Information needed for the loyalty program. */
|
|
249
|
-
Loyalty?: Loyalty;
|
|
250
|
-
/** Cash from the customer (if paid in cash) */
|
|
251
|
-
CashFromCustomer: number;
|
|
252
|
-
/** Information about the person taking the order. */
|
|
253
|
-
Cashier?: Cashier;
|
|
254
|
-
/** Url of the image to print on the receipt. */
|
|
255
|
-
Image?: Image;
|
|
256
|
-
}
|
|
257
|
-
interface Cashier {
|
|
258
|
-
/** Cashier name */
|
|
259
|
-
Name: string;
|
|
260
|
-
/** Cashier INN in russia and its analogues in other countries. */
|
|
261
|
-
TaxIdentificationNumber?: string;
|
|
262
|
-
}
|
|
263
|
-
interface Image {
|
|
264
|
-
/** Url of the image to print on the receipt. */
|
|
265
|
-
Url?: string;
|
|
266
|
-
/** Image data in base64 format. (ONLY FOR RUSSIA ATOL) */
|
|
267
|
-
Base64Data?: string;
|
|
268
|
-
}
|
|
269
|
-
interface Loyalty {
|
|
270
|
-
/** Customer Phone number */
|
|
271
|
-
PhoneNumber: string;
|
|
272
|
-
/** Amount of the bonus points awarded for the loyalty program. */
|
|
273
|
-
AwardedBonus: number;
|
|
274
|
-
}
|
|
275
|
-
interface Order {
|
|
276
|
-
/** Internal order identifier */
|
|
277
|
-
Id: string;
|
|
278
|
-
/** Order number seen by customers (e.g. "1-3") */
|
|
279
|
-
Number: string;
|
|
280
|
-
/** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
|
|
281
|
-
CreateDate: string;
|
|
282
|
-
/** Products in cart */
|
|
283
|
-
Products: Product[];
|
|
284
|
-
Price: OrderPrice;
|
|
285
|
-
/** @deprecated Please switch to PaymentTypeEnum. */
|
|
286
|
-
PaymentType: 'Cash' | 'BankCard';
|
|
287
|
-
PaymentTypeEnum: PaymentType;
|
|
288
|
-
OrderSource: OrderSource;
|
|
289
|
-
/** Current time in ISO 8601 format (e.g. "2021-04-30T10:50:00.0000000+04:00") */
|
|
290
|
-
DeliveryDate?: string;
|
|
291
|
-
OrderType: OrderType;
|
|
292
|
-
}
|
|
293
|
-
declare enum OrderType {
|
|
294
|
-
Delivery = 1,
|
|
295
|
-
Pickup = 2,
|
|
296
|
-
Stationary = 3,
|
|
297
|
-
PersonalFood = 4,
|
|
298
|
-
ShopWindowSupply = 5
|
|
299
|
-
}
|
|
300
|
-
/** Shows the source from where the order has been taken. */
|
|
301
|
-
declare enum OrderSource {
|
|
302
|
-
Telephone = 0,
|
|
303
|
-
Site = 1,
|
|
304
|
-
Restaurant = 2,
|
|
305
|
-
DefectOrder = 3,
|
|
306
|
-
Mobile = 4,
|
|
307
|
-
/** Shift manager order from call center. */
|
|
308
|
-
Pizzeria = 5,
|
|
309
|
-
Aggregator = 6,
|
|
310
|
-
Kiosk = 7
|
|
311
|
-
}
|
|
312
|
-
/** Shows how the order has been paid. Please expect frequent updates in the future. */
|
|
313
|
-
declare enum PaymentType {
|
|
314
|
-
Cash = 0,
|
|
315
|
-
BankCard = 1,
|
|
316
|
-
InternetAcquiring = 2,
|
|
317
|
-
Aggregator = 3
|
|
318
|
-
}
|
|
319
|
-
interface OrderPrice {
|
|
320
|
-
/** The total price of the order (how much the customer actually paid) */
|
|
321
|
-
TotalPrice: number;
|
|
322
|
-
/** Total price of the order excluding tax */
|
|
323
|
-
TotalPriceWithoutTax?: number;
|
|
324
|
-
/** Total discount for the entire order (excluding discounts for individual products in the order) */
|
|
325
|
-
Discount: number;
|
|
326
|
-
/** Total sales tax amount for the order */
|
|
327
|
-
SaleTax?: number;
|
|
328
|
-
/** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */
|
|
329
|
-
RoundedCashAmount?: number;
|
|
330
|
-
}
|
|
331
|
-
interface Product {
|
|
332
|
-
/** Internal product identifier */
|
|
333
|
-
Id: string;
|
|
334
|
-
/** The product's name */
|
|
335
|
-
Name: string;
|
|
336
|
-
/** The quantity of this product in the order */
|
|
337
|
-
Quantity: number;
|
|
338
|
-
PricePerProduct: ProductPrice;
|
|
339
|
-
/** List of ingredients removed from the product */
|
|
340
|
-
RemovedIngredients: string[];
|
|
341
|
-
/** Additional ingredients added to the product */
|
|
342
|
-
AddedIngredients: AddedIngredient[];
|
|
343
|
-
/** The marking data used in some countries to pass scanned barcode value to the cash register. */
|
|
344
|
-
Marking?: MarkingCodes;
|
|
345
|
-
/** The product excise information */
|
|
346
|
-
Excise?: {
|
|
347
|
-
isExcise: boolean;
|
|
348
|
-
};
|
|
349
|
-
/** Additional data that can be defined for specific country */
|
|
350
|
-
CountrySpecific?: {
|
|
351
|
-
Uzbekistan?: UzbekistanProductData;
|
|
352
|
-
Kazakhstan?: KazakhstanProductData;
|
|
353
|
-
Kyrgyzstan?: KyrgyzstanProductData;
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
interface ProductPrice {
|
|
357
|
-
/** Price for 1 product excluding discount but with added ingredients */
|
|
358
|
-
Price: number;
|
|
359
|
-
/** Discount for 1 product (excluding the discount for the entire order) */
|
|
360
|
-
Discount: number;
|
|
361
|
-
Taxes: Tax[];
|
|
362
|
-
}
|
|
363
|
-
interface Tax {
|
|
364
|
-
/** Type of tax: value added or sales */
|
|
365
|
-
Type: 'VAT' | 'Sales' | 'Unknown';
|
|
366
|
-
/** Rate in percents */
|
|
367
|
-
Rate: number;
|
|
368
|
-
}
|
|
369
|
-
interface AddedIngredient {
|
|
370
|
-
/** Ingredient name */
|
|
371
|
-
Name: string;
|
|
372
|
-
/** The amount of ingredients added in portions */
|
|
373
|
-
Quantity: number;
|
|
374
|
-
/** Ingredient price added to the product */
|
|
375
|
-
Price: number;
|
|
376
|
-
}
|
|
377
|
-
interface Customer {
|
|
378
|
-
/** The name of the customer that he gave to the cashier */
|
|
379
|
-
Name: string;
|
|
380
|
-
/** Customer's mailing address, which he set in his personal account */
|
|
381
|
-
Email: string | null;
|
|
382
|
-
/** Any additional identifiers, e.g. customer's Tax Identification Number */
|
|
383
|
-
Identifiers: {
|
|
384
|
-
[index: string]: string;
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
interface CashRegister {
|
|
388
|
-
/** Internal cash register identifier */
|
|
389
|
-
UUId: string;
|
|
390
|
-
/** */
|
|
391
|
-
Number: string;
|
|
392
|
-
/** To calculate or not to calculate VAT */
|
|
393
|
-
ShouldCalculateTax: boolean;
|
|
394
|
-
}
|
|
395
|
-
interface PreviousReceipt {
|
|
396
|
-
/** 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` */
|
|
397
|
-
Id: number | null;
|
|
398
|
-
/** Printed receipt type: sales receipt or refund receipt */
|
|
399
|
-
Type: 'Sell' | 'Refund';
|
|
400
|
-
/** Date in format ISO 8601 (e.g. 2021-04-30T10:50:00.0000000+04:00) */
|
|
401
|
-
PrintDateTime: string;
|
|
402
|
-
/** ID of the receipt returned by the POS printer */
|
|
403
|
-
Identifier: string | null;
|
|
404
|
-
CashboxId: string;
|
|
405
|
-
/** Data returned by cash register after printing receipt */
|
|
406
|
-
CashRegisterOutput?: string;
|
|
407
|
-
/** Previous receipt payment type */
|
|
408
|
-
PaymentType: PaymentType;
|
|
409
|
-
}
|
|
410
|
-
interface Organization {
|
|
411
|
-
/** Full name of the organization */
|
|
412
|
-
Name: string;
|
|
413
|
-
/** Legal address */
|
|
414
|
-
Address: string;
|
|
415
|
-
/** Organization payment details */
|
|
416
|
-
Requisites: {
|
|
417
|
-
[index: string]: string;
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
interface Store {
|
|
421
|
-
/** Actual address */
|
|
422
|
-
Address: string;
|
|
423
|
-
}
|
|
424
|
-
type RussiaMarkingCode = {
|
|
425
|
-
/** Russian country iso code */
|
|
426
|
-
country: 643;
|
|
427
|
-
/** In Russia it's the string of digits, letters, special symbols and group separator. */
|
|
428
|
-
markingCode: string;
|
|
429
|
-
};
|
|
430
|
-
type BelarusMarkingCodes = {
|
|
431
|
-
/** Belarus country iso code */
|
|
432
|
-
country: 112;
|
|
433
|
-
/** Маркировка унифицированными контрольными знаками (УКЗ) */
|
|
434
|
-
ukzCode?: string;
|
|
435
|
-
/** Маркировка средствами идентификации (СИ) */
|
|
436
|
-
siCode?: string;
|
|
437
|
-
/** Маркировка с использованием штрихкода GTIN */
|
|
438
|
-
gtinCode?: string;
|
|
439
|
-
};
|
|
440
|
-
type ArmeniaMarkingCode = {
|
|
441
|
-
/** Armenia country iso code */
|
|
442
|
-
country: 51;
|
|
443
|
-
/** In Armenia it's the string of digits letters, special symbols and group separator. */
|
|
444
|
-
markingCode: string;
|
|
445
|
-
};
|
|
446
|
-
type UzbekistanMarkingCode = {
|
|
447
|
-
/** Uzbekistan country iso code */
|
|
448
|
-
country: 860;
|
|
449
|
-
/** In Uzbekistan it's the string of digits letters, special symbols and group separator. */
|
|
450
|
-
markingCode: string;
|
|
451
|
-
};
|
|
452
|
-
type MarkingCodes = RussiaMarkingCode | BelarusMarkingCodes | ArmeniaMarkingCode | UzbekistanMarkingCode | undefined;
|
|
453
|
-
|
|
454
|
-
export { type AddedIngredient, type CashRegister, type CashRegisterSettings, type Cashier, 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 KazakhstanProductData, 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 Store, type Tax, type Taxpayer, type UzbekistanProductData, type WithdrawCashOptions };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -13,25 +13,12 @@ var KnownCountryCodes = /* @__PURE__ */ ((KnownCountryCodes2) => {
|
|
|
13
13
|
KnownCountryCodes2[KnownCountryCodes2["Kyrgyzstan"] = 417] = "Kyrgyzstan";
|
|
14
14
|
return KnownCountryCodes2;
|
|
15
15
|
})(KnownCountryCodes || {});
|
|
16
|
-
|
|
17
|
-
// src/CountrySpecificData.ts
|
|
18
16
|
var OwnerType = /* @__PURE__ */ ((OwnerType2) => {
|
|
19
17
|
OwnerType2[OwnerType2["Resail"] = 0] = "Resail";
|
|
20
18
|
OwnerType2[OwnerType2["OwnProduction"] = 1] = "OwnProduction";
|
|
21
19
|
OwnerType2[OwnerType2["Service"] = 2] = "Service";
|
|
22
20
|
return OwnerType2;
|
|
23
21
|
})(OwnerType || {});
|
|
24
|
-
|
|
25
|
-
// src/PrintParams.ts
|
|
26
|
-
var DigitalReceiptNotificationPreference = /* @__PURE__ */ ((DigitalReceiptNotificationPreference2) => {
|
|
27
|
-
DigitalReceiptNotificationPreference2["NotSpecified"] = `NotSpecified`;
|
|
28
|
-
DigitalReceiptNotificationPreference2["None"] = `None`;
|
|
29
|
-
DigitalReceiptNotificationPreference2["Email"] = `Email`;
|
|
30
|
-
DigitalReceiptNotificationPreference2["PhoneSms"] = `PhoneSms`;
|
|
31
|
-
return DigitalReceiptNotificationPreference2;
|
|
32
|
-
})(DigitalReceiptNotificationPreference || {});
|
|
33
|
-
|
|
34
|
-
// src/Receipt.ts
|
|
35
22
|
var OrderType = /* @__PURE__ */ ((OrderType2) => {
|
|
36
23
|
OrderType2[OrderType2["Delivery"] = 1] = "Delivery";
|
|
37
24
|
OrderType2[OrderType2["Pickup"] = 2] = "Pickup";
|
|
@@ -58,6 +45,15 @@ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
|
|
|
58
45
|
PaymentType2[PaymentType2["Aggregator"] = 3] = "Aggregator";
|
|
59
46
|
return PaymentType2;
|
|
60
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 || {});
|
|
61
57
|
export {
|
|
62
58
|
Business,
|
|
63
59
|
DigitalReceiptNotificationPreference,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../shared/pos-plugins-shared-models/src/Business.ts","../../../shared/pos-plugins-shared-models/src/Country.ts","../src/CountrySpecificData.ts","../src/PrintParams.ts","../src/Receipt.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 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","/* 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"],"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;AACN,EAAAA,sBAAA,YAAS,KAAT;AACA,EAAAA,sBAAA,mBAAgB,KAAhB;AACA,EAAAA,sBAAA,aAAU,KAAV;AAHW,SAAAA;AAAA,GAAA;;;ACNL,IAAK,uCAAL,kBAAKC,0CAAL;AAEN,EAAAA,sCAAA,kBAAe;AAEf,EAAAA,sCAAA,UAAO;AAEP,EAAAA,sCAAA,WAAQ;AAER,EAAAA,sCAAA,cAAW;AARA,SAAAA;AAAA,GAAA;;;ACyEL,IAAK,YAAL,kBAAKC,eAAL;AACN,EAAAA,sBAAA,cAAW,KAAX;AACA,EAAAA,sBAAA,YAAS,KAAT;AACA,EAAAA,sBAAA,gBAAa,KAAb;AACA,EAAAA,sBAAA,kBAAe,KAAf;AACA,EAAAA,sBAAA,sBAAmB,KAAnB;AALW,SAAAA;AAAA,GAAA;AASL,IAAK,cAAL,kBAAKC,iBAAL;AACN,EAAAA,0BAAA,eAAY,KAAZ;AACA,EAAAA,0BAAA,UAAO,KAAP;AACA,EAAAA,0BAAA,gBAAa,KAAb;AACA,EAAAA,0BAAA,iBAAc,KAAd;AACA,EAAAA,0BAAA,YAAS,KAAT;AAEA,EAAAA,0BAAA,cAAW,KAAX;AACA,EAAAA,0BAAA,gBAAa,KAAb;AACA,EAAAA,0BAAA,WAAQ,KAAR;AATW,SAAAA;AAAA,GAAA;AAaL,IAAK,cAAL,kBAAKC,iBAAL;AACN,EAAAA,0BAAA,UAAO,KAAP;AACA,EAAAA,0BAAA,cAAW,KAAX;AACA,EAAAA,0BAAA,uBAAoB,KAApB;AACA,EAAAA,0BAAA,gBAAa,KAAb;AAJW,SAAAA;AAAA,GAAA;","names":["Business","KnownCountryCodes","OwnerType","DigitalReceiptNotificationPreference","OrderType","OrderSource","PaymentType"]}
|
|
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"]}
|