@managesome/eposmatic-toolkit 0.2.643 → 0.2.646

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.
@@ -305,13 +305,13 @@ exports.PAYMENT_CHARGES_MAP = new Map([
305
305
  [ENUMS_1.TRANSACTION_TYPE_ENUM.LOCAL]: {
306
306
  bank_percentage_charges: 0,
307
307
  bank_fixed_charges: 0,
308
- provider_percentage_charges: 350, // 3.5% PKR
308
+ provider_percentage_charges: 376, // 3.76% PKR
309
309
  provider_fixed_charges: 0, // 10 PKR
310
310
  },
311
311
  [ENUMS_1.TRANSACTION_TYPE_ENUM.INTERNATIONAL]: {
312
312
  bank_percentage_charges: 0,
313
313
  bank_fixed_charges: 0,
314
- provider_percentage_charges: 350, // 3.5% PKR
314
+ provider_percentage_charges: 376, // 3.76% PKR
315
315
  provider_fixed_charges: 0,
316
316
  },
317
317
  },
@@ -42,3 +42,18 @@ export declare const DineInFloorsSchema: Schema<any, import("mongoose").Model<an
42
42
  __v: number;
43
43
  }>;
44
44
  export declare const DINEIN_FLOORS_COLLECTION_NAME = "dinein_floors";
45
+ /**
46
+ * Describes the indexes for `dinein_floors`. Values are Mongo key patterns that
47
+ * can be passed straight to `.hint()`.
48
+ * - `_id`: unique primary key.
49
+ * - `tenant_id__active`: per-tenant floor lookups by active state.
50
+ */
51
+ export declare const DINEIN_FLOORS_COLLECTION_INDEXES: {
52
+ _id: {
53
+ _id: number;
54
+ };
55
+ tenant_id__active: {
56
+ tenant_id: number;
57
+ active: number;
58
+ };
59
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DINEIN_FLOORS_COLLECTION_NAME = exports.DineInFloorsSchema = void 0;
3
+ exports.DINEIN_FLOORS_COLLECTION_INDEXES = exports.DINEIN_FLOORS_COLLECTION_NAME = exports.DineInFloorsSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  exports.DineInFloorsSchema = new mongoose_1.Schema({
6
6
  _id: {
@@ -43,3 +43,16 @@ exports.DineInFloorsSchema = new mongoose_1.Schema({
43
43
  minimize: false,
44
44
  });
45
45
  exports.DINEIN_FLOORS_COLLECTION_NAME = 'dinein_floors';
46
+ /**
47
+ * Describes the indexes for `dinein_floors`. Values are Mongo key patterns that
48
+ * can be passed straight to `.hint()`.
49
+ * - `_id`: unique primary key.
50
+ * - `tenant_id__active`: per-tenant floor lookups by active state.
51
+ */
52
+ exports.DINEIN_FLOORS_COLLECTION_INDEXES = {
53
+ _id: { _id: 1 }, // Unique Index
54
+ tenant_id__active: {
55
+ tenant_id: 1,
56
+ active: 1,
57
+ }, // per-tenant floor lookups by active state
58
+ };
@@ -66,3 +66,23 @@ export declare const DineinTablesSchema: Schema<any, import("mongoose").Model<an
66
66
  __v: number;
67
67
  }>;
68
68
  export declare const DINEIN_TABLES_COLLECTION_NAME = "dinein_tables";
69
+ /**
70
+ * Describes the indexes for `dinein_tables`. Values are Mongo key patterns that
71
+ * can be passed straight to `.hint()`.
72
+ * - `_id`: unique primary key.
73
+ * - `tenant_id__dinein_floor_id`: per-tenant table lookups by dine-in floor.
74
+ * - `tenant_id__order_id`: per-tenant table lookups by order.
75
+ */
76
+ export declare const DINEIN_TABLES_COLLECTION_INDEXES: {
77
+ _id: {
78
+ _id: number;
79
+ };
80
+ tenant_id__dinein_floor_id: {
81
+ tenant_id: number;
82
+ dinein_floor_id: number;
83
+ };
84
+ tenant_id__order_id: {
85
+ tenant_id: number;
86
+ order_id: number;
87
+ };
88
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DINEIN_TABLES_COLLECTION_NAME = exports.DineinTablesSchema = void 0;
3
+ exports.DINEIN_TABLES_COLLECTION_INDEXES = exports.DINEIN_TABLES_COLLECTION_NAME = exports.DineinTablesSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  exports.DineinTablesSchema = new mongoose_1.Schema({
@@ -80,3 +80,21 @@ exports.DineinTablesSchema = new mongoose_1.Schema({
80
80
  minimize: false,
81
81
  });
82
82
  exports.DINEIN_TABLES_COLLECTION_NAME = 'dinein_tables';
83
+ /**
84
+ * Describes the indexes for `dinein_tables`. Values are Mongo key patterns that
85
+ * can be passed straight to `.hint()`.
86
+ * - `_id`: unique primary key.
87
+ * - `tenant_id__dinein_floor_id`: per-tenant table lookups by dine-in floor.
88
+ * - `tenant_id__order_id`: per-tenant table lookups by order.
89
+ */
90
+ exports.DINEIN_TABLES_COLLECTION_INDEXES = {
91
+ _id: { _id: 1 }, // Unique Index
92
+ tenant_id__dinein_floor_id: {
93
+ tenant_id: 1,
94
+ dinein_floor_id: 1,
95
+ }, // per-tenant table lookups by dine-in floor
96
+ tenant_id__order_id: {
97
+ tenant_id: 1,
98
+ order_id: 1,
99
+ }, // per-tenant table lookups by order
100
+ };
@@ -106,3 +106,24 @@ export declare const InventorySchema: Schema<any, import("mongoose").Model<any,
106
106
  __v: number;
107
107
  }>;
108
108
  export declare const INVENTORY_COLLECTION_NAME = "inventories";
109
+ /**
110
+ * Describes the indexes for `inventories`. Values are Mongo key patterns that
111
+ * can be passed straight to `.hint()`.
112
+ * - `_id`: unique primary key.
113
+ * - `tenant_id__category_id`: per-tenant inventory lookups by category.
114
+ * - `tenant_id__code`: UNIQUE per (tenant_id, code) — one inventory per tenant
115
+ * per code.
116
+ */
117
+ export declare const INVENTORY_COLLECTION_INDEXES: {
118
+ _id: {
119
+ _id: number;
120
+ };
121
+ tenant_id__category_id: {
122
+ tenant_id: number;
123
+ category_id: number;
124
+ };
125
+ tenant_id__code: {
126
+ tenant_id: number;
127
+ code: number;
128
+ };
129
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INVENTORY_COLLECTION_NAME = exports.InventorySchema = void 0;
3
+ exports.INVENTORY_COLLECTION_INDEXES = exports.INVENTORY_COLLECTION_NAME = exports.InventorySchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  const items_1 = require("./items");
@@ -85,3 +85,22 @@ exports.InventorySchema = new mongoose_1.Schema({
85
85
  minimize: false,
86
86
  });
87
87
  exports.INVENTORY_COLLECTION_NAME = 'inventories';
88
+ /**
89
+ * Describes the indexes for `inventories`. Values are Mongo key patterns that
90
+ * can be passed straight to `.hint()`.
91
+ * - `_id`: unique primary key.
92
+ * - `tenant_id__category_id`: per-tenant inventory lookups by category.
93
+ * - `tenant_id__code`: UNIQUE per (tenant_id, code) — one inventory per tenant
94
+ * per code.
95
+ */
96
+ exports.INVENTORY_COLLECTION_INDEXES = {
97
+ _id: { _id: 1 }, // Unique Index
98
+ tenant_id__category_id: {
99
+ tenant_id: 1,
100
+ category_id: 1,
101
+ }, // per-tenant inventory lookups by category
102
+ tenant_id__code: {
103
+ tenant_id: 1,
104
+ code: 1,
105
+ }, // UNIQUE per (tenant_id, code) — one inventory per tenant per code
106
+ };
@@ -91,8 +91,6 @@ export declare const INVENTORY_TRANSACTIONS_COLLECTION_NAME = "inventory_transac
91
91
  * Describes the indexes for `inventory_transactions`. Values are Mongo key
92
92
  * patterns that can be passed straight to `.hint()`.
93
93
  * - `_id`: unique primary key.
94
- * - `order_id__tenant_id`: inventory-transaction lookups by order, scoped by
95
- * tenant.
96
94
  * - `tenant_id__inventory_code__createdAt`: per-tenant inventory transaction
97
95
  * lookups by inventory code, newest first.
98
96
  * - `tenant_id__createdAt`: per-tenant inventory transaction lookups newest
@@ -104,15 +102,6 @@ export declare const INVENTORY_TRANSACTIONS_COLLECTION_INDEXES: {
104
102
  _id: {
105
103
  _id: number;
106
104
  };
107
- order_id__tenant_id: {
108
- order_id: number;
109
- tenant_id: number;
110
- };
111
- tenant_id__order_id__ref_id: {
112
- tenant_id: number;
113
- order_id: number;
114
- ref_id: number;
115
- };
116
105
  tenant_id__inventory_code__createdAt: {
117
106
  tenant_id: number;
118
107
  inventory_code: number;
@@ -122,4 +111,9 @@ export declare const INVENTORY_TRANSACTIONS_COLLECTION_INDEXES: {
122
111
  tenant_id: number;
123
112
  createdAt: number;
124
113
  };
114
+ tenant_id__order_id__ref_id: {
115
+ tenant_id: number;
116
+ order_id: number;
117
+ ref_id: number;
118
+ };
125
119
  };
@@ -120,8 +120,6 @@ exports.INVENTORY_TRANSACTIONS_COLLECTION_NAME = 'inventory_transactions';
120
120
  * Describes the indexes for `inventory_transactions`. Values are Mongo key
121
121
  * patterns that can be passed straight to `.hint()`.
122
122
  * - `_id`: unique primary key.
123
- * - `order_id__tenant_id`: inventory-transaction lookups by order, scoped by
124
- * tenant.
125
123
  * - `tenant_id__inventory_code__createdAt`: per-tenant inventory transaction
126
124
  * lookups by inventory code, newest first.
127
125
  * - `tenant_id__createdAt`: per-tenant inventory transaction lookups newest
@@ -131,15 +129,6 @@ exports.INVENTORY_TRANSACTIONS_COLLECTION_NAME = 'inventory_transactions';
131
129
  */
132
130
  exports.INVENTORY_TRANSACTIONS_COLLECTION_INDEXES = {
133
131
  _id: { _id: 1 }, // Unique Index
134
- order_id__tenant_id: {
135
- order_id: 1,
136
- tenant_id: 1,
137
- }, // inventory-transaction lookups by order, scoped by tenant
138
- tenant_id__order_id__ref_id: {
139
- tenant_id: 1,
140
- order_id: 1,
141
- ref_id: 1,
142
- }, // UNIQUE per (tenant_id, order_id, ref_id) — one transaction per order ref
143
132
  tenant_id__inventory_code__createdAt: {
144
133
  tenant_id: 1,
145
134
  inventory_code: 1,
@@ -149,4 +138,9 @@ exports.INVENTORY_TRANSACTIONS_COLLECTION_INDEXES = {
149
138
  tenant_id: 1,
150
139
  createdAt: -1,
151
140
  }, // per-tenant inventory transaction lookups newest first
141
+ tenant_id__order_id__ref_id: {
142
+ tenant_id: 1,
143
+ order_id: 1,
144
+ ref_id: 1,
145
+ }, // UNIQUE per (tenant_id, order_id, ref_id) — one transaction per order ref
152
146
  };
@@ -73,19 +73,15 @@ export declare const ITEM_TRANSACTIONS_COLLECTION_NAME = "item_transactions";
73
73
  * Describes the indexes for `item_transactions`. Values are Mongo key patterns
74
74
  * that can be passed straight to `.hint()`.
75
75
  * - `_id`: unique primary key.
76
- * - `order_id__tenant_id`: item-transaction lookups by order, scoped by tenant.
77
76
  * - `tenant_id__item_id__createdAt`: per-tenant item transaction lookups by
78
77
  * item, newest first.
79
78
  * - `tenant_id__createdAt`: per-tenant item transaction lookups newest first.
79
+ * - `tenant_id__order_id`: per-tenant item transaction lookups by order.
80
80
  */
81
81
  export declare const ITEM_TRANSACTIONS_COLLECTION_INDEXES: {
82
82
  _id: {
83
83
  _id: number;
84
84
  };
85
- order_id__tenant_id: {
86
- order_id: number;
87
- tenant_id: number;
88
- };
89
85
  tenant_id__item_id__createdAt: {
90
86
  tenant_id: number;
91
87
  item_id: number;
@@ -95,4 +91,8 @@ export declare const ITEM_TRANSACTIONS_COLLECTION_INDEXES: {
95
91
  tenant_id: number;
96
92
  createdAt: number;
97
93
  };
94
+ tenant_id__order_id: {
95
+ tenant_id: number;
96
+ order_id: number;
97
+ };
98
98
  };
@@ -97,17 +97,13 @@ exports.ITEM_TRANSACTIONS_COLLECTION_NAME = 'item_transactions';
97
97
  * Describes the indexes for `item_transactions`. Values are Mongo key patterns
98
98
  * that can be passed straight to `.hint()`.
99
99
  * - `_id`: unique primary key.
100
- * - `order_id__tenant_id`: item-transaction lookups by order, scoped by tenant.
101
100
  * - `tenant_id__item_id__createdAt`: per-tenant item transaction lookups by
102
101
  * item, newest first.
103
102
  * - `tenant_id__createdAt`: per-tenant item transaction lookups newest first.
103
+ * - `tenant_id__order_id`: per-tenant item transaction lookups by order.
104
104
  */
105
105
  exports.ITEM_TRANSACTIONS_COLLECTION_INDEXES = {
106
106
  _id: { _id: 1 }, // Unique Index
107
- order_id__tenant_id: {
108
- order_id: 1,
109
- tenant_id: 1,
110
- }, // item-transaction lookups by order, scoped by tenant
111
107
  tenant_id__item_id__createdAt: {
112
108
  tenant_id: 1,
113
109
  item_id: 1,
@@ -117,4 +113,8 @@ exports.ITEM_TRANSACTIONS_COLLECTION_INDEXES = {
117
113
  tenant_id: 1,
118
114
  createdAt: -1,
119
115
  }, // per-tenant item transaction lookups newest first
116
+ tenant_id__order_id: {
117
+ tenant_id: 1,
118
+ order_id: 1,
119
+ }, // per-tenant item transaction lookups by order
120
120
  };
@@ -81,3 +81,26 @@ export declare const WarehouseInventoryTransactionsSchema: Schema<any, import("m
81
81
  __v: number;
82
82
  }>;
83
83
  export declare const WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_NAME = "warehouse_inventory_transactions";
84
+ /**
85
+ * Describes the indexes for `warehouse_inventory_transactions`. Values are Mongo
86
+ * key patterns that can be passed straight to `.hint()`.
87
+ * - `_id`: unique primary key.
88
+ * - `warehouse_id__inventory_code__createdAt`: per-warehouse inventory
89
+ * transaction lookups by inventory code, newest first.
90
+ * - `warehouse_id__createdAt`: per-warehouse inventory transaction lookups
91
+ * newest first.
92
+ */
93
+ export declare const WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES: {
94
+ _id: {
95
+ _id: number;
96
+ };
97
+ warehouse_id__inventory_code__createdAt: {
98
+ warehouse_id: number;
99
+ inventory_code: number;
100
+ createdAt: number;
101
+ };
102
+ warehouse_id__createdAt: {
103
+ warehouse_id: number;
104
+ createdAt: number;
105
+ };
106
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_NAME = exports.WarehouseInventoryTransactionsSchema = void 0;
3
+ exports.WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES = exports.WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_NAME = exports.WarehouseInventoryTransactionsSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  exports.WarehouseInventoryTransactionsSchema = new mongoose_1.Schema({
@@ -108,3 +108,24 @@ exports.WarehouseInventoryTransactionsSchema = new mongoose_1.Schema({
108
108
  minimize: false,
109
109
  });
110
110
  exports.WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_NAME = 'warehouse_inventory_transactions';
111
+ /**
112
+ * Describes the indexes for `warehouse_inventory_transactions`. Values are Mongo
113
+ * key patterns that can be passed straight to `.hint()`.
114
+ * - `_id`: unique primary key.
115
+ * - `warehouse_id__inventory_code__createdAt`: per-warehouse inventory
116
+ * transaction lookups by inventory code, newest first.
117
+ * - `warehouse_id__createdAt`: per-warehouse inventory transaction lookups
118
+ * newest first.
119
+ */
120
+ exports.WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES = {
121
+ _id: { _id: 1 }, // Unique Index
122
+ warehouse_id__inventory_code__createdAt: {
123
+ warehouse_id: 1,
124
+ inventory_code: 1,
125
+ createdAt: -1,
126
+ }, // per-warehouse inventory transaction lookups by inventory code, newest first
127
+ warehouse_id__createdAt: {
128
+ warehouse_id: 1,
129
+ createdAt: -1,
130
+ }, // per-warehouse inventory transaction lookups newest first
131
+ };
@@ -157,3 +157,24 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
157
157
  __v: number;
158
158
  }>;
159
159
  export declare const WAREHOUSE_ITEMS_COLLECTION_NAME = "warehouse_items";
160
+ /**
161
+ * Describes the indexes for `warehouse_items`. Values are Mongo key patterns
162
+ * that can be passed straight to `.hint()`.
163
+ * - `_id`: unique primary key.
164
+ * - `warehouse_id__category_id`: per-warehouse item lookups by category.
165
+ * - `warehouse_id__inventory_code`: UNIQUE per (warehouse_id, inventory_code)
166
+ * — one item per warehouse per inventory code.
167
+ */
168
+ export declare const WAREHOUSE_ITEMS_COLLECTION_INDEXES: {
169
+ _id: {
170
+ _id: number;
171
+ };
172
+ warehouse_id__category_id: {
173
+ warehouse_id: number;
174
+ category_id: number;
175
+ };
176
+ warehouse_id__inventory_code: {
177
+ warehouse_id: number;
178
+ inventory_code: number;
179
+ };
180
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WAREHOUSE_ITEMS_COLLECTION_NAME = exports.WarehouseItemSchema = void 0;
3
+ exports.WAREHOUSE_ITEMS_COLLECTION_INDEXES = exports.WAREHOUSE_ITEMS_COLLECTION_NAME = exports.WarehouseItemSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  const items_1 = require("./items");
@@ -155,3 +155,22 @@ exports.WarehouseItemSchema = new mongoose_1.Schema({
155
155
  minimize: false,
156
156
  });
157
157
  exports.WAREHOUSE_ITEMS_COLLECTION_NAME = 'warehouse_items';
158
+ /**
159
+ * Describes the indexes for `warehouse_items`. Values are Mongo key patterns
160
+ * that can be passed straight to `.hint()`.
161
+ * - `_id`: unique primary key.
162
+ * - `warehouse_id__category_id`: per-warehouse item lookups by category.
163
+ * - `warehouse_id__inventory_code`: UNIQUE per (warehouse_id, inventory_code)
164
+ * — one item per warehouse per inventory code.
165
+ */
166
+ exports.WAREHOUSE_ITEMS_COLLECTION_INDEXES = {
167
+ _id: { _id: 1 }, // Unique Index
168
+ warehouse_id__category_id: {
169
+ warehouse_id: 1,
170
+ category_id: 1,
171
+ }, // per-warehouse item lookups by category
172
+ warehouse_id__inventory_code: {
173
+ warehouse_id: 1,
174
+ inventory_code: 1,
175
+ }, // UNIQUE per (warehouse_id, inventory_code) — one item per warehouse per inventory code
176
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.643",
3
+ "version": "0.2.646",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",