@managesome/eposmatic-toolkit 0.4.88 → 0.4.90
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/esm/helpers/order/generate-warehouse-internal-movement.js +3 -0
- package/esm/helpers/store/common-warehouse-internal-movement-actions.js +124 -4
- package/esm/helpers/utils/discount-amounts.js +64 -0
- package/esm/helpers/utils/index.js +2 -0
- package/esm/helpers/utils/internal-movement-items.js +30 -0
- package/esm/helpers/utils/tenant-purchase-order-engine.js +10 -18
- package/esm/helpers/utils/warehouse-purchase-order-engine.js +10 -18
- package/esm/schemas/models/riders.js +15 -0
- package/esm/schemas/models/warehouse_internal_movements.js +54 -0
- package/lib/helpers/order/generate-warehouse-internal-movement.js +3 -0
- package/lib/helpers/store/common-warehouse-internal-movement-actions.d.ts +33 -1
- package/lib/helpers/store/common-warehouse-internal-movement-actions.js +126 -3
- package/lib/helpers/utils/discount-amounts.d.ts +50 -0
- package/lib/helpers/utils/discount-amounts.js +69 -0
- package/lib/helpers/utils/index.d.ts +2 -0
- package/lib/helpers/utils/index.js +2 -0
- package/lib/helpers/utils/internal-movement-items.d.ts +35 -0
- package/lib/helpers/utils/internal-movement-items.js +36 -0
- package/lib/helpers/utils/tenant-purchase-order-engine.js +9 -17
- package/lib/helpers/utils/warehouse-purchase-order-engine.js +9 -17
- package/lib/schemas/models/inventories.d.ts +3 -3
- package/lib/schemas/models/inventory_transactions.d.ts +3 -3
- package/lib/schemas/models/item_transactions.d.ts +3 -3
- package/lib/schemas/models/materialized_tenant_discount_entries.d.ts +3 -3
- package/lib/schemas/models/materialized_tenant_prep_time_entries.d.ts +3 -3
- package/lib/schemas/models/orders.d.ts +120 -120
- package/lib/schemas/models/riders.d.ts +19 -0
- package/lib/schemas/models/riders.js +16 -1
- package/lib/schemas/models/tenant_inventory_department_transactions.d.ts +3 -3
- package/lib/schemas/models/tenant_inventory_department_utilities.d.ts +3 -3
- package/lib/schemas/models/warehouse_internal_movements.d.ts +570 -0
- package/lib/schemas/models/warehouse_internal_movements.js +54 -0
- package/lib/schemas/models/warehouse_inventory_transactions.d.ts +3 -3
- package/lib/schemas/models/warehouse_item_transactions.d.ts +3 -3
- package/lib/schemas/models/warehouse_items.d.ts +3 -3
- package/lib/schemas/types/warehouse_internal_movements.d.ts +17 -1
- package/package.json +1 -1
|
@@ -66,3 +66,22 @@ export declare const RiderSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
66
66
|
__v: number;
|
|
67
67
|
}>;
|
|
68
68
|
export declare const RIDERS_COLLECTION_NAME = "riders";
|
|
69
|
+
/**
|
|
70
|
+
* Describes the indexes for `riders`. Values are Mongo key patterns.
|
|
71
|
+
*
|
|
72
|
+
* - `_id`: unique primary key.
|
|
73
|
+
* - `uid`: rider lookups by Firebase uid — authentication, profile reads and
|
|
74
|
+
* storage authorization all resolve a rider from their uid.
|
|
75
|
+
*
|
|
76
|
+
* The `uid` index already exists in the live collection but was never declared
|
|
77
|
+
* here, so a rebuilt environment would have lost it and every rider lookup
|
|
78
|
+
* would have become a collection scan.
|
|
79
|
+
*/
|
|
80
|
+
export declare const RIDERS_COLLECTION_INDEXES: {
|
|
81
|
+
_id: {
|
|
82
|
+
_id: number;
|
|
83
|
+
};
|
|
84
|
+
uid: {
|
|
85
|
+
uid: number;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RIDERS_COLLECTION_NAME = exports.RiderSchema = void 0;
|
|
3
|
+
exports.RIDERS_COLLECTION_INDEXES = exports.RIDERS_COLLECTION_NAME = exports.RiderSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
exports.RiderSchema = new mongoose_1.Schema({
|
|
6
6
|
_id: {
|
|
@@ -76,3 +76,18 @@ exports.RiderSchema = new mongoose_1.Schema({
|
|
|
76
76
|
minimize: false,
|
|
77
77
|
});
|
|
78
78
|
exports.RIDERS_COLLECTION_NAME = 'riders';
|
|
79
|
+
/**
|
|
80
|
+
* Describes the indexes for `riders`. Values are Mongo key patterns.
|
|
81
|
+
*
|
|
82
|
+
* - `_id`: unique primary key.
|
|
83
|
+
* - `uid`: rider lookups by Firebase uid — authentication, profile reads and
|
|
84
|
+
* storage authorization all resolve a rider from their uid.
|
|
85
|
+
*
|
|
86
|
+
* The `uid` index already exists in the live collection but was never declared
|
|
87
|
+
* here, so a rebuilt environment would have lost it and every rider lookup
|
|
88
|
+
* would have become a collection scan.
|
|
89
|
+
*/
|
|
90
|
+
exports.RIDERS_COLLECTION_INDEXES = {
|
|
91
|
+
_id: { _id: 1 }, // Unique Index
|
|
92
|
+
uid: { uid: 1 }, // rider lookups by uid
|
|
93
|
+
};
|
|
@@ -14,8 +14,8 @@ export declare const TenantInventoryDepartmentTransactionsSchema: Schema<any, im
|
|
|
14
14
|
department_code: string;
|
|
15
15
|
tenant_id: string;
|
|
16
16
|
createdAt_mins: number;
|
|
17
|
-
quantity_left: number;
|
|
18
17
|
unit_price: number;
|
|
18
|
+
quantity_left: number;
|
|
19
19
|
remaining_stock_price: number;
|
|
20
20
|
previous_quantity_left: number;
|
|
21
21
|
previous_unit_price: number;
|
|
@@ -40,8 +40,8 @@ export declare const TenantInventoryDepartmentTransactionsSchema: Schema<any, im
|
|
|
40
40
|
department_code: string;
|
|
41
41
|
tenant_id: string;
|
|
42
42
|
createdAt_mins: number;
|
|
43
|
-
quantity_left: number;
|
|
44
43
|
unit_price: number;
|
|
44
|
+
quantity_left: number;
|
|
45
45
|
remaining_stock_price: number;
|
|
46
46
|
previous_quantity_left: number;
|
|
47
47
|
previous_unit_price: number;
|
|
@@ -66,8 +66,8 @@ export declare const TenantInventoryDepartmentTransactionsSchema: Schema<any, im
|
|
|
66
66
|
department_code: string;
|
|
67
67
|
tenant_id: string;
|
|
68
68
|
createdAt_mins: number;
|
|
69
|
-
quantity_left: number;
|
|
70
69
|
unit_price: number;
|
|
70
|
+
quantity_left: number;
|
|
71
71
|
remaining_stock_price: number;
|
|
72
72
|
previous_quantity_left: number;
|
|
73
73
|
previous_unit_price: number;
|
|
@@ -18,10 +18,10 @@ export declare const TenantInventoryDepartmentUtilitySchema: Schema<any, import(
|
|
|
18
18
|
active: boolean;
|
|
19
19
|
department_code: string;
|
|
20
20
|
tenant_id: string;
|
|
21
|
+
unit_price: number;
|
|
21
22
|
unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
|
|
22
23
|
threshold_quantity: number;
|
|
23
24
|
quantity_left: number;
|
|
24
|
-
unit_price: number;
|
|
25
25
|
remaining_stock_price: number;
|
|
26
26
|
ingredients?: import("mongoose").Types.DocumentArray<{
|
|
27
27
|
inventory_code: string;
|
|
@@ -50,10 +50,10 @@ export declare const TenantInventoryDepartmentUtilitySchema: Schema<any, import(
|
|
|
50
50
|
active: boolean;
|
|
51
51
|
department_code: string;
|
|
52
52
|
tenant_id: string;
|
|
53
|
+
unit_price: number;
|
|
53
54
|
unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
|
|
54
55
|
threshold_quantity: number;
|
|
55
56
|
quantity_left: number;
|
|
56
|
-
unit_price: number;
|
|
57
57
|
remaining_stock_price: number;
|
|
58
58
|
ingredients?: import("mongoose").Types.DocumentArray<{
|
|
59
59
|
inventory_code: string;
|
|
@@ -82,10 +82,10 @@ export declare const TenantInventoryDepartmentUtilitySchema: Schema<any, import(
|
|
|
82
82
|
active: boolean;
|
|
83
83
|
department_code: string;
|
|
84
84
|
tenant_id: string;
|
|
85
|
+
unit_price: number;
|
|
85
86
|
unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
|
|
86
87
|
threshold_quantity: number;
|
|
87
88
|
quantity_left: number;
|
|
88
|
-
unit_price: number;
|
|
89
89
|
remaining_stock_price: number;
|
|
90
90
|
ingredients?: import("mongoose").Types.DocumentArray<{
|
|
91
91
|
inventory_code: string;
|