@dodobrands/pos-receipts-plugin-contracts 5.12.9 → 5.12.11

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
@@ -22,6 +22,7 @@ var src_exports = {};
22
22
  __export(src_exports, {
23
23
  Business: () => Business,
24
24
  DigitalReceiptNotificationPreference: () => DigitalReceiptNotificationPreference,
25
+ KnownCountryCodes: () => KnownCountryCodes,
25
26
  OrderSource: () => OrderSource,
26
27
  OrderType: () => OrderType,
27
28
  OwnerType: () => OwnerType,
@@ -36,6 +37,14 @@ var Business = /* @__PURE__ */ ((Business2) => {
36
37
  Business2["Doner42"] = `doner42`;
37
38
  return Business2;
38
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 || {});
39
48
 
40
49
  // src/CountrySpecificData.ts
41
50
  var OwnerType = /* @__PURE__ */ ((OwnerType2) => {
@@ -85,6 +94,7 @@ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
85
94
  0 && (module.exports = {
86
95
  Business,
87
96
  DigitalReceiptNotificationPreference,
97
+ KnownCountryCodes,
88
98
  OrderSource,
89
99
  OrderType,
90
100
  OwnerType,
@@ -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 } 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}\n","export type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | 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","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 { type KazakhstanProductData, type UzbekistanProductData } 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 discount for the entire order (excluding discounts for individual products in the order) */\n\tDiscount: 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};\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;;;ACGO,IAAK,WAAL,kBAAKA,cAAL;AAINA,YAAA,WAAA,IAAY;AAIZA,YAAA,SAAA,IAAU;AAIVA,YAAA,SAAA,IAAU;AAZC,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;;;AEUL,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;;;ACqEL,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","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","../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"]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Business, Country, ILogger } from '@dodobrands/pos-plugins-shared-models';
2
- export { Business, Country, CountryIsoCode } from '@dodobrands/pos-plugins-shared-models';
2
+ export { Business, Country, CountryIsoCode, KnownCountryCodes } from '@dodobrands/pos-plugins-shared-models';
3
3
 
4
4
  type Money = {
5
5
  amount: number;
@@ -45,7 +45,7 @@ interface CashRegisterSettings {
45
45
  };
46
46
  }
47
47
 
48
- type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | null;
48
+ type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;
49
49
  interface UzbekistanProductData {
50
50
  /** Identification code of products and services for Uzbekistan */
51
51
  ikpu: string;
@@ -66,6 +66,10 @@ interface KazakhstanProductData {
66
66
  gtin?: string;
67
67
  ntin?: string;
68
68
  }
69
+ interface KyrgyzstanProductData {
70
+ /** `product` — if entry is resold, `service` — if entry is prepared in-house. */
71
+ entryType?: 'product' | 'service';
72
+ }
69
73
 
70
74
  /**
71
75
  * Obsolete Receipt interface backward compatibility.
@@ -315,8 +319,12 @@ declare enum PaymentType {
315
319
  interface OrderPrice {
316
320
  /** The total price of the order (how much the customer actually paid) */
317
321
  TotalPrice: number;
322
+ /** Total price of the order excluding tax */
323
+ TotalPriceWithoutTax?: number;
318
324
  /** Total discount for the entire order (excluding discounts for individual products in the order) */
319
325
  Discount: number;
326
+ /** Total sales tax amount for the order */
327
+ SaleTax?: number;
320
328
  /** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */
321
329
  RoundedCashAmount?: number;
322
330
  }
@@ -342,6 +350,7 @@ interface Product {
342
350
  CountrySpecific?: {
343
351
  Uzbekistan?: UzbekistanProductData;
344
352
  Kazakhstan?: KazakhstanProductData;
353
+ Kyrgyzstan?: KyrgyzstanProductData;
345
354
  };
346
355
  }
347
356
  interface ProductPrice {
@@ -442,4 +451,4 @@ type UzbekistanMarkingCode = {
442
451
  };
443
452
  type MarkingCodes = RussiaMarkingCode | BelarusMarkingCodes | ArmeniaMarkingCode | UzbekistanMarkingCode | undefined;
444
453
 
445
- 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 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Business, Country, ILogger } from '@dodobrands/pos-plugins-shared-models';
2
- export { Business, Country, CountryIsoCode } from '@dodobrands/pos-plugins-shared-models';
2
+ export { Business, Country, CountryIsoCode, KnownCountryCodes } from '@dodobrands/pos-plugins-shared-models';
3
3
 
4
4
  type Money = {
5
5
  amount: number;
@@ -45,7 +45,7 @@ interface CashRegisterSettings {
45
45
  };
46
46
  }
47
47
 
48
- type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | null;
48
+ type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | KyrgyzstanProductData | null;
49
49
  interface UzbekistanProductData {
50
50
  /** Identification code of products and services for Uzbekistan */
51
51
  ikpu: string;
@@ -66,6 +66,10 @@ interface KazakhstanProductData {
66
66
  gtin?: string;
67
67
  ntin?: string;
68
68
  }
69
+ interface KyrgyzstanProductData {
70
+ /** `product` — if entry is resold, `service` — if entry is prepared in-house. */
71
+ entryType?: 'product' | 'service';
72
+ }
69
73
 
70
74
  /**
71
75
  * Obsolete Receipt interface backward compatibility.
@@ -315,8 +319,12 @@ declare enum PaymentType {
315
319
  interface OrderPrice {
316
320
  /** The total price of the order (how much the customer actually paid) */
317
321
  TotalPrice: number;
322
+ /** Total price of the order excluding tax */
323
+ TotalPriceWithoutTax?: number;
318
324
  /** Total discount for the entire order (excluding discounts for individual products in the order) */
319
325
  Discount: number;
326
+ /** Total sales tax amount for the order */
327
+ SaleTax?: number;
320
328
  /** Rounded cash amount the customer pays for an order (if paid in cash). Used only in countries with special rules for rounding cash */
321
329
  RoundedCashAmount?: number;
322
330
  }
@@ -342,6 +350,7 @@ interface Product {
342
350
  CountrySpecific?: {
343
351
  Uzbekistan?: UzbekistanProductData;
344
352
  Kazakhstan?: KazakhstanProductData;
353
+ Kyrgyzstan?: KyrgyzstanProductData;
345
354
  };
346
355
  }
347
356
  interface ProductPrice {
@@ -442,4 +451,4 @@ type UzbekistanMarkingCode = {
442
451
  };
443
452
  type MarkingCodes = RussiaMarkingCode | BelarusMarkingCodes | ArmeniaMarkingCode | UzbekistanMarkingCode | undefined;
444
453
 
445
- 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 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 };
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 };
package/dist/index.js CHANGED
@@ -5,6 +5,14 @@ var Business = /* @__PURE__ */ ((Business2) => {
5
5
  Business2["Doner42"] = `doner42`;
6
6
  return Business2;
7
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 || {});
8
16
 
9
17
  // src/CountrySpecificData.ts
10
18
  var OwnerType = /* @__PURE__ */ ((OwnerType2) => {
@@ -53,6 +61,7 @@ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
53
61
  export {
54
62
  Business,
55
63
  DigitalReceiptNotificationPreference,
64
+ KnownCountryCodes,
56
65
  OrderSource,
57
66
  OrderType,
58
67
  OwnerType,
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}\n","export type ProductSpecificData = UzbekistanProductData | KazakhstanProductData | 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","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 { type KazakhstanProductData, type UzbekistanProductData } 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 discount for the entire order (excluding discounts for individual products in the order) */\n\tDiscount: 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};\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;;;AEUL,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;;;ACqEL,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","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","../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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dodobrands/pos-receipts-plugin-contracts",
3
- "version": "5.12.9",
3
+ "version": "5.12.11",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,6 +10,7 @@
10
10
  "main": "./dist/index.cjs",
11
11
  "module": "./dist/index.js",
12
12
  "types": "./dist/index.d.ts",
13
+ "author": "POS",
13
14
  "exports": {
14
15
  "import": {
15
16
  "types": "./dist/index.d.ts",