@managesome/eposmatic-toolkit 0.2.490 β 0.2.492
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/lib/constants/COMMON.js
CHANGED
|
@@ -192,6 +192,16 @@ exports.PROVIDER_OPERATIONAL_COUNTRIES = {
|
|
|
192
192
|
currency_name: ENUMS_1.CURRENCY_NAME_ENUM.KENYAN_SHILLING,
|
|
193
193
|
currency_symbol: ENUMS_1.CURRENCY_SYMBOL_ENUM.KSh,
|
|
194
194
|
},
|
|
195
|
+
{
|
|
196
|
+
country_name: ENUMS_1.COUNTRY_NAME_ENUM.SPAIN,
|
|
197
|
+
country_alpha_2: ENUMS_1.COUNTRY_ALPHA_2_ENUM.ES,
|
|
198
|
+
country_flag: ENUMS_1.COUNTRY_FLAG_ENUM['πͺπΈ'],
|
|
199
|
+
currency_code: ENUMS_1.CURRENCY_CODE_ENUM.EUR,
|
|
200
|
+
country_alpha_3: ENUMS_1.COUNTRY_ALPHA_3_ENUM.ESP,
|
|
201
|
+
country_code: ENUMS_1.COUNTRY_CODE_ENUM['+34'],
|
|
202
|
+
currency_name: ENUMS_1.CURRENCY_NAME_ENUM.EURO,
|
|
203
|
+
currency_symbol: ENUMS_1.CURRENCY_SYMBOL_ENUM['β¬'],
|
|
204
|
+
},
|
|
195
205
|
],
|
|
196
206
|
};
|
|
197
207
|
// ======================>> <<====================== //
|
|
@@ -209,6 +219,7 @@ exports.WHATSAPP_CHARGES_MAP = new Map([
|
|
|
209
219
|
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.ZA, 80], // 0.8 ZAR
|
|
210
220
|
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.TZ, 6000], // 60 tSH
|
|
211
221
|
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.AF, 50], // 0.5 AFN
|
|
222
|
+
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.ES, 5], // 0.05 EUR
|
|
212
223
|
]);
|
|
213
224
|
// ======================>> <<====================== //
|
|
214
225
|
exports.NOTIFICATION_CHARGES_MAP = new Map([
|
|
@@ -223,6 +234,7 @@ exports.NOTIFICATION_CHARGES_MAP = new Map([
|
|
|
223
234
|
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.ZA, 10], // 0.1 ZAR
|
|
224
235
|
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.TZ, 1000], // 10 tSH
|
|
225
236
|
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.AF, 100], // 1 AFN
|
|
237
|
+
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.ES, 1], // 0.01 EUR
|
|
226
238
|
]);
|
|
227
239
|
exports.PAYMENT_CHARGES_MAP = new Map([
|
|
228
240
|
[
|
|
@@ -270,6 +282,20 @@ exports.PAYMENT_CHARGES_MAP = new Map([
|
|
|
270
282
|
provider_fixed_charges: 0,
|
|
271
283
|
},
|
|
272
284
|
},
|
|
285
|
+
[ENUMS_1.COUNTRY_ALPHA_2_ENUM.ES]: {
|
|
286
|
+
[ENUMS_1.TRANSACTION_TYPE_ENUM.LOCAL]: {
|
|
287
|
+
bank_percentage_charges: 1.5,
|
|
288
|
+
bank_fixed_charges: 25,
|
|
289
|
+
provider_percentage_charges: 0,
|
|
290
|
+
provider_fixed_charges: 0,
|
|
291
|
+
},
|
|
292
|
+
[ENUMS_1.TRANSACTION_TYPE_ENUM.INTERNATIONAL]: {
|
|
293
|
+
bank_percentage_charges: 3.25,
|
|
294
|
+
bank_fixed_charges: 25,
|
|
295
|
+
provider_percentage_charges: 0,
|
|
296
|
+
provider_fixed_charges: 0,
|
|
297
|
+
},
|
|
298
|
+
},
|
|
273
299
|
},
|
|
274
300
|
],
|
|
275
301
|
[
|
package/lib/constants/ENUMS.d.ts
CHANGED
|
@@ -290,6 +290,7 @@ export declare enum COUNTRY_CODE_ENUM {
|
|
|
290
290
|
'+966' = "+966",
|
|
291
291
|
'+1' = "+1",
|
|
292
292
|
'+33' = "+33",
|
|
293
|
+
'+34' = "+34",
|
|
293
294
|
'+61' = "+61",
|
|
294
295
|
'+64' = "+64",
|
|
295
296
|
'+44' = "+44",
|
|
@@ -309,6 +310,7 @@ export declare enum COUNTRY_ALPHA_2_ENUM {
|
|
|
309
310
|
AU = "AU",
|
|
310
311
|
NZ = "NZ",
|
|
311
312
|
GB = "GB",
|
|
313
|
+
ES = "ES",
|
|
312
314
|
ZA = "ZA",
|
|
313
315
|
TZ = "TZ",
|
|
314
316
|
AF = "AF",
|
|
@@ -325,6 +327,7 @@ export declare enum COUNTRY_ALPHA_3_ENUM {
|
|
|
325
327
|
AUS = "AUS",
|
|
326
328
|
NZL = "NZL",
|
|
327
329
|
GBR = "GBR",
|
|
330
|
+
ESP = "ESP",
|
|
328
331
|
ZAF = "ZAF",
|
|
329
332
|
TZA = "TZA",
|
|
330
333
|
AFG = "AFG",
|
|
@@ -342,6 +345,7 @@ export declare enum COUNTRY_NAME_ENUM {
|
|
|
342
345
|
NEW_ZEALAND = "NEW ZEALAND",
|
|
343
346
|
GREAT_BRITAIN = "GREAT BRITAIN",
|
|
344
347
|
SOUTH_AFRICA = "SOUTH AFRICA",
|
|
348
|
+
SPAIN = "SPAIN",
|
|
345
349
|
TANZANIA = "TANZANIA",
|
|
346
350
|
AFGHANISTAN = "AFGHANISTAN",
|
|
347
351
|
KENYA = "KENYA"
|
|
@@ -358,6 +362,7 @@ export declare enum COUNTRY_FLAG_ENUM {
|
|
|
358
362
|
'π³πΏ' = "\uD83C\uDDF3\uD83C\uDDFF",
|
|
359
363
|
'π¬π§' = "\uD83C\uDDEC\uD83C\uDDE7",
|
|
360
364
|
'πΏπ¦' = "\uD83C\uDDFF\uD83C\uDDE6",
|
|
365
|
+
'πͺπΈ' = "\uD83C\uDDEA\uD83C\uDDF8",
|
|
361
366
|
'πΉπΏ' = "\uD83C\uDDF9\uD83C\uDDFF",
|
|
362
367
|
'π¦π«' = "\uD83C\uDDE6\uD83C\uDDEB",
|
|
363
368
|
'π°πͺ' = "\uD83C\uDDF0\uD83C\uDDEA"
|
package/lib/constants/ENUMS.js
CHANGED
|
@@ -452,6 +452,7 @@ var COUNTRY_CODE_ENUM;
|
|
|
452
452
|
COUNTRY_CODE_ENUM["+966"] = "+966";
|
|
453
453
|
COUNTRY_CODE_ENUM["+1"] = "+1";
|
|
454
454
|
COUNTRY_CODE_ENUM["+33"] = "+33";
|
|
455
|
+
COUNTRY_CODE_ENUM["+34"] = "+34";
|
|
455
456
|
COUNTRY_CODE_ENUM["+61"] = "+61";
|
|
456
457
|
COUNTRY_CODE_ENUM["+64"] = "+64";
|
|
457
458
|
COUNTRY_CODE_ENUM["+44"] = "+44";
|
|
@@ -473,6 +474,7 @@ var COUNTRY_ALPHA_2_ENUM;
|
|
|
473
474
|
COUNTRY_ALPHA_2_ENUM["AU"] = "AU";
|
|
474
475
|
COUNTRY_ALPHA_2_ENUM["NZ"] = "NZ";
|
|
475
476
|
COUNTRY_ALPHA_2_ENUM["GB"] = "GB";
|
|
477
|
+
COUNTRY_ALPHA_2_ENUM["ES"] = "ES";
|
|
476
478
|
COUNTRY_ALPHA_2_ENUM["ZA"] = "ZA";
|
|
477
479
|
COUNTRY_ALPHA_2_ENUM["TZ"] = "TZ";
|
|
478
480
|
COUNTRY_ALPHA_2_ENUM["AF"] = "AF";
|
|
@@ -491,6 +493,7 @@ var COUNTRY_ALPHA_3_ENUM;
|
|
|
491
493
|
COUNTRY_ALPHA_3_ENUM["AUS"] = "AUS";
|
|
492
494
|
COUNTRY_ALPHA_3_ENUM["NZL"] = "NZL";
|
|
493
495
|
COUNTRY_ALPHA_3_ENUM["GBR"] = "GBR";
|
|
496
|
+
COUNTRY_ALPHA_3_ENUM["ESP"] = "ESP";
|
|
494
497
|
COUNTRY_ALPHA_3_ENUM["ZAF"] = "ZAF";
|
|
495
498
|
COUNTRY_ALPHA_3_ENUM["TZA"] = "TZA";
|
|
496
499
|
COUNTRY_ALPHA_3_ENUM["AFG"] = "AFG";
|
|
@@ -510,6 +513,7 @@ var COUNTRY_NAME_ENUM;
|
|
|
510
513
|
COUNTRY_NAME_ENUM["NEW_ZEALAND"] = "NEW ZEALAND";
|
|
511
514
|
COUNTRY_NAME_ENUM["GREAT_BRITAIN"] = "GREAT BRITAIN";
|
|
512
515
|
COUNTRY_NAME_ENUM["SOUTH_AFRICA"] = "SOUTH AFRICA";
|
|
516
|
+
COUNTRY_NAME_ENUM["SPAIN"] = "SPAIN";
|
|
513
517
|
COUNTRY_NAME_ENUM["TANZANIA"] = "TANZANIA";
|
|
514
518
|
COUNTRY_NAME_ENUM["AFGHANISTAN"] = "AFGHANISTAN";
|
|
515
519
|
COUNTRY_NAME_ENUM["KENYA"] = "KENYA";
|
|
@@ -528,6 +532,7 @@ var COUNTRY_FLAG_ENUM;
|
|
|
528
532
|
COUNTRY_FLAG_ENUM["\uD83C\uDDF3\uD83C\uDDFF"] = "\uD83C\uDDF3\uD83C\uDDFF";
|
|
529
533
|
COUNTRY_FLAG_ENUM["\uD83C\uDDEC\uD83C\uDDE7"] = "\uD83C\uDDEC\uD83C\uDDE7";
|
|
530
534
|
COUNTRY_FLAG_ENUM["\uD83C\uDDFF\uD83C\uDDE6"] = "\uD83C\uDDFF\uD83C\uDDE6";
|
|
535
|
+
COUNTRY_FLAG_ENUM["\uD83C\uDDEA\uD83C\uDDF8"] = "\uD83C\uDDEA\uD83C\uDDF8";
|
|
531
536
|
COUNTRY_FLAG_ENUM["\uD83C\uDDF9\uD83C\uDDFF"] = "\uD83C\uDDF9\uD83C\uDDFF";
|
|
532
537
|
COUNTRY_FLAG_ENUM["\uD83C\uDDE6\uD83C\uDDEB"] = "\uD83C\uDDE6\uD83C\uDDEB";
|
|
533
538
|
COUNTRY_FLAG_ENUM["\uD83C\uDDF0\uD83C\uDDEA"] = "\uD83C\uDDF0\uD83C\uDDEA";
|
|
@@ -23,9 +23,8 @@ export declare function getSelectedVendorCatalogs(menus: {
|
|
|
23
23
|
}[], selectedVendorId: string | null, mappedCatalog: Record<string, IWarehouseCatalog>): IWarehouseCatalog[];
|
|
24
24
|
/**
|
|
25
25
|
* Group inventory items by category_id for O(1) lookup.
|
|
26
|
-
* Mirrors the warehouse's mappedCatalog
|
|
27
|
-
*
|
|
28
|
-
* uncategorized handling belongs in the UI layer.
|
|
26
|
+
* Mirrors the warehouse's mappedCatalog. Items with a null/undefined
|
|
27
|
+
* category_id are stored under the key '' (empty string).
|
|
29
28
|
*/
|
|
30
29
|
export declare function getInventoryMappedItems(inventory: IKitchenInventory[]): Record<string, IKitchenInventory[]>;
|
|
31
30
|
/**
|
|
@@ -224,19 +224,17 @@ function getSelectedVendorCatalogs(menus, selectedVendorId, mappedCatalog) {
|
|
|
224
224
|
// ============================================================================
|
|
225
225
|
/**
|
|
226
226
|
* Group inventory items by category_id for O(1) lookup.
|
|
227
|
-
* Mirrors the warehouse's mappedCatalog
|
|
228
|
-
*
|
|
229
|
-
* uncategorized handling belongs in the UI layer.
|
|
227
|
+
* Mirrors the warehouse's mappedCatalog. Items with a null/undefined
|
|
228
|
+
* category_id are stored under the key '' (empty string).
|
|
230
229
|
*/
|
|
231
230
|
function getInventoryMappedItems(inventory) {
|
|
232
231
|
const map = {};
|
|
233
232
|
for (let i = 0; i < inventory.length; i++) {
|
|
234
233
|
const item = inventory[i];
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
map[item.category_id].push(item);
|
|
234
|
+
const key = item.category_id ?? '';
|
|
235
|
+
if (!map[key])
|
|
236
|
+
map[key] = [];
|
|
237
|
+
map[key].push(item);
|
|
240
238
|
}
|
|
241
239
|
return map;
|
|
242
240
|
}
|
|
@@ -263,9 +261,7 @@ function getSelectedVendorInventoryItems(mappedInventory, includedCategories) {
|
|
|
263
261
|
const result = [];
|
|
264
262
|
for (let i = 0; i < includedCategories.length; i++) {
|
|
265
263
|
const { category_id, excluded_items } = includedCategories[i];
|
|
266
|
-
|
|
267
|
-
continue;
|
|
268
|
-
const items = mappedInventory[category_id];
|
|
264
|
+
const items = mappedInventory[category_id ?? ''];
|
|
269
265
|
if (!items)
|
|
270
266
|
continue;
|
|
271
267
|
if (excluded_items.length === 0) {
|
|
@@ -261,6 +261,9 @@ function getGSTName(country_alpha_2, tax_invoice_provider) {
|
|
|
261
261
|
else if (country_alpha_2 === constants_1.COUNTRY_ALPHA_2_ENUM.AF) {
|
|
262
262
|
gstName = 'VAT';
|
|
263
263
|
}
|
|
264
|
+
else if (country_alpha_2 === constants_1.COUNTRY_ALPHA_2_ENUM.ES) {
|
|
265
|
+
gstName = 'IVA';
|
|
266
|
+
}
|
|
264
267
|
return gstName;
|
|
265
268
|
}
|
|
266
269
|
function getTaxNumberTitle(country_alpha_2, tax_invoice_provider) {
|
|
@@ -286,6 +289,9 @@ function getTaxNumberTitle(country_alpha_2, tax_invoice_provider) {
|
|
|
286
289
|
else if (country_alpha_2 === constants_1.COUNTRY_ALPHA_2_ENUM.AE) {
|
|
287
290
|
title = 'TRN';
|
|
288
291
|
}
|
|
292
|
+
else if (country_alpha_2 === constants_1.COUNTRY_ALPHA_2_ENUM.ES) {
|
|
293
|
+
title = 'NIF';
|
|
294
|
+
}
|
|
289
295
|
return title;
|
|
290
296
|
}
|
|
291
297
|
// ==============================>><<==============================
|