@managesome/eposmatic-toolkit 0.2.212 → 0.2.214
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/ANALYTICS.d.ts +3 -3
- package/lib/constants/ENUMS.d.ts +25 -10
- package/lib/constants/ENUMS.js +47 -25
- package/lib/helpers/order/generate-order.js +25 -1
- package/lib/helpers/store/cart-actions.d.ts +3 -1
- package/lib/helpers/store/cart-actions.js +4 -0
- package/lib/helpers/store/common-order-actions.d.ts +1 -1
- package/lib/helpers/store/common-order-actions.js +10 -2
- package/lib/helpers/utils/index.d.ts +1 -0
- package/lib/helpers/utils/index.js +1 -0
- package/lib/helpers/utils/item-report-helpers.js +18 -2
- package/lib/helpers/utils/receipt-engine.js +24 -4
- package/lib/helpers/utils/simplified-tenant.d.ts +15 -0
- package/lib/helpers/utils/simplified-tenant.js +30 -0
- package/lib/schemas/models/common-models.d.ts +63 -51
- package/lib/schemas/models/common-models.js +28 -20
- package/lib/schemas/models/customers.d.ts +60 -48
- package/lib/schemas/models/deliveries.d.ts +3 -0
- package/lib/schemas/models/deliveries.js +5 -0
- package/lib/schemas/models/delivery_areas.d.ts +9 -9
- package/lib/schemas/models/discounts.d.ts +270 -216
- package/lib/schemas/models/halfhalf_setup.d.ts +330 -264
- package/lib/schemas/models/item.d.ts +2220 -1776
- package/lib/schemas/models/menu.d.ts +180 -144
- package/lib/schemas/models/modifier_extras.d.ts +90 -72
- package/lib/schemas/models/offers.d.ts +180 -144
- package/lib/schemas/models/order.d.ts +120 -90
- package/lib/schemas/models/order.js +35 -4
- package/lib/schemas/models/public_holidays.d.ts +30 -24
- package/lib/schemas/models/specials.d.ts +540 -432
- package/lib/schemas/models/tenant.d.ts +31 -1
- package/lib/schemas/models/tenant.js +41 -0
- package/lib/schemas/models/tenant_staff.d.ts +180 -144
- package/lib/schemas/models/track_order_number.d.ts +90 -72
- package/lib/schemas/types/deliveries.d.ts +1 -0
- package/lib/schemas/types/order.d.ts +5 -1
- package/lib/schemas/types/tenant.d.ts +11 -1
- package/package.json +1 -1
|
@@ -266,9 +266,9 @@ export interface IItemSubReport {
|
|
|
266
266
|
name: string;
|
|
267
267
|
grossAmount: number;
|
|
268
268
|
count: number;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
path: string[];
|
|
270
|
+
dealItemId: string | null;
|
|
271
|
+
itemRefId: string | null;
|
|
272
272
|
}
|
|
273
273
|
export interface IItemSales {
|
|
274
274
|
[REPORT_TYPE_ENUM.SALES_BY_ITEM]: {
|
package/lib/constants/ENUMS.d.ts
CHANGED
|
@@ -2,11 +2,12 @@ export declare enum ORDER_FROM_ENUM {
|
|
|
2
2
|
WEB = "WEB",
|
|
3
3
|
APP = "APP",
|
|
4
4
|
POS = "POS",
|
|
5
|
+
FOODPANDA = "FOODPANDA",
|
|
6
|
+
FOODPAPA = "FOODPAPA",
|
|
5
7
|
DOORDASH = "DOORDASH",
|
|
6
8
|
UBER_EATS = "UBER-EATS",
|
|
7
9
|
MENU_LOG = "MENU-LOG",
|
|
8
10
|
GFO = "GFO",
|
|
9
|
-
FOODPANDA = "FOODPANDA",
|
|
10
11
|
TALABAT = "TALABAT",
|
|
11
12
|
NOON = "NOON",
|
|
12
13
|
SMILES = "SMILES",
|
|
@@ -27,18 +28,22 @@ export declare enum ORDER_TYPE_ENUM {
|
|
|
27
28
|
}
|
|
28
29
|
export declare const ALL_ORDER_TYPE_NAMES: ORDER_TYPE_ENUM[];
|
|
29
30
|
export declare enum PLATFORMS_ENUM {
|
|
30
|
-
WEB_TAKE_AWAY = "WEB_TAKE-AWAY",
|
|
31
|
-
WEB_DELIVERY = "WEB_DELIVERY",
|
|
32
|
-
WEB_DINE_IN = "WEB_DINE-IN",
|
|
33
|
-
APP_TAKE_AWAY = "APP_TAKE-AWAY",
|
|
34
|
-
APP_DELIVERY = "APP_DELIVERY",
|
|
35
|
-
APP_DINE_IN = "APP_DINE-IN",
|
|
36
31
|
POS_WALK_IN = "POS_WALK-IN",
|
|
37
32
|
POS_TAKE_AWAY = "POS_TAKE-AWAY",
|
|
38
33
|
POS_DELIVERY = "POS_DELIVERY",
|
|
39
34
|
POS_DINE_IN = "POS_DINE-IN",
|
|
40
35
|
POS_DRIVE_THRU = "POS_DRIVE-THRU",
|
|
41
36
|
POS_KIOSK = "POS_KIOSK",
|
|
37
|
+
WEB_TAKE_AWAY = "WEB_TAKE-AWAY",
|
|
38
|
+
WEB_DELIVERY = "WEB_DELIVERY",
|
|
39
|
+
WEB_DINE_IN = "WEB_DINE-IN",
|
|
40
|
+
APP_TAKE_AWAY = "APP_TAKE-AWAY",
|
|
41
|
+
APP_DELIVERY = "APP_DELIVERY",
|
|
42
|
+
APP_DINE_IN = "APP_DINE-IN",
|
|
43
|
+
FOODPANDA_TAKE_AWAY = "FOODPANDA_TAKE-AWAY",
|
|
44
|
+
FOODPANDA_DELIVERY = "FOODPANDA_DELIVERY",
|
|
45
|
+
FOODPAPA_TAKE_AWAY = "FOODPAPA_TAKE-AWAY",
|
|
46
|
+
FOODPAPA_DELIVERY = "FOODPAPA_DELIVERY",
|
|
42
47
|
DOORDASH_TAKE_AWAY = "DOORDASH_TAKE-AWAY",
|
|
43
48
|
DOORDASH_DELIVERY = "DOORDASH_DELIVERY",
|
|
44
49
|
UBER_EATS_TAKE_AWAY = "UBER-EATS_TAKE-AWAY",
|
|
@@ -47,8 +52,6 @@ export declare enum PLATFORMS_ENUM {
|
|
|
47
52
|
MENU_LOG_DELIVERY = "MENU-LOG_DELIVERY",
|
|
48
53
|
GFO_TAKE_AWAY = "GFO_TAKE-AWAY",
|
|
49
54
|
GFO_DELIVERY = "GFO_DELIVERY",
|
|
50
|
-
FOODPANDA_TAKE_AWAY = "FOODPANDA_TAKE-AWAY",
|
|
51
|
-
FOODPANDA_DELIVERY = "FOODPANDA_DELIVERY",
|
|
52
55
|
TALABAT_TAKE_AWAY = "TALABAT_TAKE-AWAY",
|
|
53
56
|
TALABAT_DELIVERY = "TALABAT_DELIVERY",
|
|
54
57
|
NOON_TAKE_AWAY = "NOON_TAKE-AWAY",
|
|
@@ -79,11 +82,12 @@ export declare const PLATFORMS_BY_ORDER_FROM: {
|
|
|
79
82
|
WEB: PLATFORMS_ENUM[];
|
|
80
83
|
APP: PLATFORMS_ENUM[];
|
|
81
84
|
POS: PLATFORMS_ENUM[];
|
|
85
|
+
FOODPANDA: PLATFORMS_ENUM[];
|
|
86
|
+
FOODPAPA: PLATFORMS_ENUM[];
|
|
82
87
|
DOORDASH: PLATFORMS_ENUM[];
|
|
83
88
|
"UBER-EATS": PLATFORMS_ENUM[];
|
|
84
89
|
"MENU-LOG": PLATFORMS_ENUM[];
|
|
85
90
|
GFO: PLATFORMS_ENUM[];
|
|
86
|
-
FOODPANDA: PLATFORMS_ENUM[];
|
|
87
91
|
TALABAT: PLATFORMS_ENUM[];
|
|
88
92
|
NOON: PLATFORMS_ENUM[];
|
|
89
93
|
SMILES: PLATFORMS_ENUM[];
|
|
@@ -431,8 +435,12 @@ export declare enum USER_PERMISSIONS_ENUM {
|
|
|
431
435
|
ADMIN_VIEW_MENU = "ADMIN_VIEW_MENU",
|
|
432
436
|
ADMIN_VIEW_ORDERS = "ADMIN_VIEW_ORDERS",
|
|
433
437
|
ADMIN_VIEW_INVENTORY = "ADMIN_VIEW_INVENTORY",
|
|
438
|
+
ADMIN_VIEW_COSTING = "ADMIN_VIEW_COSTING",
|
|
434
439
|
ADMIN_VIEW_EXPENSES = "ADMIN_VIEW_EXPENSES",
|
|
435
440
|
ADMIN_VIEW_REPORTS = "ADMIN_VIEW_REPORTS",
|
|
441
|
+
ADMIN_VIEW_PRODUCT_REPORTS = "ADMIN_VIEW_PRODUCT_REPORTS",
|
|
442
|
+
ADMIN_VIEW_REVENUE_REPORTS = "ADMIN_VIEW_REVENUE_REPORTS",
|
|
443
|
+
ADMIN_VIEW_PRODUCT_REPORTS_REVENUE = "ADMIN_VIEW_PRODUCT_REPORTS_REVENUE",
|
|
436
444
|
ADMIN_VIEW_CUSTOMERS = "ADMIN_VIEW_CUSTOMERS",
|
|
437
445
|
ADMIN_VIEW_OFFERS = "ADMIN_VIEW_OFFERS",
|
|
438
446
|
ADMIN_VIEW_MARKETING = "ADMIN_VIEW_MARKETING",
|
|
@@ -474,6 +482,7 @@ export declare enum USER_PERMISSIONS_ENUM {
|
|
|
474
482
|
POS_CREATE_PRINT_UNPAID_RECEIPT = "POS_CREATE_PRINT_UNPAID_RECEIPT",
|
|
475
483
|
POS_CREATE_APPLY_REPORTS_FILTER = "POS_CREATE_APPLY_REPORTS_FILTER",
|
|
476
484
|
POS_CREATE_PRINT_DUPLICATE_DOCKET = "POS_CREATE_PRINT_DUPLICATE_DOCKET",
|
|
485
|
+
POS_CREATE_COMPLIMENTARY_BILL = "POS_CREATE_COMPLIMENTARY_BILL",
|
|
477
486
|
ADMIN_UPDATE_MENU = "ADMIN_UPDATE_MENU",
|
|
478
487
|
ADMIN_UPDATE_INVENTORY = "ADMIN_UPDATE_INVENTORY",
|
|
479
488
|
ADMIN_UPDATE_ORDER = "ADMIN_UPDATE_ORDER",
|
|
@@ -664,6 +673,12 @@ export declare enum DELIVERY_AREAS_SEARCH_TYPE_ENUM {
|
|
|
664
673
|
MANUAL = "MANUAL"
|
|
665
674
|
}
|
|
666
675
|
export declare const ALL_DELIVERY_AREAS_SEARCH_TYPES: DELIVERY_AREAS_SEARCH_TYPE_ENUM[];
|
|
676
|
+
export declare enum RIDER_FEE_TYPE_ENUM {
|
|
677
|
+
DELIVERY_CHARGES_FULL = "DELIVERY_CHARGES_FULL",
|
|
678
|
+
DISTANCE_ONE_WAY = "DISTANCE_ONE_WAY",
|
|
679
|
+
DISTANCE_RETURN = "DISTANCE_RETURN"
|
|
680
|
+
}
|
|
681
|
+
export declare const ALL_RIDER_FEE_TYPES: RIDER_FEE_TYPE_ENUM[];
|
|
667
682
|
export declare enum SPLIT_BILL_TYPE_ENUM {
|
|
668
683
|
EQUAL = "EQUAL",
|
|
669
684
|
ITEM = "ITEM",
|
package/lib/constants/ENUMS.js
CHANGED
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ALL_CATEGORY_DISPLAY_TYPES = exports.CATEGORY_DISPLAY_TYPE_ENUM = exports.ALL_PAYMENT_METHOD_EXPECTED = exports.PAYMENT_METHOD_EXPECTED_ENUM = exports.ALL_WEB_UNPAID_PAYMENT_TYPES = exports.WEB_UNPAID_PAYMENT_TYPE_ENUM = exports.ALL_COUNTRY_FLAG_TYPES = exports.COUNTRY_FLAG_ENUM = exports.ALL_COUNTRY_NAME_TYPES = exports.COUNTRY_NAME_ENUM = exports.ALL_COUNTRY_ALPHA_3_TYPES = exports.COUNTRY_ALPHA_3_ENUM = exports.ALL_COUNTRY_ALPHA_2_TYPES = exports.COUNTRY_ALPHA_2_ENUM = exports.ALL_COUNTRY_CODES = exports.COUNTRY_CODE_ENUM = exports.ALL_CURRENCY_SYMBOLS = exports.CURRENCY_SYMBOL_ENUM = exports.ALL_CURRENCY_NAMES = exports.CURRENCY_NAME_ENUM = exports.ALL_CURRENCY_CODES = exports.CURRENCY_CODE_ENUM = exports.ALL_DAY_INDEX = exports.DAY_INDEX_ENUM = exports.ALL_INVENTORY_UNIT_TYPES = exports.INVENTORY_ITEM_UNIT_ENUM = exports.ALL_DIETARY_PREFERENCES = exports.ITEM_DIETARY_PREFERENCE_ENUM = exports.ALL_CAVEATS = exports.ITEM_CAVEATS_ENUM = exports.ALL_PAYMENT_STATUS = exports.PAYMENT_STATUS_ENUM = exports.ALL_ORDER_STATUS_NAMES = exports.ORDER_STATUS_ENUM = exports.ALL_PAYMENT_TYPE_NAMES = exports.PaymentTypeDescriptions = exports.PAYMENT_TYPE_ENUM = exports.ALL_API_STATUS_NAMES = exports.API_STATUS_ENUM = exports.ALL_INTEGRATIONS = exports.INTEGRATIONS_ENUM = exports.PLATFORM_NAMES = exports.PLATFORMS_BY_ORDER_FROM = exports.PLATFORMS_BY_ORDER_TYPE = exports.ALL_PLATFORMS = exports.PLATFORMS_ENUM = exports.ALL_ORDER_TYPE_NAMES = exports.ORDER_TYPE_ENUM = exports.ALL_ORDER_FROM_NAMES = exports.ORDER_FROM_ENUM = void 0;
|
|
4
4
|
exports.PRINTING_PREFERENCE_ENUM = exports.ALL_PRINTER_BRAND_TYPES = exports.PRINTER_BRAND_TYPE_ENUM = exports.ALL_ORDER_ITEM_TYPES = exports.ORDER_ITEM_TYPE_ENUM = exports.ALL_PLATFORM_PROVIDER_IDS = exports.PLATFORM_PROVIDER_IDS_ENUM = exports.ALL_MARKETING_RECEIPIENT_TYPES = exports.MARKETING_RECEIPIENT_ENUM = exports.ALL_MARKETING_TYPES = exports.MARKETING_TYPE_ENUM = exports.ALL_TOKEN_TYPES = exports.TOKEN_TYPE_ENUM = exports.ALL_EMAIL_PROCESSING_PROVIDERS = exports.EMAIL_PROCESSING_PROVIDERS_ENUM = exports.ALL_SMS_PROCESSING_PROVIDERS = exports.SMS_PROCESSING_PROVIDERS_ENUM = exports.ALL_TERMINAL_TYPES = exports.TERMINAL_TYPE_ENUM = exports.ALL_TERMINAL_PROCESSING_PROVIDERS = exports.TERMINAL_PROCESSING_PROVIDERS_ENUM = exports.TRANSACTION_TYPE_ENUM = exports.ALL_CARD_PROCESSING_PROVIDERS = exports.CARD_PROCESSING_PROVIDERS_ENUM = exports.ALL_PAYMENT_PROVIDERS = exports.PAYMENT_PROVIDERS_ENUM = exports.ALL_SUPPORT_SPECIALIST_PERMISSIONS = exports.ALL_MODERATOR_PERMISSIONS = exports.ALL_USER_PERMISSIONS = exports.USER_PERMISSIONS_ENUM = exports.ALL_OFFER_TYPES = exports.OFFER_TYPE_ENUM = exports.ALL_OFFER_USE_TYPES = exports.OFFER_USE_TYPE_ENUM = exports.ALL_OFFER_CODE_USAGE_TYPES = exports.OFFER_CODE_USAGE_TYPE_ENUM = exports.ALL_PATHWAY_TO_UNLOCK_TYPES = exports.PATHWAY_TO_UNLOCK_TYPE_ENUM = exports.ALL_OFFER_REWARD_TYPES = exports.OFFER_REWARD_TYPE_ENUM = exports.ALL_USER_ROLES = exports.USER_ROLES_ENUM = exports.ALL_PLATFORM_TYPES = exports.PLATFORM_TYPE_ENUM = exports.ALL_ORDER_NUMBER_GROUPING_TYPES = exports.ORDER_NUMBER_GROUPING_TYPE_ENUM = exports.ALL_TRACK_ORDER_NUMBER_TYPES = exports.TRACK_ORDER_NUMBER_ENUM = exports.ALL_TABLE_TYPES = exports.TABLE_TYPE_ENUM = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.ALL_INTERNAL_LEAD_STATUS = exports.INTERNAL_LEAD_STATUS_ENUM = exports.ALL_INTERNAL_LEAD_SOURCES = exports.INTERNAL_LEAD_SOURCE_ENUM = void 0;
|
|
5
|
+
exports.ALL_MULTI_TENANT_WEBSITE_TYPES = exports.MULTI_TENANT_WEBSITE_TYPE_ENUM = exports.ALL_TIME_RANGE_ENUMS = exports.TIME_RANGE_ENUM = exports.ALL_ITEM_TRANSACTION_TYPES = exports.ITEM_TRANSACTION_TYPE_ENUM = exports.INVENTORY_OUTBOUND_TRANSACTIONS = exports.INVENTORY_INBOUND_TRANSACTIONS = exports.ALL_INVENTORY_TRANSACTION_CATEGORIES = exports.INVENTORY_TRANSACTION_CATEGORY_ENUM = exports.ALL_INVENTORY_TRANSACTION_TYPES = exports.INVENTORY_TRANSACTION_TYPE_ENUM = exports.ALL_GST_TYPES = exports.GST_TYPE_ENUM = exports.ALL_EXPENSE_REACCURING_TYPES = exports.EXPENSE_REACCURING_TYPE_ENUM = exports.PAYMENT_EXTENSION_ENUM = exports.ALL_PRINTER_INTERFACES = exports.PRINTER_INTERFACE_ENUM = exports.RECEIPT_WIDTHS = exports.ALL_NUM_OF_COLUMNS = exports.NUM_OF_COLUMNS_ENUM = exports.SPLIT_SYNC_SOURCE_ENUM = exports.ALL_SPLIT_BILL_TYPES = exports.SPLIT_BILL_TYPE_ENUM = exports.ALL_RIDER_FEE_TYPES = exports.RIDER_FEE_TYPE_ENUM = exports.ALL_DELIVERY_AREAS_SEARCH_TYPES = exports.DELIVERY_AREAS_SEARCH_TYPE_ENUM = exports.ALL_WEB_AUTH_TYPES = exports.WEB_AUTH_TYPE_ENUM = exports.KITCHEN_RECEIPT_TYPE_ENUM = exports.PRINTER_EVENT_TYPE_ENUM = exports.SORT_TYPE_ENUM = exports.BLACKLISTED_SMS_COUNTRY_CODES = exports.ALL_OTP_TYPES = exports.OTP_TYPE_ENUM = exports.ALL_TAX_INVOICE_PROVIDERS = exports.TAX_INVOICE_PROVIDER_ENUM = exports.ALL_RESERVATION_STATUS_TYPES = exports.RESERVATION_STATUS_ENUM = exports.TENANT_AMOUNT_DUE_TYPE_ENUM = exports.ALL_KITCHEN_DOCKET_FONT_TYPES = exports.KITCHEN_DOCKET_FONT_TYPE_ENUM = exports.ALL_SORT_ORDER_BY_TYPES = exports.SORT_ORDER_BY_ENUM = exports.RECEIPT_IMAGE_TYPE_ENUM = exports.ALL_RECEIPT_TYPES = exports.RECEIPT_TYPE_ENUM = exports.ALL_PRINTING_PREFERENCES = void 0;
|
|
6
|
+
exports.ALL_CASH_IN_OUT_TYPES = exports.CASH_IN_OUT_TYPE_ENUM = exports.ALL_POS_SHIFT_STATUS = exports.POS_SHIFT_STATUS_ENUM = exports.ALL_POS_DAY_STATUS = exports.POS_DAY_STATUS_ENUM = exports.ALL_MODIFIER_OPTION_REF_TYPES = exports.MODIFIER_OPTION_REF_TYPE_ENUM = exports.ALL_WAREHOUSE_CLIENT_TYPES = exports.WAREHOUSE_CLIENT_TYPE_ENUM = exports.ALL_ONLINE_ORDERING_DESIGN_TYPES = exports.ONLINE_ORDERING_DESIGN_TYPE_ENUM = exports.ALL_NOTIFICATION_PROVIDERS = exports.NOTIFICATION_PROVIDER_ENUM = exports.ALL_ORDER_COMPLETION_TYPES = exports.ORDER_COMPLETION_TYPE_ENUM = exports.ITEM_COMPARISON_FIELD_ENUM = exports.VOID_ITEM_STAFF_REPORT_ENUM = exports.ALL_DISCOUNT_APPLICABILITY_TYPES = exports.DISCOUNT_APPLICABILITY_ENUM = exports.ALL_DISCOUNT_TYPES = exports.DISCOUNT_TYPE_ENUM = exports.EMAIL_TEMPLATES_TYPE_ENUM = exports.ALL_ALERT_NOTIFICATIONS_TYPES = exports.ALERT_NOTIFICATIONS_TYPE_ENUM = exports.ALL_WALLET_TRANSACTION_STATUS = exports.WALLET_TRANSACTION_STATUS_ENUM = exports.ALL_WALLET_TRANSACTION_CATEGORIES = exports.WALLET_TRANSACTION_CATEGORY_ENUM = exports.ALL_WALLET_TRANSACTION_TYPES = exports.WALLET_TRANSACTION_TYPE_ENUM = exports.ALL_WAREHOUSE_SUPPORT_SPECIALIST_PERMISSIONS = exports.ALL_WAREHOUSE_MODERATOR_PERMISSIONS = exports.ALL_WAREHOUSE_USER_PERMISSIONS = exports.WAREHOUSE_USER_PERMISSIONS_ENUM = exports.ALL_WAREHOUSE_INVOICE_STATUS_NAMES = exports.WAREHOUSE_INVOICE_STATUS_ENUM = exports.ALL_PURCHASE_ORDER_STATUS_NAMES = exports.PURCHASE_ORDER_STATUS_ENUM = exports.ALL_DELIVERY_STATUS = exports.DELIVERY_STATUS_ENUM = exports.ALL_INVENTORY_ITEM_TYPES = exports.INVENTORY_ITEM_TYPE_ENUM = exports.ALL_RATING_TYPES = exports.RATING_TYPE_ENUM = exports.ALL_SUBSCRIPTION_STATUS = exports.SUBSCRIPTION_STATUS_ENUM = exports.ALL_VOID_ORDER_ITEM_TYPES = exports.VOID_ORDER_ITEM_TYPE_ENUM = exports.COMPARISON_REPORT_TYPE_ENUM = void 0;
|
|
7
|
+
exports.ALL_INTERNAL_LEAD_STATUS = exports.INTERNAL_LEAD_STATUS_ENUM = exports.ALL_INTERNAL_LEAD_SOURCES = exports.INTERNAL_LEAD_SOURCE_ENUM = exports.ALL_CASH_DRAWER_STATUS = exports.CASH_DRAWER_STATUS_ENUM = void 0;
|
|
8
8
|
var ORDER_FROM_ENUM;
|
|
9
9
|
(function (ORDER_FROM_ENUM) {
|
|
10
10
|
ORDER_FROM_ENUM["WEB"] = "WEB";
|
|
11
11
|
ORDER_FROM_ENUM["APP"] = "APP";
|
|
12
12
|
ORDER_FROM_ENUM["POS"] = "POS";
|
|
13
|
+
ORDER_FROM_ENUM["FOODPANDA"] = "FOODPANDA";
|
|
14
|
+
ORDER_FROM_ENUM["FOODPAPA"] = "FOODPAPA";
|
|
13
15
|
ORDER_FROM_ENUM["DOORDASH"] = "DOORDASH";
|
|
14
16
|
ORDER_FROM_ENUM["UBER_EATS"] = "UBER-EATS";
|
|
15
17
|
ORDER_FROM_ENUM["MENU_LOG"] = "MENU-LOG";
|
|
16
18
|
ORDER_FROM_ENUM["GFO"] = "GFO";
|
|
17
|
-
ORDER_FROM_ENUM["FOODPANDA"] = "FOODPANDA";
|
|
18
19
|
ORDER_FROM_ENUM["TALABAT"] = "TALABAT";
|
|
19
20
|
ORDER_FROM_ENUM["NOON"] = "NOON";
|
|
20
21
|
ORDER_FROM_ENUM["SMILES"] = "SMILES";
|
|
@@ -38,6 +39,13 @@ exports.ALL_ORDER_TYPE_NAMES = Object.values(ORDER_TYPE_ENUM);
|
|
|
38
39
|
/* ================><================= */
|
|
39
40
|
var PLATFORMS_ENUM;
|
|
40
41
|
(function (PLATFORMS_ENUM) {
|
|
42
|
+
// POS
|
|
43
|
+
PLATFORMS_ENUM["POS_WALK_IN"] = "POS_WALK-IN";
|
|
44
|
+
PLATFORMS_ENUM["POS_TAKE_AWAY"] = "POS_TAKE-AWAY";
|
|
45
|
+
PLATFORMS_ENUM["POS_DELIVERY"] = "POS_DELIVERY";
|
|
46
|
+
PLATFORMS_ENUM["POS_DINE_IN"] = "POS_DINE-IN";
|
|
47
|
+
PLATFORMS_ENUM["POS_DRIVE_THRU"] = "POS_DRIVE-THRU";
|
|
48
|
+
PLATFORMS_ENUM["POS_KIOSK"] = "POS_KIOSK";
|
|
41
49
|
// WEB
|
|
42
50
|
PLATFORMS_ENUM["WEB_TAKE_AWAY"] = "WEB_TAKE-AWAY";
|
|
43
51
|
PLATFORMS_ENUM["WEB_DELIVERY"] = "WEB_DELIVERY";
|
|
@@ -46,13 +54,12 @@ var PLATFORMS_ENUM;
|
|
|
46
54
|
PLATFORMS_ENUM["APP_TAKE_AWAY"] = "APP_TAKE-AWAY";
|
|
47
55
|
PLATFORMS_ENUM["APP_DELIVERY"] = "APP_DELIVERY";
|
|
48
56
|
PLATFORMS_ENUM["APP_DINE_IN"] = "APP_DINE-IN";
|
|
49
|
-
//
|
|
50
|
-
PLATFORMS_ENUM["
|
|
51
|
-
PLATFORMS_ENUM["
|
|
52
|
-
|
|
53
|
-
PLATFORMS_ENUM["
|
|
54
|
-
PLATFORMS_ENUM["
|
|
55
|
-
PLATFORMS_ENUM["POS_KIOSK"] = "POS_KIOSK";
|
|
57
|
+
// FOODPANDA
|
|
58
|
+
PLATFORMS_ENUM["FOODPANDA_TAKE_AWAY"] = "FOODPANDA_TAKE-AWAY";
|
|
59
|
+
PLATFORMS_ENUM["FOODPANDA_DELIVERY"] = "FOODPANDA_DELIVERY";
|
|
60
|
+
// FOODPAPA
|
|
61
|
+
PLATFORMS_ENUM["FOODPAPA_TAKE_AWAY"] = "FOODPAPA_TAKE-AWAY";
|
|
62
|
+
PLATFORMS_ENUM["FOODPAPA_DELIVERY"] = "FOODPAPA_DELIVERY";
|
|
56
63
|
// DOORDASH
|
|
57
64
|
PLATFORMS_ENUM["DOORDASH_TAKE_AWAY"] = "DOORDASH_TAKE-AWAY";
|
|
58
65
|
PLATFORMS_ENUM["DOORDASH_DELIVERY"] = "DOORDASH_DELIVERY";
|
|
@@ -65,9 +72,6 @@ var PLATFORMS_ENUM;
|
|
|
65
72
|
// GFO
|
|
66
73
|
PLATFORMS_ENUM["GFO_TAKE_AWAY"] = "GFO_TAKE-AWAY";
|
|
67
74
|
PLATFORMS_ENUM["GFO_DELIVERY"] = "GFO_DELIVERY";
|
|
68
|
-
// FOODPANDA
|
|
69
|
-
PLATFORMS_ENUM["FOODPANDA_TAKE_AWAY"] = "FOODPANDA_TAKE-AWAY";
|
|
70
|
-
PLATFORMS_ENUM["FOODPANDA_DELIVERY"] = "FOODPANDA_DELIVERY";
|
|
71
75
|
// TALABAT
|
|
72
76
|
PLATFORMS_ENUM["TALABAT_TAKE_AWAY"] = "TALABAT_TAKE-AWAY";
|
|
73
77
|
PLATFORMS_ENUM["TALABAT_DELIVERY"] = "TALABAT_DELIVERY";
|
|
@@ -101,11 +105,12 @@ exports.PLATFORMS_BY_ORDER_TYPE = {
|
|
|
101
105
|
PLATFORMS_ENUM.POS_TAKE_AWAY,
|
|
102
106
|
PLATFORMS_ENUM.WEB_TAKE_AWAY,
|
|
103
107
|
PLATFORMS_ENUM.APP_TAKE_AWAY,
|
|
108
|
+
PLATFORMS_ENUM.FOODPANDA_TAKE_AWAY,
|
|
109
|
+
PLATFORMS_ENUM.FOODPAPA_TAKE_AWAY,
|
|
104
110
|
PLATFORMS_ENUM.GFO_TAKE_AWAY,
|
|
105
111
|
PLATFORMS_ENUM.DOORDASH_TAKE_AWAY,
|
|
106
112
|
PLATFORMS_ENUM.MENU_LOG_TAKE_AWAY,
|
|
107
113
|
PLATFORMS_ENUM.UBER_EATS_TAKE_AWAY,
|
|
108
|
-
PLATFORMS_ENUM.FOODPANDA_TAKE_AWAY,
|
|
109
114
|
PLATFORMS_ENUM.TALABAT_TAKE_AWAY,
|
|
110
115
|
PLATFORMS_ENUM.NOON_TAKE_AWAY,
|
|
111
116
|
PLATFORMS_ENUM.SMILES_TAKE_AWAY,
|
|
@@ -119,11 +124,12 @@ exports.PLATFORMS_BY_ORDER_TYPE = {
|
|
|
119
124
|
PLATFORMS_ENUM.POS_DELIVERY,
|
|
120
125
|
PLATFORMS_ENUM.WEB_DELIVERY,
|
|
121
126
|
PLATFORMS_ENUM.APP_DELIVERY,
|
|
127
|
+
PLATFORMS_ENUM.FOODPANDA_DELIVERY,
|
|
128
|
+
PLATFORMS_ENUM.FOODPAPA_DELIVERY,
|
|
122
129
|
PLATFORMS_ENUM.GFO_DELIVERY,
|
|
123
130
|
PLATFORMS_ENUM.DOORDASH_DELIVERY,
|
|
124
131
|
PLATFORMS_ENUM.MENU_LOG_DELIVERY,
|
|
125
132
|
PLATFORMS_ENUM.UBER_EATS_DELIVERY,
|
|
126
|
-
PLATFORMS_ENUM.FOODPANDA_DELIVERY,
|
|
127
133
|
PLATFORMS_ENUM.TALABAT_DELIVERY,
|
|
128
134
|
PLATFORMS_ENUM.NOON_DELIVERY,
|
|
129
135
|
PLATFORMS_ENUM.SMILES_DELIVERY,
|
|
@@ -149,11 +155,12 @@ exports.PLATFORMS_BY_ORDER_FROM = {
|
|
|
149
155
|
PLATFORMS_ENUM.POS_DRIVE_THRU,
|
|
150
156
|
PLATFORMS_ENUM.POS_KIOSK,
|
|
151
157
|
],
|
|
158
|
+
[ORDER_FROM_ENUM.FOODPANDA]: [PLATFORMS_ENUM.FOODPANDA_TAKE_AWAY, PLATFORMS_ENUM.FOODPANDA_DELIVERY],
|
|
159
|
+
[ORDER_FROM_ENUM.FOODPAPA]: [PLATFORMS_ENUM.FOODPAPA_TAKE_AWAY, PLATFORMS_ENUM.FOODPAPA_DELIVERY],
|
|
152
160
|
[ORDER_FROM_ENUM.DOORDASH]: [PLATFORMS_ENUM.DOORDASH_TAKE_AWAY, PLATFORMS_ENUM.DOORDASH_DELIVERY],
|
|
153
161
|
[ORDER_FROM_ENUM.UBER_EATS]: [PLATFORMS_ENUM.UBER_EATS_TAKE_AWAY, PLATFORMS_ENUM.UBER_EATS_DELIVERY],
|
|
154
162
|
[ORDER_FROM_ENUM.MENU_LOG]: [PLATFORMS_ENUM.MENU_LOG_TAKE_AWAY, PLATFORMS_ENUM.MENU_LOG_DELIVERY],
|
|
155
163
|
[ORDER_FROM_ENUM.GFO]: [PLATFORMS_ENUM.GFO_TAKE_AWAY, PLATFORMS_ENUM.GFO_DELIVERY],
|
|
156
|
-
[ORDER_FROM_ENUM.FOODPANDA]: [PLATFORMS_ENUM.FOODPANDA_TAKE_AWAY, PLATFORMS_ENUM.FOODPANDA_DELIVERY],
|
|
157
164
|
[ORDER_FROM_ENUM.TALABAT]: [PLATFORMS_ENUM.TALABAT_TAKE_AWAY, PLATFORMS_ENUM.TALABAT_DELIVERY],
|
|
158
165
|
[ORDER_FROM_ENUM.NOON]: [PLATFORMS_ENUM.NOON_TAKE_AWAY, PLATFORMS_ENUM.NOON_DELIVERY],
|
|
159
166
|
[ORDER_FROM_ENUM.SMILES]: [PLATFORMS_ENUM.SMILES_TAKE_AWAY, PLATFORMS_ENUM.SMILES_DELIVERY],
|
|
@@ -165,18 +172,22 @@ exports.PLATFORMS_BY_ORDER_FROM = {
|
|
|
165
172
|
};
|
|
166
173
|
/* ===========================><========================= */
|
|
167
174
|
exports.PLATFORM_NAMES = {
|
|
168
|
-
[PLATFORMS_ENUM.WEB_TAKE_AWAY]: 'Web Take-away',
|
|
169
|
-
[PLATFORMS_ENUM.WEB_DELIVERY]: 'Web Delivery',
|
|
170
|
-
[PLATFORMS_ENUM.WEB_DINE_IN]: 'Web Dine-in',
|
|
171
|
-
[PLATFORMS_ENUM.APP_TAKE_AWAY]: 'App Take-away',
|
|
172
|
-
[PLATFORMS_ENUM.APP_DELIVERY]: 'App Delivery',
|
|
173
|
-
[PLATFORMS_ENUM.APP_DINE_IN]: 'App Dine-in',
|
|
174
175
|
[PLATFORMS_ENUM.POS_WALK_IN]: 'Pos Walk-in',
|
|
175
176
|
[PLATFORMS_ENUM.POS_TAKE_AWAY]: 'Pos Take-away',
|
|
176
177
|
[PLATFORMS_ENUM.POS_DELIVERY]: 'Pos Delivery',
|
|
177
178
|
[PLATFORMS_ENUM.POS_DINE_IN]: 'Pos Dine-in',
|
|
178
179
|
[PLATFORMS_ENUM.POS_DRIVE_THRU]: 'Pos Drive-thru',
|
|
179
180
|
[PLATFORMS_ENUM.POS_KIOSK]: 'Pos Kiosk',
|
|
181
|
+
[PLATFORMS_ENUM.WEB_TAKE_AWAY]: 'Web Take-away',
|
|
182
|
+
[PLATFORMS_ENUM.WEB_DELIVERY]: 'Web Delivery',
|
|
183
|
+
[PLATFORMS_ENUM.WEB_DINE_IN]: 'Web Dine-in',
|
|
184
|
+
[PLATFORMS_ENUM.APP_TAKE_AWAY]: 'App Take-away',
|
|
185
|
+
[PLATFORMS_ENUM.APP_DELIVERY]: 'App Delivery',
|
|
186
|
+
[PLATFORMS_ENUM.APP_DINE_IN]: 'App Dine-in',
|
|
187
|
+
[PLATFORMS_ENUM.FOODPANDA_TAKE_AWAY]: 'Foodpanda Take-away',
|
|
188
|
+
[PLATFORMS_ENUM.FOODPANDA_DELIVERY]: 'Foodpanda Delivery',
|
|
189
|
+
[PLATFORMS_ENUM.FOODPAPA_TAKE_AWAY]: 'Food-Papa Take-away',
|
|
190
|
+
[PLATFORMS_ENUM.FOODPAPA_DELIVERY]: 'Food-Papa Delivery',
|
|
180
191
|
[PLATFORMS_ENUM.DOORDASH_TAKE_AWAY]: 'Doordash Take-away',
|
|
181
192
|
[PLATFORMS_ENUM.DOORDASH_DELIVERY]: 'Doordash Delivery',
|
|
182
193
|
[PLATFORMS_ENUM.UBER_EATS_TAKE_AWAY]: 'Uber-Eats Take-away',
|
|
@@ -185,8 +196,6 @@ exports.PLATFORM_NAMES = {
|
|
|
185
196
|
[PLATFORMS_ENUM.MENU_LOG_DELIVERY]: 'Menulog Delivery',
|
|
186
197
|
[PLATFORMS_ENUM.GFO_TAKE_AWAY]: 'GFO Take-away',
|
|
187
198
|
[PLATFORMS_ENUM.GFO_DELIVERY]: 'GFO Delivery',
|
|
188
|
-
[PLATFORMS_ENUM.FOODPANDA_TAKE_AWAY]: 'Foodpanda Take-away',
|
|
189
|
-
[PLATFORMS_ENUM.FOODPANDA_DELIVERY]: 'Foodpanda Delivery',
|
|
190
199
|
[PLATFORMS_ENUM.TALABAT_TAKE_AWAY]: 'Talabat Take-away',
|
|
191
200
|
[PLATFORMS_ENUM.TALABAT_DELIVERY]: 'Talabat Delivery',
|
|
192
201
|
[PLATFORMS_ENUM.NOON_TAKE_AWAY]: 'Noon Take-away',
|
|
@@ -617,8 +626,12 @@ var USER_PERMISSIONS_ENUM;
|
|
|
617
626
|
USER_PERMISSIONS_ENUM["ADMIN_VIEW_MENU"] = "ADMIN_VIEW_MENU";
|
|
618
627
|
USER_PERMISSIONS_ENUM["ADMIN_VIEW_ORDERS"] = "ADMIN_VIEW_ORDERS";
|
|
619
628
|
USER_PERMISSIONS_ENUM["ADMIN_VIEW_INVENTORY"] = "ADMIN_VIEW_INVENTORY";
|
|
629
|
+
USER_PERMISSIONS_ENUM["ADMIN_VIEW_COSTING"] = "ADMIN_VIEW_COSTING";
|
|
620
630
|
USER_PERMISSIONS_ENUM["ADMIN_VIEW_EXPENSES"] = "ADMIN_VIEW_EXPENSES";
|
|
621
631
|
USER_PERMISSIONS_ENUM["ADMIN_VIEW_REPORTS"] = "ADMIN_VIEW_REPORTS";
|
|
632
|
+
USER_PERMISSIONS_ENUM["ADMIN_VIEW_PRODUCT_REPORTS"] = "ADMIN_VIEW_PRODUCT_REPORTS";
|
|
633
|
+
USER_PERMISSIONS_ENUM["ADMIN_VIEW_REVENUE_REPORTS"] = "ADMIN_VIEW_REVENUE_REPORTS";
|
|
634
|
+
USER_PERMISSIONS_ENUM["ADMIN_VIEW_PRODUCT_REPORTS_REVENUE"] = "ADMIN_VIEW_PRODUCT_REPORTS_REVENUE";
|
|
622
635
|
USER_PERMISSIONS_ENUM["ADMIN_VIEW_CUSTOMERS"] = "ADMIN_VIEW_CUSTOMERS";
|
|
623
636
|
USER_PERMISSIONS_ENUM["ADMIN_VIEW_OFFERS"] = "ADMIN_VIEW_OFFERS";
|
|
624
637
|
USER_PERMISSIONS_ENUM["ADMIN_VIEW_MARKETING"] = "ADMIN_VIEW_MARKETING";
|
|
@@ -664,6 +677,7 @@ var USER_PERMISSIONS_ENUM;
|
|
|
664
677
|
USER_PERMISSIONS_ENUM["POS_CREATE_PRINT_UNPAID_RECEIPT"] = "POS_CREATE_PRINT_UNPAID_RECEIPT";
|
|
665
678
|
USER_PERMISSIONS_ENUM["POS_CREATE_APPLY_REPORTS_FILTER"] = "POS_CREATE_APPLY_REPORTS_FILTER";
|
|
666
679
|
USER_PERMISSIONS_ENUM["POS_CREATE_PRINT_DUPLICATE_DOCKET"] = "POS_CREATE_PRINT_DUPLICATE_DOCKET";
|
|
680
|
+
USER_PERMISSIONS_ENUM["POS_CREATE_COMPLIMENTARY_BILL"] = "POS_CREATE_COMPLIMENTARY_BILL";
|
|
667
681
|
/* =================>UPDATE OPERATIONS<================= */
|
|
668
682
|
// For Admin Console
|
|
669
683
|
USER_PERMISSIONS_ENUM["ADMIN_UPDATE_MENU"] = "ADMIN_UPDATE_MENU";
|
|
@@ -1218,6 +1232,14 @@ var DELIVERY_AREAS_SEARCH_TYPE_ENUM;
|
|
|
1218
1232
|
})(DELIVERY_AREAS_SEARCH_TYPE_ENUM || (exports.DELIVERY_AREAS_SEARCH_TYPE_ENUM = DELIVERY_AREAS_SEARCH_TYPE_ENUM = {}));
|
|
1219
1233
|
exports.ALL_DELIVERY_AREAS_SEARCH_TYPES = Object.values(DELIVERY_AREAS_SEARCH_TYPE_ENUM);
|
|
1220
1234
|
// ======================>> <<====================== //
|
|
1235
|
+
var RIDER_FEE_TYPE_ENUM;
|
|
1236
|
+
(function (RIDER_FEE_TYPE_ENUM) {
|
|
1237
|
+
RIDER_FEE_TYPE_ENUM["DELIVERY_CHARGES_FULL"] = "DELIVERY_CHARGES_FULL";
|
|
1238
|
+
RIDER_FEE_TYPE_ENUM["DISTANCE_ONE_WAY"] = "DISTANCE_ONE_WAY";
|
|
1239
|
+
RIDER_FEE_TYPE_ENUM["DISTANCE_RETURN"] = "DISTANCE_RETURN";
|
|
1240
|
+
})(RIDER_FEE_TYPE_ENUM || (exports.RIDER_FEE_TYPE_ENUM = RIDER_FEE_TYPE_ENUM = {}));
|
|
1241
|
+
exports.ALL_RIDER_FEE_TYPES = Object.values(RIDER_FEE_TYPE_ENUM);
|
|
1242
|
+
// ======================>> <<====================== //
|
|
1221
1243
|
var SPLIT_BILL_TYPE_ENUM;
|
|
1222
1244
|
(function (SPLIT_BILL_TYPE_ENUM) {
|
|
1223
1245
|
SPLIT_BILL_TYPE_ENUM["EQUAL"] = "EQUAL";
|
|
@@ -86,7 +86,7 @@ function generateOrderOnCreate(order, withIterations) {
|
|
|
86
86
|
}
|
|
87
87
|
: {}),
|
|
88
88
|
...(order.categories != null ? { categories: generateOrderCategories(order.categories) } : {}),
|
|
89
|
-
order_taker_details: order.
|
|
89
|
+
order_taker_details: order.order_taker_details ?? order.staff_details,
|
|
90
90
|
_id: new mongoose_1.default.Types.ObjectId(order._id),
|
|
91
91
|
iterations: withIterations ? getOrderIterations(order.iterations) : [],
|
|
92
92
|
};
|
|
@@ -205,6 +205,16 @@ function generateOrderOnCreate(order, withIterations) {
|
|
|
205
205
|
if (!newOrder.tax_invoice_provider_charges) {
|
|
206
206
|
delete newOrder.tax_invoice_provider_charges;
|
|
207
207
|
}
|
|
208
|
+
if (!newOrder.packaging_fee) {
|
|
209
|
+
delete newOrder.packaging_fee;
|
|
210
|
+
}
|
|
211
|
+
if (!newOrder.adjustment_amount) {
|
|
212
|
+
delete newOrder.adjustment_amount;
|
|
213
|
+
delete newOrder.adjustment_reason;
|
|
214
|
+
}
|
|
215
|
+
else if (!newOrder.adjustment_reason) {
|
|
216
|
+
delete newOrder.adjustment_reason;
|
|
217
|
+
}
|
|
208
218
|
if (newOrder.payments?.some((payment) => payment.payment_type === constants_1.PAYMENT_TYPE_ENUM.PAY_LATER && payment.payment_status === constants_1.PAYMENT_STATUS_ENUM.PENDING)) {
|
|
209
219
|
newOrder.deferred_settlement = true;
|
|
210
220
|
}
|
|
@@ -388,6 +398,20 @@ function generateOrderOnUpdate(partialUpdatedOrder) {
|
|
|
388
398
|
delete set.tax_invoice_provider_charges;
|
|
389
399
|
unset['tax_invoice_provider_charges'] = '';
|
|
390
400
|
}
|
|
401
|
+
if (set.packaging_fee === 0) {
|
|
402
|
+
delete set.packaging_fee;
|
|
403
|
+
unset['packaging_fee'] = '';
|
|
404
|
+
}
|
|
405
|
+
if (set.adjustment_amount == null || set.adjustment_amount === 0) {
|
|
406
|
+
delete set.adjustment_amount;
|
|
407
|
+
delete set.adjustment_reason;
|
|
408
|
+
unset['adjustment_amount'] = '';
|
|
409
|
+
unset['adjustment_reason'] = '';
|
|
410
|
+
}
|
|
411
|
+
else if (set.adjustment_reason === null) {
|
|
412
|
+
delete set.adjustment_reason;
|
|
413
|
+
unset['adjustment_reason'] = '';
|
|
414
|
+
}
|
|
391
415
|
if (set.payments != null) {
|
|
392
416
|
if (set.payments.some((payment) => payment.payment_type === constants_1.PAYMENT_TYPE_ENUM.PAY_LATER &&
|
|
393
417
|
payment.payment_status === constants_1.PAYMENT_STATUS_ENUM.PENDING)) {
|
|
@@ -74,7 +74,6 @@ export declare function getChangeCourseStatusData(data: Partial<IOrder>, course_
|
|
|
74
74
|
num_of_guests: number;
|
|
75
75
|
start_time: Date;
|
|
76
76
|
reservation_time: Date;
|
|
77
|
-
order_taker_details?: import("../../schemas").IStaffDetails | null;
|
|
78
77
|
prep_minutes?: number | null;
|
|
79
78
|
} | null;
|
|
80
79
|
_id?: string | undefined;
|
|
@@ -131,6 +130,9 @@ export declare function getChangeCourseStatusData(data: Partial<IOrder>, course_
|
|
|
131
130
|
service_fee_amount?: number | undefined;
|
|
132
131
|
gst?: number | undefined;
|
|
133
132
|
gst_amount?: number | undefined;
|
|
133
|
+
packaging_fee?: number | undefined;
|
|
134
|
+
adjustment_amount?: number | null | undefined;
|
|
135
|
+
adjustment_reason?: string | null | undefined;
|
|
134
136
|
tax_invoice_provider_charges?: number | undefined;
|
|
135
137
|
};
|
|
136
138
|
export interface IGetCartItemsObjPayload {
|
|
@@ -455,6 +455,10 @@ function calculateCartOrderInfoAndSyncData(data, courses, listnerSettings, calcu
|
|
|
455
455
|
delivery_cost = data.delivery_details.delivery_cost;
|
|
456
456
|
}
|
|
457
457
|
grand_total += delivery_cost;
|
|
458
|
+
// Add packaging fee to grand_total
|
|
459
|
+
grand_total += data.packaging_fee ?? 0;
|
|
460
|
+
// Add adjustment amount (can be positive or negative)
|
|
461
|
+
grand_total += data.adjustment_amount ?? 0;
|
|
458
462
|
// TODO: We are not using tax_amount for now
|
|
459
463
|
const tax_amount = 0;
|
|
460
464
|
// Add tax amount to orderSubtotal
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PLATFORMS_ENUM } from '../../constants';
|
|
2
2
|
import { ICardDetails, IDiscountDetails, IOrder, IOrderCategory, IOrderDeliveryDetails, IOrderItem, IOrderIteration, IOrderModifier, IOrderOption, IOrderPayment } from '../../schemas';
|
|
3
3
|
import { ISplitBill } from '../types';
|
|
4
|
-
export declare function getOrderDeliveryDetailsWithPrice(delivery: IOrderDeliveryDetails | null | undefined, convertToPrice: (price: number) => number): IOrderDeliveryDetails | null;
|
|
4
|
+
export declare function getOrderDeliveryDetailsWithPrice(delivery: IOrderDeliveryDetails | null | undefined, convertToPrice: (price: number) => number, writeable?: boolean): IOrderDeliveryDetails | null;
|
|
5
5
|
export declare function getOrderPaymentsCardDetailsWithPrice(card_details: ICardDetails | null | undefined, convertToPrice: (price: number) => number): ICardDetails | null;
|
|
6
6
|
export declare function getOrderPaymentsWithPrice(payments: IOrderPayment[] | undefined, convertToPrice: (price: number) => number): IOrderPayment[];
|
|
7
7
|
export declare function getOrderItemModifierOptionsWithPrice(options: IOrderOption[] | undefined, convertToPrice: (price: number) => number): IOrderOption[];
|
|
@@ -26,11 +26,13 @@ const constants_1 = require("../../constants");
|
|
|
26
26
|
const utils_1 = require("../utils");
|
|
27
27
|
const cart_actions_1 = require("./cart-actions");
|
|
28
28
|
/* ======================>Order Object<====================== */
|
|
29
|
-
function getOrderDeliveryDetailsWithPrice(delivery, convertToPrice) {
|
|
29
|
+
function getOrderDeliveryDetailsWithPrice(delivery, convertToPrice, writeable) {
|
|
30
30
|
if (!delivery)
|
|
31
31
|
return null;
|
|
32
|
+
const riderRevenue = writeable ? (delivery.rider_revenue ?? delivery.delivery_cost ?? 0) : delivery.rider_revenue;
|
|
32
33
|
return {
|
|
33
34
|
...delivery,
|
|
35
|
+
...(riderRevenue ? { rider_revenue: convertToPrice(riderRevenue) } : {}),
|
|
34
36
|
delivery_cost: convertToPrice(delivery.delivery_cost ?? 0),
|
|
35
37
|
};
|
|
36
38
|
}
|
|
@@ -124,7 +126,7 @@ function getOrderWithPrice(order, toCents) {
|
|
|
124
126
|
: {}),
|
|
125
127
|
...(order.delivery_details != null
|
|
126
128
|
? {
|
|
127
|
-
delivery_details: getOrderDeliveryDetailsWithPrice(order.delivery_details, convertToPrice),
|
|
129
|
+
delivery_details: getOrderDeliveryDetailsWithPrice(order.delivery_details, convertToPrice, toCents),
|
|
128
130
|
}
|
|
129
131
|
: {}),
|
|
130
132
|
...(order.categories != null
|
|
@@ -144,6 +146,8 @@ function getOrderWithPrice(order, toCents) {
|
|
|
144
146
|
...(order.tip_amount != null ? { tip_amount: convertToPrice(order.tip_amount) } : {}),
|
|
145
147
|
...(order.service_fee != null ? { service_fee: convertToPrice(order.service_fee) } : {}),
|
|
146
148
|
...(order.service_fee_amount != null ? { service_fee_amount: convertToPrice(order.service_fee_amount) } : {}),
|
|
149
|
+
...(order.packaging_fee != null ? { packaging_fee: convertToPrice(order.packaging_fee) } : {}),
|
|
150
|
+
...(order.adjustment_amount != null ? { adjustment_amount: convertToPrice(order.adjustment_amount) } : {}),
|
|
147
151
|
...(order.tax_amount != null ? { tax_amount: convertToPrice(order.tax_amount) } : {}),
|
|
148
152
|
...(order.gst != null ? { gst: convertToPrice(order.gst) } : {}),
|
|
149
153
|
...(order.gst_amount != null ? { gst_amount: convertToPrice(order.gst_amount) } : {}),
|
|
@@ -214,7 +218,9 @@ function getCommonOptionalNullFields(order, partial) {
|
|
|
214
218
|
dinein_details: order['dinein_details'] || defaultValue,
|
|
215
219
|
takeaway_details: order['takeaway_details'] || defaultValue,
|
|
216
220
|
staff_details: order['staff_details'] || defaultValue,
|
|
221
|
+
order_taker_details: order['order_taker_details'] || defaultValue,
|
|
217
222
|
order_discount_details: order['order_discount_details'] || defaultValue,
|
|
223
|
+
adjustment_reason: order['adjustment_reason'] || defaultValue,
|
|
218
224
|
};
|
|
219
225
|
}
|
|
220
226
|
function getCommonOptionalNumFields(order, partial) {
|
|
@@ -226,6 +232,8 @@ function getCommonOptionalNumFields(order, partial) {
|
|
|
226
232
|
service_fee_amount: order['service_fee_amount'] || defaultValue,
|
|
227
233
|
gst: order['gst'] || defaultValue,
|
|
228
234
|
gst_amount: order['gst_amount'] || defaultValue,
|
|
235
|
+
packaging_fee: order['packaging_fee'] || defaultValue,
|
|
236
|
+
adjustment_amount: order['adjustment_amount'] || defaultValue,
|
|
229
237
|
tax_invoice_provider_charges: order['tax_invoice_provider_charges'] || defaultValue,
|
|
230
238
|
total_discount_applied: order['total_discount_applied'] || defaultValue,
|
|
231
239
|
};
|
|
@@ -5,6 +5,7 @@ export * from './common';
|
|
|
5
5
|
export * from './crypt';
|
|
6
6
|
export * from './customers-helpers';
|
|
7
7
|
export * from './delivery-area-helpers';
|
|
8
|
+
export * from './delivery-helpers';
|
|
8
9
|
export * from './dinein';
|
|
9
10
|
export * from './discount-helpers';
|
|
10
11
|
export * from './email-helpers';
|
|
@@ -21,6 +21,7 @@ __exportStar(require("./common"), exports);
|
|
|
21
21
|
__exportStar(require("./crypt"), exports);
|
|
22
22
|
__exportStar(require("./customers-helpers"), exports);
|
|
23
23
|
__exportStar(require("./delivery-area-helpers"), exports);
|
|
24
|
+
__exportStar(require("./delivery-helpers"), exports);
|
|
24
25
|
__exportStar(require("./dinein"), exports);
|
|
25
26
|
__exportStar(require("./discount-helpers"), exports);
|
|
26
27
|
__exportStar(require("./email-helpers"), exports);
|
|
@@ -969,13 +969,21 @@ function getLegacyItemReportBody({ categoriesChannel, itemsChannels, modifiersCh
|
|
|
969
969
|
};
|
|
970
970
|
let categorySales = '';
|
|
971
971
|
let modifierSales = '';
|
|
972
|
+
const normalizeModifierName = (name) => {
|
|
973
|
+
const parts = name.split(':');
|
|
974
|
+
return (parts[1] ?? parts[0] ?? '').trim();
|
|
975
|
+
};
|
|
972
976
|
if (categoriesChannel != null && categoriesChannel.length > 0) {
|
|
973
977
|
extrasExist = true;
|
|
974
978
|
categorySales += getExtraSales('Trending Categories', categoriesChannel);
|
|
975
979
|
}
|
|
976
980
|
if (modifiersChannel != null && modifiersChannel.length > 0) {
|
|
977
981
|
extrasExist = true;
|
|
978
|
-
|
|
982
|
+
const modifiersDisplay = modifiersChannel.map((channel) => ({
|
|
983
|
+
...channel,
|
|
984
|
+
name: normalizeModifierName(channel.name),
|
|
985
|
+
}));
|
|
986
|
+
modifierSales += getExtraSales('Trending Modifiers', modifiersDisplay);
|
|
979
987
|
}
|
|
980
988
|
return `
|
|
981
989
|
<div class="cssc-1owvoyj-asbq">
|
|
@@ -2364,6 +2372,10 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2364
2372
|
</div>`;
|
|
2365
2373
|
}
|
|
2366
2374
|
if (modifiersChannel != null && modifiersChannel.length > 0) {
|
|
2375
|
+
const normalizeModifierName = (name) => {
|
|
2376
|
+
const parts = name.split(':');
|
|
2377
|
+
return (parts[1] ?? parts[0] ?? '').trim();
|
|
2378
|
+
};
|
|
2367
2379
|
const getExtraSales = (title, channels) => {
|
|
2368
2380
|
let items = '';
|
|
2369
2381
|
for (const channel of channels) {
|
|
@@ -2394,7 +2406,11 @@ function getNewItemReportBody({ categoriesChannel, itemsChannels, modifiersChann
|
|
|
2394
2406
|
</div>
|
|
2395
2407
|
</div>`;
|
|
2396
2408
|
};
|
|
2397
|
-
|
|
2409
|
+
const modifiersDisplay = modifiersChannel.map((channel) => ({
|
|
2410
|
+
...channel,
|
|
2411
|
+
name: normalizeModifierName(channel.name),
|
|
2412
|
+
}));
|
|
2413
|
+
modifierSales += getExtraSales('Trending Modifiers', modifiersDisplay);
|
|
2398
2414
|
}
|
|
2399
2415
|
return `<div class="cssc-1owvoyj-asbq">
|
|
2400
2416
|
<br />
|
|
@@ -178,7 +178,27 @@ function getReceiptEngineFooterDetails(order, settings) {
|
|
|
178
178
|
right,
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
// 12.
|
|
181
|
+
// 12. Packaging Fee
|
|
182
|
+
if (order.packaging_fee != null && order.packaging_fee !== 0) {
|
|
183
|
+
const right = (0, common_1.localeAmount)(currencySymbol, order.packaging_fee);
|
|
184
|
+
details.push({
|
|
185
|
+
left: 'Packaging Fee',
|
|
186
|
+
right,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
// 13. Adjustment
|
|
190
|
+
if (order.adjustment_amount != null && order.adjustment_amount !== 0) {
|
|
191
|
+
const right = (0, common_1.localeAmount)(currencySymbol, order.adjustment_amount);
|
|
192
|
+
let reason = '';
|
|
193
|
+
if (order.adjustment_reason != null && order.adjustment_reason.length < 20) {
|
|
194
|
+
reason = ` (${order.adjustment_reason})`;
|
|
195
|
+
}
|
|
196
|
+
details.push({
|
|
197
|
+
left: `Adjustment${reason}`,
|
|
198
|
+
right,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
// 14. Tip
|
|
182
202
|
if (order.tip_amount) {
|
|
183
203
|
const right = (0, common_1.localeAmount)(currencySymbol, order.tip_amount);
|
|
184
204
|
details.push({
|
|
@@ -186,7 +206,7 @@ function getReceiptEngineFooterDetails(order, settings) {
|
|
|
186
206
|
right,
|
|
187
207
|
});
|
|
188
208
|
}
|
|
189
|
-
//
|
|
209
|
+
// 15. POS Charges (added last in calculateCartOrderInfoAndSyncData)
|
|
190
210
|
if (order.tax_invoice_provider_charges) {
|
|
191
211
|
const right = (0, common_1.localeAmount)(currencySymbol, order.tax_invoice_provider_charges);
|
|
192
212
|
details.push({
|
|
@@ -194,7 +214,7 @@ function getReceiptEngineFooterDetails(order, settings) {
|
|
|
194
214
|
right,
|
|
195
215
|
});
|
|
196
216
|
}
|
|
197
|
-
//
|
|
217
|
+
// 16. Card Charges (Non Refundable)
|
|
198
218
|
if (cardCharges > 0) {
|
|
199
219
|
const right = (0, common_1.localeAmount)(currencySymbol, cardCharges);
|
|
200
220
|
details.push({
|
|
@@ -719,7 +739,7 @@ function receiptEngine(payload, mappedItems = {}) {
|
|
|
719
739
|
const staff_name = payload.printer_settings.print_staff_name && payload.order.staff_details != null
|
|
720
740
|
? (payload.order.staff_details.staff_name ?? null)
|
|
721
741
|
: null;
|
|
722
|
-
const order_taker_name = payload.order.
|
|
742
|
+
const order_taker_name = payload.order.order_taker_details?.staff_name ?? staff_name;
|
|
723
743
|
const rider_name = payload.order.delivery_details?.rider_details?.staff_name ?? null;
|
|
724
744
|
let payment_status = null;
|
|
725
745
|
// Helper to get expected payment label suffix
|
|
@@ -40,6 +40,11 @@ export interface ISettingsForWeb {
|
|
|
40
40
|
delivery_min_cost_distance_mtrs: ITenant['delivery_min_cost_distance_mtrs'];
|
|
41
41
|
delivery_cost_per_meter: ITenant['delivery_cost_per_meter'];
|
|
42
42
|
delivery_free_over: ITenant['delivery_free_over'];
|
|
43
|
+
min_service_fee_order_value: ITenant['min_service_fee_order_value'];
|
|
44
|
+
packaging_fee: ITenant['packaging_fee'];
|
|
45
|
+
min_packaging_fee_order_value: ITenant['min_packaging_fee_order_value'];
|
|
46
|
+
free_packaging_over: ITenant['free_packaging_over'];
|
|
47
|
+
cash_in_hand_limit: ITenant['cash_in_hand_limit'];
|
|
43
48
|
brand_color: ITenant['brand_color'];
|
|
44
49
|
restaurant_address: ITenant['restaurant_address'];
|
|
45
50
|
public_business_name: ITenant['public_business_name'];
|
|
@@ -138,6 +143,11 @@ export interface ISettingsForPOS {
|
|
|
138
143
|
delivery_min_cost_distance_mtrs: ITenant['delivery_min_cost_distance_mtrs'];
|
|
139
144
|
min_delivery_order_value: ITenant['min_delivery_order_value'];
|
|
140
145
|
delivery_order_value_per_meter: ITenant['delivery_order_value_per_meter'];
|
|
146
|
+
min_service_fee_order_value: ITenant['min_service_fee_order_value'];
|
|
147
|
+
packaging_fee: ITenant['packaging_fee'];
|
|
148
|
+
free_packaging_over: ITenant['free_packaging_over'];
|
|
149
|
+
min_packaging_fee_order_value: ITenant['min_packaging_fee_order_value'];
|
|
150
|
+
cash_in_hand_limit: ITenant['cash_in_hand_limit'];
|
|
141
151
|
delivery_areas_search_type: ITenant['delivery_areas_search_type'];
|
|
142
152
|
static_delivery_cost_multiplier: ITenant['static_delivery_cost_multiplier'];
|
|
143
153
|
delivery_time: ITenant['delivery_time'];
|
|
@@ -249,6 +259,11 @@ export interface ISettingsForCloud {
|
|
|
249
259
|
brand_color: ITenant['brand_color'];
|
|
250
260
|
subscription_expiry: ITenant['subscription_expiry'];
|
|
251
261
|
enabled_review_platforms: ITenant['enabled_review_platforms'];
|
|
262
|
+
rider_revenue_type: ITenant['rider_revenue_type'];
|
|
263
|
+
rider_revenue_per_meter: ITenant['rider_revenue_per_meter'];
|
|
264
|
+
static_rider_revenue_multiplier: ITenant['static_rider_revenue_multiplier'];
|
|
265
|
+
rider_pickup_food_image_mandatory: ITenant['rider_pickup_food_image_mandatory'];
|
|
266
|
+
rider_dropoff_food_image_mandatory: ITenant['rider_dropoff_food_image_mandatory'];
|
|
252
267
|
}
|
|
253
268
|
export declare function getSettingsForCloud(settings: ITenant): ISettingsForCloud;
|
|
254
269
|
export declare function getTenantOnlineOrderingMetadataFromTenant(tenant: ITenant): ITenantOnlineOrderingMetadata;
|