@managesome/eposmatic-toolkit 0.2.364 → 0.2.366
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 +223 -1
- package/lib/constants/ENUMS.js +271 -4
- package/lib/constants/PURCHASE_ORDER.js +12 -3
- package/lib/helpers/store/common-purchase-order-actions.d.ts +2 -2
- package/lib/helpers/store/purchase-orders-cart-actions.d.ts +7 -6
- package/lib/helpers/types/email-templates.d.ts +31 -1
- package/lib/helpers/utils/email-helpers.js +5 -0
- package/lib/schemas/models/index.d.ts +11 -0
- package/lib/schemas/models/index.js +11 -0
- package/lib/schemas/models/internal_movements.d.ts +357 -0
- package/lib/schemas/models/internal_movements.js +323 -0
- package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +154 -0
- package/lib/schemas/models/inventory_lot_serial_numbers.js +193 -0
- package/lib/schemas/models/item_transactions.d.ts +3 -3
- package/lib/schemas/models/purchase_order_receipts.d.ts +165 -0
- package/lib/schemas/models/purchase_order_receipts.js +151 -0
- package/lib/schemas/models/purchase_order_rfq.d.ts +1938 -0
- package/lib/schemas/models/purchase_order_rfq.js +309 -0
- package/lib/schemas/models/purchase_order_vendor_returns.d.ts +234 -0
- package/lib/schemas/models/purchase_order_vendor_returns.js +188 -0
- package/lib/schemas/models/purchase_orders.d.ts +6 -3
- package/lib/schemas/models/purchase_orders.js +10 -1
- package/lib/schemas/models/rewards_usage.d.ts +3 -3
- package/lib/schemas/models/rider.d.ts +3 -3
- package/lib/schemas/models/sale_order_deliveries.d.ts +167 -0
- package/lib/schemas/models/sale_order_deliveries.js +155 -0
- package/lib/schemas/models/sale_order_invoices.d.ts +218 -0
- package/lib/schemas/models/sale_order_invoices.js +192 -0
- package/lib/schemas/models/sale_order_rfq.d.ts +1938 -0
- package/lib/schemas/models/sale_order_rfq.js +309 -0
- package/lib/schemas/models/sale_orders.d.ts +1943 -0
- package/lib/schemas/models/sale_orders.js +324 -0
- package/lib/schemas/models/void_purchase_order_items.d.ts +3 -3
- package/lib/schemas/models/void_purchase_order_items.js +2 -1
- package/lib/schemas/models/void_warehouse_invoice_items.d.ts +9 -9
- package/lib/schemas/models/warehouse-activity-logs.d.ts +127 -0
- package/lib/schemas/models/warehouse-activity-logs.js +143 -0
- package/lib/schemas/models/warehouse-communications.d.ts +228 -0
- package/lib/schemas/models/warehouse-communications.js +216 -0
- package/lib/schemas/models/warehouse.d.ts +7 -1
- package/lib/schemas/models/warehouse.js +9 -0
- package/lib/schemas/models/warehouse_categories.d.ts +4 -0
- package/lib/schemas/models/warehouse_categories.js +6 -0
- package/lib/schemas/models/warehouse_clients.d.ts +6 -0
- package/lib/schemas/models/warehouse_clients.js +8 -0
- package/lib/schemas/models/warehouse_inventory_transactions.d.ts +3 -3
- package/lib/schemas/models/warehouse_invoices.d.ts +3 -3
- package/lib/schemas/models/warehouse_item_transactions.d.ts +6 -6
- package/lib/schemas/models/warehouse_items.d.ts +28 -9
- package/lib/schemas/models/warehouse_items.js +29 -0
- package/lib/schemas/models/warehouse_vendors.d.ts +3 -3
- package/lib/schemas/types/index.d.ts +13 -0
- package/lib/schemas/types/index.js +13 -0
- package/lib/schemas/types/internal_movements.d.ts +73 -0
- package/lib/schemas/types/internal_movements.js +2 -0
- package/lib/schemas/types/inventory_lot_serial_numbers.d.ts +85 -0
- package/lib/schemas/types/inventory_lot_serial_numbers.js +4 -0
- package/lib/schemas/types/purchase_order_common.d.ts +39 -0
- package/lib/schemas/types/purchase_order_common.js +2 -0
- package/lib/schemas/types/purchase_order_receipts.d.ts +39 -0
- package/lib/schemas/types/purchase_order_receipts.js +21 -0
- package/lib/schemas/types/purchase_order_rfq.d.ts +25 -0
- package/lib/schemas/types/purchase_order_rfq.js +2 -0
- package/lib/schemas/types/purchase_order_vendor_returns.d.ts +49 -0
- package/lib/schemas/types/purchase_order_vendor_returns.js +42 -0
- package/lib/schemas/types/purchase_orders.d.ts +7 -43
- package/lib/schemas/types/sale_order_common.d.ts +39 -0
- package/lib/schemas/types/sale_order_common.js +2 -0
- package/lib/schemas/types/sale_order_deliveries.d.ts +67 -0
- package/lib/schemas/types/sale_order_deliveries.js +2 -0
- package/lib/schemas/types/sale_order_invoices.d.ts +46 -0
- package/lib/schemas/types/sale_order_invoices.js +2 -0
- package/lib/schemas/types/sale_order_rfq.d.ts +25 -0
- package/lib/schemas/types/sale_order_rfq.js +2 -0
- package/lib/schemas/types/sale_orders.d.ts +30 -0
- package/lib/schemas/types/sale_orders.js +2 -0
- package/lib/schemas/types/warehouse-activity-logs.d.ts +35 -0
- package/lib/schemas/types/warehouse-activity-logs.js +4 -0
- package/lib/schemas/types/warehouse-communications.d.ts +53 -0
- package/lib/schemas/types/warehouse-communications.js +2 -0
- package/lib/schemas/types/warehouse.d.ts +3 -1
- package/lib/schemas/types/warehouse_categories.d.ts +2 -0
- package/lib/schemas/types/warehouse_clients.d.ts +2 -0
- package/lib/schemas/types/warehouse_items.d.ts +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SALE_ORDER_RFQ_COLLECTION_NAME = exports.SaleOrderRFQSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const warehouse_1 = require("./warehouse");
|
|
7
|
+
const warehouse_categories_1 = require("./warehouse_categories");
|
|
8
|
+
const warehouse_clients_1 = require("./warehouse_clients");
|
|
9
|
+
const warehouse_items_1 = require("./warehouse_items");
|
|
10
|
+
const StaffDetailsSchema = new mongoose_1.Schema({
|
|
11
|
+
staff_id: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
staff_name: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '',
|
|
18
|
+
},
|
|
19
|
+
staff_mobile: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: null,
|
|
22
|
+
},
|
|
23
|
+
staff_email: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: null,
|
|
26
|
+
},
|
|
27
|
+
}, { _id: false, minimize: false });
|
|
28
|
+
const SaleOrderRFQItemsSchema = new mongoose_1.Schema({
|
|
29
|
+
_id: {
|
|
30
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
31
|
+
required: true,
|
|
32
|
+
immutable: true,
|
|
33
|
+
},
|
|
34
|
+
item_id: {
|
|
35
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
36
|
+
required: true,
|
|
37
|
+
immutable: true,
|
|
38
|
+
ref: warehouse_items_1.WAREHOUSE_ITEMS_COLLECTION_NAME,
|
|
39
|
+
},
|
|
40
|
+
is_ready: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
required: false,
|
|
43
|
+
},
|
|
44
|
+
void_reason: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: false,
|
|
47
|
+
},
|
|
48
|
+
name: {
|
|
49
|
+
type: String,
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
52
|
+
quantity: {
|
|
53
|
+
type: Number,
|
|
54
|
+
min: 0,
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
price: {
|
|
58
|
+
type: Number,
|
|
59
|
+
min: 0,
|
|
60
|
+
required: true,
|
|
61
|
+
},
|
|
62
|
+
subtotal: {
|
|
63
|
+
type: Number,
|
|
64
|
+
min: 0,
|
|
65
|
+
required: true,
|
|
66
|
+
},
|
|
67
|
+
_net_amount: {
|
|
68
|
+
type: Number,
|
|
69
|
+
min: 0,
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
_gross_amount: {
|
|
73
|
+
type: Number,
|
|
74
|
+
min: 0,
|
|
75
|
+
required: true,
|
|
76
|
+
},
|
|
77
|
+
_gst_amount: {
|
|
78
|
+
type: Number,
|
|
79
|
+
min: 0,
|
|
80
|
+
required: true,
|
|
81
|
+
},
|
|
82
|
+
_discount_amount: {
|
|
83
|
+
type: Number,
|
|
84
|
+
min: 0,
|
|
85
|
+
required: true,
|
|
86
|
+
},
|
|
87
|
+
special_instructions: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: '',
|
|
90
|
+
},
|
|
91
|
+
}, {
|
|
92
|
+
_id: false,
|
|
93
|
+
minimize: false,
|
|
94
|
+
});
|
|
95
|
+
const SaleOrderRFQCategoriesSchema = new mongoose_1.Schema({
|
|
96
|
+
category_id: {
|
|
97
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
98
|
+
required: true,
|
|
99
|
+
immutable: true,
|
|
100
|
+
ref: warehouse_categories_1.WAREHOUSE_CATEGORY_COLLECTION_NAME,
|
|
101
|
+
},
|
|
102
|
+
name: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: true,
|
|
105
|
+
},
|
|
106
|
+
items: {
|
|
107
|
+
type: [SaleOrderRFQItemsSchema],
|
|
108
|
+
default: [],
|
|
109
|
+
},
|
|
110
|
+
}, {
|
|
111
|
+
_id: false,
|
|
112
|
+
minimize: false,
|
|
113
|
+
});
|
|
114
|
+
const SaleOrderRFQIterationSchema = new mongoose_1.Schema({
|
|
115
|
+
categories: {
|
|
116
|
+
type: [SaleOrderRFQCategoriesSchema],
|
|
117
|
+
required: true,
|
|
118
|
+
},
|
|
119
|
+
staff_details: {
|
|
120
|
+
type: StaffDetailsSchema,
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
special_instructions: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: '',
|
|
126
|
+
},
|
|
127
|
+
price: {
|
|
128
|
+
type: Number,
|
|
129
|
+
min: 0,
|
|
130
|
+
required: true,
|
|
131
|
+
},
|
|
132
|
+
amount_earned: {
|
|
133
|
+
type: Number,
|
|
134
|
+
min: 0,
|
|
135
|
+
required: true,
|
|
136
|
+
},
|
|
137
|
+
grand_total: {
|
|
138
|
+
type: Number,
|
|
139
|
+
min: 0,
|
|
140
|
+
required: true,
|
|
141
|
+
},
|
|
142
|
+
order_status: {
|
|
143
|
+
type: String,
|
|
144
|
+
enum: constants_1.ALL_SALE_ORDER_RFQ_STATUS_NAMES,
|
|
145
|
+
required: true,
|
|
146
|
+
},
|
|
147
|
+
is_gst_inclusive: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
required: false,
|
|
150
|
+
},
|
|
151
|
+
gst: {
|
|
152
|
+
type: Number,
|
|
153
|
+
min: 0,
|
|
154
|
+
required: false,
|
|
155
|
+
},
|
|
156
|
+
gst_amount: {
|
|
157
|
+
type: Number,
|
|
158
|
+
min: 0,
|
|
159
|
+
required: false,
|
|
160
|
+
},
|
|
161
|
+
tax_number: {
|
|
162
|
+
type: String,
|
|
163
|
+
default: '',
|
|
164
|
+
},
|
|
165
|
+
updatedAt: {
|
|
166
|
+
type: mongoose_1.Schema.Types.Date,
|
|
167
|
+
required: true,
|
|
168
|
+
},
|
|
169
|
+
}, {
|
|
170
|
+
_id: false,
|
|
171
|
+
timestamps: false,
|
|
172
|
+
versionKey: false,
|
|
173
|
+
});
|
|
174
|
+
exports.SaleOrderRFQSchema = new mongoose_1.Schema({
|
|
175
|
+
_id: {
|
|
176
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
177
|
+
required: true,
|
|
178
|
+
immutable: true,
|
|
179
|
+
},
|
|
180
|
+
warehouse_id: {
|
|
181
|
+
type: String,
|
|
182
|
+
required: true,
|
|
183
|
+
ref: warehouse_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
|
|
184
|
+
},
|
|
185
|
+
client_id: {
|
|
186
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
187
|
+
required: true,
|
|
188
|
+
ref: warehouse_clients_1.WAREHOUSE_CLIENTS_COLLECTION_NAME,
|
|
189
|
+
},
|
|
190
|
+
client_name: {
|
|
191
|
+
type: String,
|
|
192
|
+
default: '',
|
|
193
|
+
},
|
|
194
|
+
order_number: {
|
|
195
|
+
type: Number,
|
|
196
|
+
min: 0,
|
|
197
|
+
default: null,
|
|
198
|
+
},
|
|
199
|
+
order_status: {
|
|
200
|
+
type: String,
|
|
201
|
+
enum: constants_1.ALL_SALE_ORDER_RFQ_STATUS_NAMES,
|
|
202
|
+
required: true,
|
|
203
|
+
default: constants_1.SALE_ORDER_RFQ_STATUS_ENUM.DRAFT,
|
|
204
|
+
},
|
|
205
|
+
categories: {
|
|
206
|
+
type: [SaleOrderRFQCategoriesSchema],
|
|
207
|
+
default: [],
|
|
208
|
+
},
|
|
209
|
+
iterations: {
|
|
210
|
+
type: [SaleOrderRFQIterationSchema],
|
|
211
|
+
default: [],
|
|
212
|
+
},
|
|
213
|
+
expected_deadline: {
|
|
214
|
+
type: String,
|
|
215
|
+
default: '',
|
|
216
|
+
},
|
|
217
|
+
payment_terms: {
|
|
218
|
+
type: Number,
|
|
219
|
+
min: 0,
|
|
220
|
+
default: 0,
|
|
221
|
+
},
|
|
222
|
+
special_instructions: {
|
|
223
|
+
type: String,
|
|
224
|
+
default: '',
|
|
225
|
+
},
|
|
226
|
+
delete_reason: {
|
|
227
|
+
type: String,
|
|
228
|
+
required: false,
|
|
229
|
+
},
|
|
230
|
+
cancel_reason: {
|
|
231
|
+
type: String,
|
|
232
|
+
required: false,
|
|
233
|
+
},
|
|
234
|
+
staff_details: {
|
|
235
|
+
type: StaffDetailsSchema,
|
|
236
|
+
required: true,
|
|
237
|
+
},
|
|
238
|
+
gst: {
|
|
239
|
+
type: Number,
|
|
240
|
+
min: 0,
|
|
241
|
+
required: false,
|
|
242
|
+
},
|
|
243
|
+
gst_amount: {
|
|
244
|
+
type: Number,
|
|
245
|
+
min: 0,
|
|
246
|
+
required: false,
|
|
247
|
+
},
|
|
248
|
+
is_gst_inclusive: {
|
|
249
|
+
type: Boolean,
|
|
250
|
+
required: false,
|
|
251
|
+
},
|
|
252
|
+
tax_number: {
|
|
253
|
+
type: String,
|
|
254
|
+
default: '',
|
|
255
|
+
},
|
|
256
|
+
is_deleted: {
|
|
257
|
+
type: Boolean,
|
|
258
|
+
default: false,
|
|
259
|
+
},
|
|
260
|
+
order_status_updated_at: {
|
|
261
|
+
type: mongoose_1.Schema.Types.Date,
|
|
262
|
+
required: true,
|
|
263
|
+
default: () => new Date(),
|
|
264
|
+
},
|
|
265
|
+
is_reopened: {
|
|
266
|
+
type: Boolean,
|
|
267
|
+
required: false,
|
|
268
|
+
},
|
|
269
|
+
price: {
|
|
270
|
+
type: Number,
|
|
271
|
+
min: 0,
|
|
272
|
+
required: true,
|
|
273
|
+
},
|
|
274
|
+
amount_earned: {
|
|
275
|
+
type: Number,
|
|
276
|
+
min: 0,
|
|
277
|
+
required: true,
|
|
278
|
+
},
|
|
279
|
+
grand_total: {
|
|
280
|
+
type: Number,
|
|
281
|
+
min: 0,
|
|
282
|
+
required: true,
|
|
283
|
+
},
|
|
284
|
+
createdAt_mins: {
|
|
285
|
+
type: Number,
|
|
286
|
+
required: true,
|
|
287
|
+
immutable: true,
|
|
288
|
+
default: () => {
|
|
289
|
+
const date = new Date();
|
|
290
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
createdAt: {
|
|
294
|
+
type: mongoose_1.Schema.Types.Date,
|
|
295
|
+
required: true,
|
|
296
|
+
default: () => new Date(),
|
|
297
|
+
immutable: true,
|
|
298
|
+
},
|
|
299
|
+
updatedAt: {
|
|
300
|
+
type: mongoose_1.Schema.Types.Date,
|
|
301
|
+
required: true,
|
|
302
|
+
default: () => new Date(),
|
|
303
|
+
},
|
|
304
|
+
}, {
|
|
305
|
+
timestamps: true,
|
|
306
|
+
versionKey: false,
|
|
307
|
+
minimize: false,
|
|
308
|
+
});
|
|
309
|
+
exports.SALE_ORDER_RFQ_COLLECTION_NAME = 'warehouse_sale_order_rfqs';
|