@managesome/eposmatic-toolkit 0.2.431 → 0.2.432
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/ENUMS.d.ts +0 -289
- package/lib/constants/ENUMS.js +2 -393
- package/lib/constants/PURCHASE_ORDER.d.ts +5 -3
- package/lib/constants/PURCHASE_ORDER.js +58 -20
- package/lib/constants/WAREHOUSE_ANALYTICS.d.ts +41 -41
- package/lib/constants/WAREHOUSE_ANALYTICS.js +28 -28
- package/lib/constants/WAREHOUSE_ENUMS.d.ts +289 -0
- package/lib/constants/WAREHOUSE_ENUMS.js +392 -0
- package/lib/constants/WAREHOUSE_INVOICE.js +10 -10
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +1 -0
- package/lib/helpers/order/generate-purchase-order-rfq.d.ts +3 -3
- package/lib/helpers/order/generate-purchase-order-rfq.js +2 -2
- package/lib/helpers/order/generate-purchase-order.d.ts +8 -8
- package/lib/helpers/order/generate-purchase-order.js +2 -2
- package/lib/helpers/order/generate-warehouse-purchase-order-rfq.d.ts +3 -0
- package/lib/helpers/order/generate-warehouse-purchase-order-rfq.js +64 -0
- package/lib/helpers/order/generate-warehouse-purchase-order.d.ts +11 -0
- package/lib/helpers/order/generate-warehouse-purchase-order.js +196 -0
- package/lib/helpers/order/index.d.ts +2 -2
- package/lib/helpers/order/index.js +2 -2
- package/lib/helpers/store/all-purchase-orders-actions.d.ts +7 -7
- package/lib/helpers/store/all-purchase-orders-actions.js +2 -2
- package/lib/helpers/store/all-sale-orders-actions.d.ts +2 -2
- package/lib/helpers/store/all-warehouse-purchase-orders-actions.d.ts +13 -0
- package/lib/helpers/store/all-warehouse-purchase-orders-actions.js +56 -0
- package/lib/helpers/store/all-warehouse-sale-orders-actions.d.ts +2 -0
- package/lib/helpers/store/all-warehouse-sale-orders-actions.js +8 -0
- package/lib/helpers/store/common-purchase-order-actions.d.ts +15 -15
- package/lib/helpers/store/common-sale-order-actions.d.ts +5 -5
- package/lib/helpers/store/common-warehouse-purchase-order-actions.d.ts +31 -0
- package/lib/helpers/store/common-warehouse-purchase-order-actions.js +545 -0
- package/lib/helpers/store/common-warehouse-sale-order-actions.d.ts +5 -0
- package/lib/helpers/store/common-warehouse-sale-order-actions.js +65 -0
- package/lib/helpers/store/index.d.ts +6 -6
- package/lib/helpers/store/index.js +6 -6
- package/lib/helpers/store/purchase-order-rfq-cart-actions.d.ts +11 -11
- package/lib/helpers/store/purchase-order-rfq-cart-actions.js +3 -3
- package/lib/helpers/store/purchase-orders-cart-actions.d.ts +18 -18
- package/lib/helpers/store/purchase-orders-cart-actions.js +1 -1
- package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.d.ts +19 -0
- package/lib/helpers/store/warehouse-purchase-order-rfq-cart-actions.js +373 -0
- package/lib/helpers/store/warehouse-purchase-orders-cart-actions.d.ts +57 -0
- package/lib/helpers/store/warehouse-purchase-orders-cart-actions.js +486 -0
- package/lib/helpers/types/index.d.ts +1 -1
- package/lib/helpers/types/index.js +1 -1
- package/lib/helpers/types/purchase-order-cart-actions.d.ts +2 -2
- package/lib/helpers/types/warehouse-purchase-order-cart-actions.d.ts +26 -0
- package/lib/helpers/types/warehouse-purchase-order-cart-actions.js +2 -0
- package/lib/helpers/types/workers.d.ts +18 -18
- package/lib/helpers/utils/index.d.ts +8 -8
- package/lib/helpers/utils/index.js +8 -11
- package/lib/helpers/utils/invoice-x-report-helpers.d.ts +2 -2
- package/lib/helpers/utils/invoice-x-report-helpers.js +14 -14
- package/lib/helpers/utils/purchase-order-engine.d.ts +4 -4
- package/lib/helpers/utils/purchase-order-receipt-engine.d.ts +5 -5
- package/lib/helpers/utils/purchase-order-receipt-engine.js +2 -2
- package/lib/helpers/utils/purchase-order-x-report-helpers.js +2 -2
- package/lib/helpers/utils/sale-x-report-helpers.js +2 -2
- package/lib/helpers/utils/void-purchase-order-items-helpers.d.ts +3 -3
- package/lib/helpers/utils/void-purchase-order-items-report-helpers.d.ts +2 -2
- package/lib/helpers/utils/void-warehouse-invoice-items-helpers.d.ts +3 -3
- package/lib/helpers/utils/void-warehouse-invoice-items-helpers.js +2 -2
- package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.d.ts +5 -5
- package/lib/helpers/utils/warehouse-catalog-conversion.d.ts +3 -3
- package/lib/helpers/utils/warehouse-catalog-conversion.js +9 -7
- package/lib/helpers/utils/warehouse-invoice-order-engine.js +1 -1
- package/lib/helpers/utils/warehouse-invoice-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-invoice-x-report-helpers.js +1432 -0
- package/lib/helpers/utils/warehouse-purchase-order-engine.d.ts +9 -0
- package/lib/helpers/utils/warehouse-purchase-order-engine.js +34 -0
- package/lib/helpers/utils/warehouse-purchase-order-receipt-engine.d.ts +149 -0
- package/lib/helpers/utils/warehouse-purchase-order-receipt-engine.js +214 -0
- package/lib/helpers/utils/warehouse-purchase-order-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-purchase-order-x-report-helpers.js +1440 -0
- package/lib/helpers/utils/warehouse-sale-order-x-report-helpers.d.ts +30 -0
- package/lib/helpers/utils/warehouse-sale-order-x-report-helpers.js +2 -0
- package/lib/helpers/utils/warehouse-sale-x-report-helpers.d.ts +58 -0
- package/lib/helpers/utils/warehouse-sale-x-report-helpers.js +1456 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-helpers.d.ts +3 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-helpers.js +38 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-report-helpers.d.ts +13 -0
- package/lib/helpers/utils/warehouse-void-purchase-order-items-report-helpers.js +22 -0
- package/lib/schemas/models/gift_cards.d.ts +108 -108
- package/lib/schemas/models/halfhalf_setup.d.ts +3 -3
- package/lib/schemas/models/index.d.ts +7 -7
- package/lib/schemas/models/index.js +7 -7
- package/lib/schemas/models/internal_invoices.d.ts +6 -6
- package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +6 -6
- package/lib/schemas/models/inventory_transactions.d.ts +3 -3
- package/lib/schemas/models/item_transactions.d.ts +6 -6
- package/lib/schemas/models/offers.d.ts +146 -146
- package/lib/schemas/models/orders.d.ts +2573 -2573
- package/lib/schemas/models/printer_settings.d.ts +12 -12
- package/lib/schemas/models/reservations.d.ts +6 -6
- package/lib/schemas/models/rewards_usage.d.ts +6 -6
- package/lib/schemas/models/riders.d.ts +3 -3
- package/lib/schemas/models/tenants.d.ts +135 -135
- package/lib/schemas/models/void_order_items.d.ts +15 -15
- package/lib/schemas/models/void_warehouse_invoice_items.d.ts +25 -25
- package/lib/schemas/models/void_warehouse_invoice_items.js +2 -2
- package/lib/schemas/models/vouchers.d.ts +9 -9
- package/lib/schemas/models/warehouse-activity-logs.d.ts +13 -13
- package/lib/schemas/models/warehouse-activity-logs.js +4 -4
- package/lib/schemas/models/warehouse_categories.d.ts +4 -4
- package/lib/schemas/models/warehouse_categories.js +2 -2
- package/lib/schemas/models/warehouse_communications.d.ts +21 -21
- package/lib/schemas/models/warehouse_internal_movements.d.ts +33 -33
- package/lib/schemas/models/warehouse_internal_movements.js +8 -8
- package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.d.ts +154 -0
- package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.js +193 -0
- package/lib/schemas/models/warehouse_inventory_transactions.d.ts +6 -6
- package/lib/schemas/models/warehouse_invoices.d.ts +351 -351
- package/lib/schemas/models/warehouse_item_transactions.d.ts +9 -9
- package/lib/schemas/models/warehouse_items.d.ts +13 -13
- package/lib/schemas/models/warehouse_items.js +2 -2
- package/lib/schemas/models/warehouse_operational_roles.d.ts +3 -3
- package/lib/schemas/models/warehouse_purchase_order_receipts.d.ts +165 -0
- package/lib/schemas/models/warehouse_purchase_order_receipts.js +151 -0
- package/lib/schemas/models/warehouse_purchase_order_rfqs.d.ts +1959 -0
- package/lib/schemas/models/warehouse_purchase_order_rfqs.js +328 -0
- package/lib/schemas/models/warehouse_purchase_order_vendor_returns.d.ts +234 -0
- package/lib/schemas/models/warehouse_purchase_order_vendor_returns.js +188 -0
- package/lib/schemas/models/warehouse_purchase_orders.d.ts +2678 -0
- package/lib/schemas/models/warehouse_purchase_orders.js +336 -0
- package/lib/schemas/models/warehouse_sale_deliveries.d.ts +15 -15
- package/lib/schemas/models/warehouse_sale_deliveries.js +7 -4
- package/lib/schemas/models/warehouse_sale_invoices.d.ts +30 -30
- package/lib/schemas/models/warehouse_sale_invoices.js +8 -5
- package/lib/schemas/models/warehouse_sale_order_rfqs.d.ts +362 -362
- package/lib/schemas/models/warehouse_sale_order_rfqs.js +5 -5
- package/lib/schemas/models/warehouse_sale_orders.d.ts +367 -367
- package/lib/schemas/models/warehouse_sale_orders.js +5 -5
- package/lib/schemas/models/warehouse_void_invoice_items.d.ts +176 -0
- package/lib/schemas/models/warehouse_void_invoice_items.js +176 -0
- package/lib/schemas/models/warehouse_void_purchase_order_items.d.ts +176 -0
- package/lib/schemas/models/warehouse_void_purchase_order_items.js +177 -0
- package/lib/schemas/models/warehouses.d.ts +52 -52
- package/lib/schemas/models/warehouses.js +2 -2
- package/lib/schemas/types/index.d.ts +9 -9
- package/lib/schemas/types/index.js +9 -9
- package/lib/schemas/types/inventory_lot_serial_numbers.d.ts +5 -5
- package/lib/schemas/types/warehouse-activity-logs.d.ts +7 -7
- package/lib/schemas/types/warehouse_categories.d.ts +2 -2
- package/lib/schemas/types/warehouse_internal_movements.d.ts +9 -9
- package/lib/schemas/types/warehouse_inventory_lot_serial_numbers.d.ts +85 -0
- package/lib/schemas/types/warehouse_inventory_lot_serial_numbers.js +4 -0
- package/lib/schemas/types/warehouse_items.d.ts +2 -2
- package/lib/schemas/types/warehouse_purchase_order_common.d.ts +39 -0
- package/lib/schemas/types/warehouse_purchase_order_common.js +2 -0
- package/lib/schemas/types/warehouse_purchase_order_receipts.d.ts +39 -0
- package/lib/schemas/types/warehouse_purchase_order_receipts.js +21 -0
- package/lib/schemas/types/warehouse_purchase_order_rfqs.d.ts +33 -0
- package/lib/schemas/types/warehouse_purchase_order_rfqs.js +2 -0
- package/lib/schemas/types/warehouse_purchase_order_vendor_returns.d.ts +48 -0
- package/lib/schemas/types/warehouse_purchase_order_vendor_returns.js +2 -0
- package/lib/schemas/types/warehouse_purchase_orders.d.ts +33 -0
- package/lib/schemas/types/warehouse_purchase_orders.js +2 -0
- package/lib/schemas/types/warehouse_sale_deliveries.d.ts +29 -29
- package/lib/schemas/types/warehouse_sale_invoices.d.ts +17 -17
- package/lib/schemas/types/warehouse_sale_order_common.d.ts +39 -0
- package/lib/schemas/types/warehouse_sale_order_common.js +2 -0
- package/lib/schemas/types/warehouse_sale_order_rfqs.d.ts +7 -7
- package/lib/schemas/types/warehouse_sale_orders.d.ts +7 -7
- package/lib/schemas/types/warehouse_void_invoice_items.d.ts +37 -0
- package/lib/schemas/types/warehouse_void_invoice_items.js +2 -0
- package/lib/schemas/types/warehouse_void_purchase_order_items.d.ts +37 -0
- package/lib/schemas/types/warehouse_void_purchase_order_items.js +2 -0
- package/lib/schemas/types/warehouses.d.ts +2 -2
- package/package.json +1 -1
|
@@ -15,13 +15,13 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
|
|
|
15
15
|
transaction_type: import("../../constants").ITEM_TRANSACTION_TYPE_ENUM;
|
|
16
16
|
inventory_code: string;
|
|
17
17
|
order_number: number;
|
|
18
|
-
|
|
18
|
+
warehouse_id: string;
|
|
19
19
|
item_id: import("mongoose").Types.ObjectId;
|
|
20
|
+
quantity: number;
|
|
21
|
+
selling_price: number;
|
|
20
22
|
item_name: string;
|
|
21
23
|
category_name: string;
|
|
22
|
-
selling_price: number;
|
|
23
24
|
cost_price: number;
|
|
24
|
-
warehouse_id: string;
|
|
25
25
|
order_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
26
26
|
description?: string | null | undefined;
|
|
27
27
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
@@ -36,13 +36,13 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
|
|
|
36
36
|
transaction_type: import("../../constants").ITEM_TRANSACTION_TYPE_ENUM;
|
|
37
37
|
inventory_code: string;
|
|
38
38
|
order_number: number;
|
|
39
|
-
|
|
39
|
+
warehouse_id: string;
|
|
40
40
|
item_id: import("mongoose").Types.ObjectId;
|
|
41
|
+
quantity: number;
|
|
42
|
+
selling_price: number;
|
|
41
43
|
item_name: string;
|
|
42
44
|
category_name: string;
|
|
43
|
-
selling_price: number;
|
|
44
45
|
cost_price: number;
|
|
45
|
-
warehouse_id: string;
|
|
46
46
|
order_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
47
47
|
description?: string | null | undefined;
|
|
48
48
|
}>> & import("mongoose").FlatRecord<{
|
|
@@ -57,13 +57,13 @@ export declare const WarehouseItemTransactionsSchema: Schema<any, import("mongoo
|
|
|
57
57
|
transaction_type: import("../../constants").ITEM_TRANSACTION_TYPE_ENUM;
|
|
58
58
|
inventory_code: string;
|
|
59
59
|
order_number: number;
|
|
60
|
-
|
|
60
|
+
warehouse_id: string;
|
|
61
61
|
item_id: import("mongoose").Types.ObjectId;
|
|
62
|
+
quantity: number;
|
|
63
|
+
selling_price: number;
|
|
62
64
|
item_name: string;
|
|
63
65
|
category_name: string;
|
|
64
|
-
selling_price: number;
|
|
65
66
|
cost_price: number;
|
|
66
|
-
warehouse_id: string;
|
|
67
67
|
order_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
68
68
|
description?: string | null | undefined;
|
|
69
69
|
}> & Required<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from 'mongoose';
|
|
2
|
-
import {
|
|
2
|
+
import { WAREHOUSE_TRACKING_MODE_ENUM } from '../../constants';
|
|
3
3
|
export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
4
4
|
timestamps: true;
|
|
5
5
|
versionKey: false;
|
|
@@ -32,19 +32,19 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
|
|
|
32
32
|
}>;
|
|
33
33
|
hide_name: boolean;
|
|
34
34
|
keywords: string[];
|
|
35
|
+
warehouse_id: string;
|
|
35
36
|
unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
|
|
36
37
|
threshold_quantity: number;
|
|
37
38
|
quantity_left: number;
|
|
38
39
|
unit_price: number;
|
|
39
40
|
remaining_stock_price: number;
|
|
40
|
-
|
|
41
|
-
selling_price: {
|
|
41
|
+
purchase_price: {
|
|
42
42
|
BASE_PRICE: number;
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
purchase_price: {
|
|
44
|
+
selling_price: {
|
|
46
45
|
BASE_PRICE: number;
|
|
47
46
|
};
|
|
47
|
+
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
48
48
|
expiry_tracked: boolean;
|
|
49
49
|
expiration_days: number;
|
|
50
50
|
best_before_days: number;
|
|
@@ -78,19 +78,19 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
|
|
|
78
78
|
}>;
|
|
79
79
|
hide_name: boolean;
|
|
80
80
|
keywords: string[];
|
|
81
|
+
warehouse_id: string;
|
|
81
82
|
unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
|
|
82
83
|
threshold_quantity: number;
|
|
83
84
|
quantity_left: number;
|
|
84
85
|
unit_price: number;
|
|
85
86
|
remaining_stock_price: number;
|
|
86
|
-
|
|
87
|
-
selling_price: {
|
|
87
|
+
purchase_price: {
|
|
88
88
|
BASE_PRICE: number;
|
|
89
89
|
};
|
|
90
|
-
|
|
91
|
-
purchase_price: {
|
|
90
|
+
selling_price: {
|
|
92
91
|
BASE_PRICE: number;
|
|
93
92
|
};
|
|
93
|
+
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
94
94
|
expiry_tracked: boolean;
|
|
95
95
|
expiration_days: number;
|
|
96
96
|
best_before_days: number;
|
|
@@ -124,19 +124,19 @@ export declare const WarehouseItemSchema: Schema<any, import("mongoose").Model<a
|
|
|
124
124
|
}>;
|
|
125
125
|
hide_name: boolean;
|
|
126
126
|
keywords: string[];
|
|
127
|
+
warehouse_id: string;
|
|
127
128
|
unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
|
|
128
129
|
threshold_quantity: number;
|
|
129
130
|
quantity_left: number;
|
|
130
131
|
unit_price: number;
|
|
131
132
|
remaining_stock_price: number;
|
|
132
|
-
|
|
133
|
-
selling_price: {
|
|
133
|
+
purchase_price: {
|
|
134
134
|
BASE_PRICE: number;
|
|
135
135
|
};
|
|
136
|
-
|
|
137
|
-
purchase_price: {
|
|
136
|
+
selling_price: {
|
|
138
137
|
BASE_PRICE: number;
|
|
139
138
|
};
|
|
139
|
+
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
140
140
|
expiry_tracked: boolean;
|
|
141
141
|
expiration_days: number;
|
|
142
142
|
best_before_days: number;
|
|
@@ -110,8 +110,8 @@ exports.WarehouseItemSchema = new mongoose_1.Schema({
|
|
|
110
110
|
},
|
|
111
111
|
tracking_mode: {
|
|
112
112
|
type: String,
|
|
113
|
-
enum: constants_1.
|
|
114
|
-
default: constants_1.
|
|
113
|
+
enum: constants_1.ALL_WAREHOUSE_TRACKING_MODES,
|
|
114
|
+
default: constants_1.WAREHOUSE_TRACKING_MODE_ENUM.NONE,
|
|
115
115
|
},
|
|
116
116
|
expiry_tracked: {
|
|
117
117
|
type: Boolean,
|
|
@@ -10,6 +10,7 @@ export declare const WarehouseOperationalRolesSchema: Schema<any, import("mongoo
|
|
|
10
10
|
_id: import("mongoose").Types.ObjectId;
|
|
11
11
|
createdAt: NativeDate;
|
|
12
12
|
updatedAt: NativeDate;
|
|
13
|
+
warehouse_id: string;
|
|
13
14
|
roles: {
|
|
14
15
|
SUPER_ADMIN: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
15
16
|
MODERATOR: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
@@ -24,7 +25,6 @@ export declare const WarehouseOperationalRolesSchema: Schema<any, import("mongoo
|
|
|
24
25
|
STAFF: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
25
26
|
DRIVER: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
26
27
|
};
|
|
27
|
-
warehouse_id: string;
|
|
28
28
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
29
29
|
createdAt: NativeDate;
|
|
30
30
|
updatedAt: NativeDate;
|
|
@@ -32,6 +32,7 @@ export declare const WarehouseOperationalRolesSchema: Schema<any, import("mongoo
|
|
|
32
32
|
_id: import("mongoose").Types.ObjectId;
|
|
33
33
|
createdAt: NativeDate;
|
|
34
34
|
updatedAt: NativeDate;
|
|
35
|
+
warehouse_id: string;
|
|
35
36
|
roles: {
|
|
36
37
|
SUPER_ADMIN: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
37
38
|
MODERATOR: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
@@ -46,7 +47,6 @@ export declare const WarehouseOperationalRolesSchema: Schema<any, import("mongoo
|
|
|
46
47
|
STAFF: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
47
48
|
DRIVER: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
48
49
|
};
|
|
49
|
-
warehouse_id: string;
|
|
50
50
|
}>> & import("mongoose").FlatRecord<{
|
|
51
51
|
createdAt: NativeDate;
|
|
52
52
|
updatedAt: NativeDate;
|
|
@@ -54,6 +54,7 @@ export declare const WarehouseOperationalRolesSchema: Schema<any, import("mongoo
|
|
|
54
54
|
_id: import("mongoose").Types.ObjectId;
|
|
55
55
|
createdAt: NativeDate;
|
|
56
56
|
updatedAt: NativeDate;
|
|
57
|
+
warehouse_id: string;
|
|
57
58
|
roles: {
|
|
58
59
|
SUPER_ADMIN: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
59
60
|
MODERATOR: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
@@ -68,7 +69,6 @@ export declare const WarehouseOperationalRolesSchema: Schema<any, import("mongoo
|
|
|
68
69
|
STAFF: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
69
70
|
DRIVER: import("../../constants").WAREHOUSE_USER_PERMISSIONS_ENUM[];
|
|
70
71
|
};
|
|
71
|
-
warehouse_id: string;
|
|
72
72
|
}> & Required<{
|
|
73
73
|
_id: import("mongoose").Types.ObjectId;
|
|
74
74
|
}> & {
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { WAREHOUSE_PURCHASE_ORDER_RECEIPT_STATUS_ENUM } from '../../constants';
|
|
3
|
+
export declare const PurchaseOrderReceiptsSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
4
|
+
timestamps: true;
|
|
5
|
+
versionKey: false;
|
|
6
|
+
minimize: false;
|
|
7
|
+
}, {
|
|
8
|
+
createdAt: NativeDate;
|
|
9
|
+
updatedAt: NativeDate;
|
|
10
|
+
} & {
|
|
11
|
+
_id: import("mongoose").Types.ObjectId;
|
|
12
|
+
createdAt_mins: number;
|
|
13
|
+
createdAt: NativeDate;
|
|
14
|
+
updatedAt: NativeDate;
|
|
15
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
name: string;
|
|
18
|
+
price: number;
|
|
19
|
+
subtotal: number;
|
|
20
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
21
|
+
ordered_quantity: number;
|
|
22
|
+
received_quantity: number;
|
|
23
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
24
|
+
_id: import("mongoose").Types.ObjectId;
|
|
25
|
+
name: string;
|
|
26
|
+
price: number;
|
|
27
|
+
subtotal: number;
|
|
28
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
ordered_quantity: number;
|
|
30
|
+
received_quantity: number;
|
|
31
|
+
}> & {
|
|
32
|
+
_id: import("mongoose").Types.ObjectId;
|
|
33
|
+
name: string;
|
|
34
|
+
price: number;
|
|
35
|
+
subtotal: number;
|
|
36
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
37
|
+
ordered_quantity: number;
|
|
38
|
+
received_quantity: number;
|
|
39
|
+
}>;
|
|
40
|
+
warehouse_id: string;
|
|
41
|
+
vendor_name: string;
|
|
42
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
43
|
+
purchase_order_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
receipt_status: WAREHOUSE_PURCHASE_ORDER_RECEIPT_STATUS_ENUM;
|
|
45
|
+
total_received_amount: number;
|
|
46
|
+
cancel_reason?: string | null | undefined;
|
|
47
|
+
notes?: string | null | undefined;
|
|
48
|
+
created_by?: {
|
|
49
|
+
_id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
} | null | undefined;
|
|
52
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
53
|
+
validated_by?: {
|
|
54
|
+
_id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
} | null | undefined;
|
|
57
|
+
validated_at?: NativeDate | null | undefined;
|
|
58
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
59
|
+
createdAt: NativeDate;
|
|
60
|
+
updatedAt: NativeDate;
|
|
61
|
+
} & {
|
|
62
|
+
_id: import("mongoose").Types.ObjectId;
|
|
63
|
+
createdAt_mins: number;
|
|
64
|
+
createdAt: NativeDate;
|
|
65
|
+
updatedAt: NativeDate;
|
|
66
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
67
|
+
_id: import("mongoose").Types.ObjectId;
|
|
68
|
+
name: string;
|
|
69
|
+
price: number;
|
|
70
|
+
subtotal: number;
|
|
71
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
72
|
+
ordered_quantity: number;
|
|
73
|
+
received_quantity: number;
|
|
74
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
75
|
+
_id: import("mongoose").Types.ObjectId;
|
|
76
|
+
name: string;
|
|
77
|
+
price: number;
|
|
78
|
+
subtotal: number;
|
|
79
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
80
|
+
ordered_quantity: number;
|
|
81
|
+
received_quantity: number;
|
|
82
|
+
}> & {
|
|
83
|
+
_id: import("mongoose").Types.ObjectId;
|
|
84
|
+
name: string;
|
|
85
|
+
price: number;
|
|
86
|
+
subtotal: number;
|
|
87
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
88
|
+
ordered_quantity: number;
|
|
89
|
+
received_quantity: number;
|
|
90
|
+
}>;
|
|
91
|
+
warehouse_id: string;
|
|
92
|
+
vendor_name: string;
|
|
93
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
94
|
+
purchase_order_id: import("mongoose").Types.ObjectId;
|
|
95
|
+
receipt_status: WAREHOUSE_PURCHASE_ORDER_RECEIPT_STATUS_ENUM;
|
|
96
|
+
total_received_amount: number;
|
|
97
|
+
cancel_reason?: string | null | undefined;
|
|
98
|
+
notes?: string | null | undefined;
|
|
99
|
+
created_by?: {
|
|
100
|
+
_id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
} | null | undefined;
|
|
103
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
104
|
+
validated_by?: {
|
|
105
|
+
_id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
} | null | undefined;
|
|
108
|
+
validated_at?: NativeDate | null | undefined;
|
|
109
|
+
}>> & import("mongoose").FlatRecord<{
|
|
110
|
+
createdAt: NativeDate;
|
|
111
|
+
updatedAt: NativeDate;
|
|
112
|
+
} & {
|
|
113
|
+
_id: import("mongoose").Types.ObjectId;
|
|
114
|
+
createdAt_mins: number;
|
|
115
|
+
createdAt: NativeDate;
|
|
116
|
+
updatedAt: NativeDate;
|
|
117
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
118
|
+
_id: import("mongoose").Types.ObjectId;
|
|
119
|
+
name: string;
|
|
120
|
+
price: number;
|
|
121
|
+
subtotal: number;
|
|
122
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
123
|
+
ordered_quantity: number;
|
|
124
|
+
received_quantity: number;
|
|
125
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
126
|
+
_id: import("mongoose").Types.ObjectId;
|
|
127
|
+
name: string;
|
|
128
|
+
price: number;
|
|
129
|
+
subtotal: number;
|
|
130
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
131
|
+
ordered_quantity: number;
|
|
132
|
+
received_quantity: number;
|
|
133
|
+
}> & {
|
|
134
|
+
_id: import("mongoose").Types.ObjectId;
|
|
135
|
+
name: string;
|
|
136
|
+
price: number;
|
|
137
|
+
subtotal: number;
|
|
138
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
139
|
+
ordered_quantity: number;
|
|
140
|
+
received_quantity: number;
|
|
141
|
+
}>;
|
|
142
|
+
warehouse_id: string;
|
|
143
|
+
vendor_name: string;
|
|
144
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
145
|
+
purchase_order_id: import("mongoose").Types.ObjectId;
|
|
146
|
+
receipt_status: WAREHOUSE_PURCHASE_ORDER_RECEIPT_STATUS_ENUM;
|
|
147
|
+
total_received_amount: number;
|
|
148
|
+
cancel_reason?: string | null | undefined;
|
|
149
|
+
notes?: string | null | undefined;
|
|
150
|
+
created_by?: {
|
|
151
|
+
_id: string;
|
|
152
|
+
name: string;
|
|
153
|
+
} | null | undefined;
|
|
154
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
155
|
+
validated_by?: {
|
|
156
|
+
_id: string;
|
|
157
|
+
name: string;
|
|
158
|
+
} | null | undefined;
|
|
159
|
+
validated_at?: NativeDate | null | undefined;
|
|
160
|
+
}> & Required<{
|
|
161
|
+
_id: import("mongoose").Types.ObjectId;
|
|
162
|
+
}> & {
|
|
163
|
+
__v: number;
|
|
164
|
+
}>;
|
|
165
|
+
export declare const WAREHOUSE_PURCHASE_ORDER_RECEIPTS_COLLECTION_NAME = "warehouse_purchase_order_receipts";
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAREHOUSE_PURCHASE_ORDER_RECEIPTS_COLLECTION_NAME = exports.PurchaseOrderReceiptsSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const warehouse_purchase_orders_1 = require("./warehouse_purchase_orders");
|
|
7
|
+
const warehouse_items_1 = require("./warehouse_items");
|
|
8
|
+
const warehouse_vendors_1 = require("./warehouse_vendors");
|
|
9
|
+
const warehouses_1 = require("./warehouses");
|
|
10
|
+
const PurchaseOrderReceiptCreatedBySchema = new mongoose_1.Schema({
|
|
11
|
+
_id: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
name: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
default: '',
|
|
19
|
+
},
|
|
20
|
+
}, { _id: false, minimize: false });
|
|
21
|
+
const PurchaseOrderReceiptItemsSchema = new mongoose_1.Schema({
|
|
22
|
+
_id: {
|
|
23
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
24
|
+
required: true,
|
|
25
|
+
immutable: true,
|
|
26
|
+
},
|
|
27
|
+
item_id: {
|
|
28
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
29
|
+
required: true,
|
|
30
|
+
immutable: true,
|
|
31
|
+
ref: warehouse_items_1.WAREHOUSE_ITEMS_COLLECTION_NAME,
|
|
32
|
+
},
|
|
33
|
+
name: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
ordered_quantity: {
|
|
38
|
+
type: Number,
|
|
39
|
+
min: 0,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
received_quantity: {
|
|
43
|
+
type: Number,
|
|
44
|
+
min: 0,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
price: {
|
|
48
|
+
type: Number,
|
|
49
|
+
min: 0,
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
52
|
+
subtotal: {
|
|
53
|
+
type: Number,
|
|
54
|
+
min: 0,
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
}, {
|
|
58
|
+
_id: false,
|
|
59
|
+
minimize: false,
|
|
60
|
+
});
|
|
61
|
+
exports.PurchaseOrderReceiptsSchema = new mongoose_1.Schema({
|
|
62
|
+
_id: {
|
|
63
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
64
|
+
required: true,
|
|
65
|
+
immutable: true,
|
|
66
|
+
},
|
|
67
|
+
warehouse_id: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: true,
|
|
70
|
+
ref: warehouses_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
|
|
71
|
+
},
|
|
72
|
+
purchase_order_id: {
|
|
73
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
74
|
+
required: true,
|
|
75
|
+
ref: warehouse_purchase_orders_1.WAREHOUSE_PURCHASE_ORDER_COLLECTION_NAME,
|
|
76
|
+
},
|
|
77
|
+
vendor_id: {
|
|
78
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
79
|
+
required: true,
|
|
80
|
+
ref: warehouse_vendors_1.WAREHOUSE_VENDORS_COLLECTION_NAME,
|
|
81
|
+
},
|
|
82
|
+
vendor_name: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: '',
|
|
85
|
+
},
|
|
86
|
+
receipt_status: {
|
|
87
|
+
type: String,
|
|
88
|
+
enum: constants_1.ALL_WAREHOUSE_PURCHASE_ORDER_RECEIPT_STATUS_NAMES,
|
|
89
|
+
required: true,
|
|
90
|
+
default: constants_1.WAREHOUSE_PURCHASE_ORDER_RECEIPT_STATUS_ENUM.DRAFT,
|
|
91
|
+
},
|
|
92
|
+
items: {
|
|
93
|
+
type: [PurchaseOrderReceiptItemsSchema],
|
|
94
|
+
required: true,
|
|
95
|
+
default: [],
|
|
96
|
+
},
|
|
97
|
+
total_received_amount: {
|
|
98
|
+
type: Number,
|
|
99
|
+
min: 0,
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
102
|
+
notes: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: false,
|
|
105
|
+
},
|
|
106
|
+
created_by: {
|
|
107
|
+
type: PurchaseOrderReceiptCreatedBySchema,
|
|
108
|
+
required: false,
|
|
109
|
+
},
|
|
110
|
+
validated_by: {
|
|
111
|
+
type: PurchaseOrderReceiptCreatedBySchema,
|
|
112
|
+
required: false,
|
|
113
|
+
},
|
|
114
|
+
validated_at: {
|
|
115
|
+
type: mongoose_1.Schema.Types.Date,
|
|
116
|
+
required: false,
|
|
117
|
+
},
|
|
118
|
+
cancelled_at: {
|
|
119
|
+
type: mongoose_1.Schema.Types.Date,
|
|
120
|
+
required: false,
|
|
121
|
+
},
|
|
122
|
+
cancel_reason: {
|
|
123
|
+
type: String,
|
|
124
|
+
required: false,
|
|
125
|
+
},
|
|
126
|
+
createdAt_mins: {
|
|
127
|
+
type: Number,
|
|
128
|
+
required: true,
|
|
129
|
+
immutable: true,
|
|
130
|
+
default: () => {
|
|
131
|
+
const date = new Date();
|
|
132
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
createdAt: {
|
|
136
|
+
type: mongoose_1.Schema.Types.Date,
|
|
137
|
+
required: true,
|
|
138
|
+
default: () => new Date(),
|
|
139
|
+
immutable: true,
|
|
140
|
+
},
|
|
141
|
+
updatedAt: {
|
|
142
|
+
type: mongoose_1.Schema.Types.Date,
|
|
143
|
+
required: true,
|
|
144
|
+
default: () => new Date(),
|
|
145
|
+
},
|
|
146
|
+
}, {
|
|
147
|
+
timestamps: true,
|
|
148
|
+
versionKey: false,
|
|
149
|
+
minimize: false,
|
|
150
|
+
});
|
|
151
|
+
exports.WAREHOUSE_PURCHASE_ORDER_RECEIPTS_COLLECTION_NAME = 'warehouse_purchase_order_receipts';
|