@managesome/eposmatic-toolkit 0.4.99 → 0.4.100

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.
@@ -114,3 +114,17 @@ export const TenantInventoryDepartmentTransactionsSchema = new Schema({
114
114
  minimize: false,
115
115
  });
116
116
  export const TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_NAME = 'tenant_inventory_department_transactions';
117
+ /**
118
+ * Describes the indexes for `tenant_inventory_department_transactions`.
119
+ * - `_id`: unique primary key.
120
+ * - `order_id__tenant_id__department_code`: movement idempotency checks at a
121
+ * department.
122
+ */
123
+ export const TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_INDEXES = {
124
+ _id: { _id: 1 }, // Unique Index
125
+ order_id__tenant_id__department_code: {
126
+ order_id: 1,
127
+ tenant_id: 1,
128
+ department_code: 1,
129
+ }, // movement idempotency checks at a department
130
+ };
@@ -83,3 +83,17 @@ export const TenantInventoryDepartmentUtilitySchema = new Schema({
83
83
  minimize: false,
84
84
  });
85
85
  export const TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_NAME = 'tenant_inventory_department_utilities';
86
+ /**
87
+ * Describes the indexes for `tenant_inventory_department_utilities`.
88
+ * - `_id`: unique primary key.
89
+ * - `tenant_id__department_code__code`: per-tenant/department item lookups by
90
+ * inventory code.
91
+ */
92
+ export const TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_INDEXES = {
93
+ _id: { _id: 1 }, // Unique Index
94
+ tenant_id__department_code__code: {
95
+ tenant_id: 1,
96
+ department_code: 1,
97
+ code: 1,
98
+ }, // per-tenant/department item lookups by inventory code
99
+ };
@@ -495,6 +495,7 @@ export const WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_NAME = 'warehouse_internal_
495
495
  * source containing an item.
496
496
  * - `record_type__destination_id__destination_type__is_deleted__items.item_id`:
497
497
  * movement lookups by record type and destination containing an item.
498
+ * - `ref_id__ref_type__doc_number`: document-number lookups per context.
498
499
  */
499
500
  // TODO: verify the real query shapes for the items.item_id indexes — they currently look unusual.
500
501
  export const WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_INDEXES = {
@@ -530,4 +531,9 @@ export const WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_INDEXES = {
530
531
  is_deleted: 1,
531
532
  'items.item_id': 1,
532
533
  }, // movement lookups by record type and destination containing an item
534
+ ref_id__ref_type__doc_number: {
535
+ ref_id: 1,
536
+ ref_type: 1,
537
+ doc_number: 1,
538
+ }, // document-number lookups per context
533
539
  };
@@ -186,3 +186,18 @@ export const WarehouseInventoryLotSerialNumberSchema = new Schema({
186
186
  minimize: false,
187
187
  });
188
188
  export const WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_NAME = 'inventory_lot_serial_numbers';
189
+ /**
190
+ * Describes the indexes for `inventory_lot_serial_numbers`.
191
+ * - `_id`: unique primary key.
192
+ * - `ref_id__ref_type__doc_type__inventory_code`: balance and expiry lookups
193
+ * for a location and inventory code.
194
+ */
195
+ export const WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_INDEXES = {
196
+ _id: { _id: 1 }, // Unique Index
197
+ ref_id__ref_type__doc_type__inventory_code: {
198
+ ref_id: 1,
199
+ ref_type: 1,
200
+ doc_type: 1,
201
+ inventory_code: 1,
202
+ }, // balance and expiry lookups by location and inventory code
203
+ };
@@ -118,6 +118,7 @@ export const WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_NAME = 'warehouse_inven
118
118
  * transaction lookups by inventory code, newest first.
119
119
  * - `warehouse_id__createdAt`: per-warehouse inventory transaction lookups
120
120
  * newest first.
121
+ * - `order_id__warehouse_id`: movement idempotency checks at a warehouse.
121
122
  */
122
123
  export const WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES = {
123
124
  _id: { _id: 1 }, // Unique Index
@@ -130,4 +131,8 @@ export const WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES = {
130
131
  warehouse_id: 1,
131
132
  createdAt: -1,
132
133
  }, // per-warehouse inventory transaction lookups newest first
134
+ order_id__warehouse_id: {
135
+ order_id: 1,
136
+ warehouse_id: 1,
137
+ }, // movement idempotency checks at a warehouse
133
138
  };
@@ -87,3 +87,19 @@ export declare const TenantInventoryDepartmentTransactionsSchema: Schema<any, im
87
87
  __v: number;
88
88
  }>;
89
89
  export declare const TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_NAME = "tenant_inventory_department_transactions";
90
+ /**
91
+ * Describes the indexes for `tenant_inventory_department_transactions`.
92
+ * - `_id`: unique primary key.
93
+ * - `order_id__tenant_id__department_code`: movement idempotency checks at a
94
+ * department.
95
+ */
96
+ export declare const TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_INDEXES: {
97
+ _id: {
98
+ _id: number;
99
+ };
100
+ order_id__tenant_id__department_code: {
101
+ order_id: number;
102
+ tenant_id: number;
103
+ department_code: number;
104
+ };
105
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_NAME = exports.TenantInventoryDepartmentTransactionsSchema = void 0;
3
+ exports.TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_INDEXES = exports.TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_NAME = exports.TenantInventoryDepartmentTransactionsSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  exports.TenantInventoryDepartmentTransactionsSchema = new mongoose_1.Schema({
@@ -117,3 +117,17 @@ exports.TenantInventoryDepartmentTransactionsSchema = new mongoose_1.Schema({
117
117
  minimize: false,
118
118
  });
119
119
  exports.TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_NAME = 'tenant_inventory_department_transactions';
120
+ /**
121
+ * Describes the indexes for `tenant_inventory_department_transactions`.
122
+ * - `_id`: unique primary key.
123
+ * - `order_id__tenant_id__department_code`: movement idempotency checks at a
124
+ * department.
125
+ */
126
+ exports.TENANT_INVENTORY_DEPARTMENT_TRANSACTIONS_COLLECTION_INDEXES = {
127
+ _id: { _id: 1 }, // Unique Index
128
+ order_id__tenant_id__department_code: {
129
+ order_id: 1,
130
+ tenant_id: 1,
131
+ department_code: 1,
132
+ }, // movement idempotency checks at a department
133
+ };
@@ -106,3 +106,19 @@ export declare const TenantInventoryDepartmentUtilitySchema: Schema<any, import(
106
106
  __v: number;
107
107
  }>;
108
108
  export declare const TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_NAME = "tenant_inventory_department_utilities";
109
+ /**
110
+ * Describes the indexes for `tenant_inventory_department_utilities`.
111
+ * - `_id`: unique primary key.
112
+ * - `tenant_id__department_code__code`: per-tenant/department item lookups by
113
+ * inventory code.
114
+ */
115
+ export declare const TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_INDEXES: {
116
+ _id: {
117
+ _id: number;
118
+ };
119
+ tenant_id__department_code__code: {
120
+ tenant_id: number;
121
+ department_code: number;
122
+ code: number;
123
+ };
124
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_NAME = exports.TenantInventoryDepartmentUtilitySchema = void 0;
3
+ exports.TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_INDEXES = exports.TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_NAME = exports.TenantInventoryDepartmentUtilitySchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  const items_1 = require("./items");
@@ -86,3 +86,17 @@ exports.TenantInventoryDepartmentUtilitySchema = new mongoose_1.Schema({
86
86
  minimize: false,
87
87
  });
88
88
  exports.TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_NAME = 'tenant_inventory_department_utilities';
89
+ /**
90
+ * Describes the indexes for `tenant_inventory_department_utilities`.
91
+ * - `_id`: unique primary key.
92
+ * - `tenant_id__department_code__code`: per-tenant/department item lookups by
93
+ * inventory code.
94
+ */
95
+ exports.TENANT_INVENTORY_DEPARTMENT_UTILITIES_COLLECTION_INDEXES = {
96
+ _id: { _id: 1 }, // Unique Index
97
+ tenant_id__department_code__code: {
98
+ tenant_id: 1,
99
+ department_code: 1,
100
+ code: 1,
101
+ }, // per-tenant/department item lookups by inventory code
102
+ };
@@ -2537,6 +2537,7 @@ export declare const WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_NAME = "warehouse_i
2537
2537
  * source containing an item.
2538
2538
  * - `record_type__destination_id__destination_type__is_deleted__items.item_id`:
2539
2539
  * movement lookups by record type and destination containing an item.
2540
+ * - `ref_id__ref_type__doc_number`: document-number lookups per context.
2540
2541
  */
2541
2542
  export declare const WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_INDEXES: {
2542
2543
  _id: {
@@ -2573,4 +2574,9 @@ export declare const WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_INDEXES: {
2573
2574
  is_deleted: number;
2574
2575
  'items.item_id': number;
2575
2576
  };
2577
+ ref_id__ref_type__doc_number: {
2578
+ ref_id: number;
2579
+ ref_type: number;
2580
+ doc_number: number;
2581
+ };
2576
2582
  };
@@ -498,6 +498,7 @@ exports.WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_NAME = 'warehouse_internal_movem
498
498
  * source containing an item.
499
499
  * - `record_type__destination_id__destination_type__is_deleted__items.item_id`:
500
500
  * movement lookups by record type and destination containing an item.
501
+ * - `ref_id__ref_type__doc_number`: document-number lookups per context.
501
502
  */
502
503
  // TODO: verify the real query shapes for the items.item_id indexes — they currently look unusual.
503
504
  exports.WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_INDEXES = {
@@ -533,4 +534,9 @@ exports.WAREHOUSE_INTERNAL_MOVEMENTS_COLLECTION_INDEXES = {
533
534
  is_deleted: 1,
534
535
  'items.item_id': 1,
535
536
  }, // movement lookups by record type and destination containing an item
537
+ ref_id__ref_type__doc_number: {
538
+ ref_id: 1,
539
+ ref_type: 1,
540
+ doc_number: 1,
541
+ }, // document-number lookups per context
536
542
  };
@@ -151,3 +151,20 @@ export declare const WarehouseInventoryLotSerialNumberSchema: Schema<any, import
151
151
  __v: number;
152
152
  }>;
153
153
  export declare const WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_NAME = "inventory_lot_serial_numbers";
154
+ /**
155
+ * Describes the indexes for `inventory_lot_serial_numbers`.
156
+ * - `_id`: unique primary key.
157
+ * - `ref_id__ref_type__doc_type__inventory_code`: balance and expiry lookups
158
+ * for a location and inventory code.
159
+ */
160
+ export declare const WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_INDEXES: {
161
+ _id: {
162
+ _id: number;
163
+ };
164
+ ref_id__ref_type__doc_type__inventory_code: {
165
+ ref_id: number;
166
+ ref_type: number;
167
+ doc_type: number;
168
+ inventory_code: number;
169
+ };
170
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_NAME = exports.WarehouseInventoryLotSerialNumberSchema = void 0;
3
+ exports.WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_INDEXES = exports.WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_NAME = exports.WarehouseInventoryLotSerialNumberSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const constants_1 = require("../../constants");
6
6
  const WAREHOUSE_TRACKING_MODE_NAMES = [constants_1.WAREHOUSE_TRACKING_MODE_ENUM.LOT, constants_1.WAREHOUSE_TRACKING_MODE_ENUM.SERIAL];
@@ -189,3 +189,18 @@ exports.WarehouseInventoryLotSerialNumberSchema = new mongoose_1.Schema({
189
189
  minimize: false,
190
190
  });
191
191
  exports.WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_NAME = 'inventory_lot_serial_numbers';
192
+ /**
193
+ * Describes the indexes for `inventory_lot_serial_numbers`.
194
+ * - `_id`: unique primary key.
195
+ * - `ref_id__ref_type__doc_type__inventory_code`: balance and expiry lookups
196
+ * for a location and inventory code.
197
+ */
198
+ exports.WAREHOUSE_INVENTORY_LOT_SERIAL_NUMBERS_COLLECTION_INDEXES = {
199
+ _id: { _id: 1 }, // Unique Index
200
+ ref_id__ref_type__doc_type__inventory_code: {
201
+ ref_id: 1,
202
+ ref_type: 1,
203
+ doc_type: 1,
204
+ inventory_code: 1,
205
+ }, // balance and expiry lookups by location and inventory code
206
+ };
@@ -92,6 +92,7 @@ export declare const WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_NAME = "warehou
92
92
  * transaction lookups by inventory code, newest first.
93
93
  * - `warehouse_id__createdAt`: per-warehouse inventory transaction lookups
94
94
  * newest first.
95
+ * - `order_id__warehouse_id`: movement idempotency checks at a warehouse.
95
96
  */
96
97
  export declare const WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES: {
97
98
  _id: {
@@ -106,4 +107,8 @@ export declare const WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES: {
106
107
  warehouse_id: number;
107
108
  createdAt: number;
108
109
  };
110
+ order_id__warehouse_id: {
111
+ order_id: number;
112
+ warehouse_id: number;
113
+ };
109
114
  };
@@ -121,6 +121,7 @@ exports.WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_NAME = 'warehouse_inventory_
121
121
  * transaction lookups by inventory code, newest first.
122
122
  * - `warehouse_id__createdAt`: per-warehouse inventory transaction lookups
123
123
  * newest first.
124
+ * - `order_id__warehouse_id`: movement idempotency checks at a warehouse.
124
125
  */
125
126
  exports.WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES = {
126
127
  _id: { _id: 1 }, // Unique Index
@@ -133,4 +134,8 @@ exports.WAREHOUSE_INVENTORY_TRANSACTIONS_COLLECTION_INDEXES = {
133
134
  warehouse_id: 1,
134
135
  createdAt: -1,
135
136
  }, // per-warehouse inventory transaction lookups newest first
137
+ order_id__warehouse_id: {
138
+ order_id: 1,
139
+ warehouse_id: 1,
140
+ }, // movement idempotency checks at a warehouse
136
141
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.99",
3
+ "version": "0.4.100",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",