@managesome/eposmatic-toolkit 0.2.769 → 0.2.771

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.
Files changed (57) hide show
  1. package/lib/helpers/utils/receipt-engine.js +10 -2
  2. package/lib/tests/classic-specials-quantity.test.js +7 -4
  3. package/lib/tests/receipt-engine.test.js +79 -0
  4. package/package.json +1 -1
  5. package/lib/constants/MATERIALIZED_REPORTS.d.ts +0 -44
  6. package/lib/constants/MATERIALIZED_REPORTS.js +0 -58
  7. package/lib/constants/WAREHOUSE_INVOICE.d.ts +0 -14
  8. package/lib/constants/WAREHOUSE_INVOICE.js +0 -35
  9. package/lib/helpers/offer/generate-offer.d.ts +0 -11
  10. package/lib/helpers/offer/generate-offer.js +0 -143
  11. package/lib/helpers/offer/index.d.ts +0 -1
  12. package/lib/helpers/offer/index.js +0 -17
  13. package/lib/helpers/order/generate-warehouse-invoice.d.ts +0 -11
  14. package/lib/helpers/order/generate-warehouse-invoice.js +0 -196
  15. package/lib/helpers/store/all-warehouse-invoice-actions.d.ts +0 -13
  16. package/lib/helpers/store/all-warehouse-invoice-actions.js +0 -58
  17. package/lib/helpers/store/common-warehouse-invoice-actions.d.ts +0 -31
  18. package/lib/helpers/store/common-warehouse-invoice-actions.js +0 -545
  19. package/lib/helpers/store/warehouse-invoice-cart-actions.d.ts +0 -24
  20. package/lib/helpers/store/warehouse-invoice-cart-actions.js +0 -486
  21. package/lib/helpers/types/sockets.d.ts +0 -6
  22. package/lib/helpers/types/sockets.js +0 -2
  23. package/lib/helpers/types/warehouse-invoice-cart-actions.d.ts +0 -26
  24. package/lib/helpers/types/warehouse-invoice-cart-actions.js +0 -2
  25. package/lib/helpers/utils/materialized-report-helpers.d.ts +0 -35
  26. package/lib/helpers/utils/materialized-report-helpers.js +0 -73
  27. package/lib/helpers/utils/void-warehouse-invoice-items-helpers.d.ts +0 -3
  28. package/lib/helpers/utils/void-warehouse-invoice-items-helpers.js +0 -38
  29. package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.d.ts +0 -13
  30. package/lib/helpers/utils/void-warehouse-invoice-items-report-helpers.js +0 -22
  31. package/lib/helpers/utils/warehouse-invoice-order-engine.d.ts +0 -11
  32. package/lib/helpers/utils/warehouse-invoice-order-engine.js +0 -39
  33. package/lib/helpers/utils/warehouse-invoice-x-report-helpers.d.ts +0 -58
  34. package/lib/helpers/utils/warehouse-invoice-x-report-helpers.js +0 -1432
  35. package/lib/schemas/models/inventory_department_transactions.d.ts +0 -86
  36. package/lib/schemas/models/inventory_department_transactions.js +0 -116
  37. package/lib/schemas/models/inventory_department_utilities.d.ts +0 -108
  38. package/lib/schemas/models/inventory_department_utilities.js +0 -88
  39. package/lib/schemas/models/inventory_departments.d.ts +0 -53
  40. package/lib/schemas/models/inventory_departments.js +0 -58
  41. package/lib/schemas/models/inventory_entries.d.ts +0 -152
  42. package/lib/schemas/models/inventory_entries.js +0 -142
  43. package/lib/schemas/models/materialized_reports.d.ts +0 -277
  44. package/lib/schemas/models/materialized_reports.js +0 -60
  45. package/lib/schemas/models/warehouse_invoices.d.ts +0 -2675
  46. package/lib/schemas/models/warehouse_invoices.js +0 -327
  47. package/lib/schemas/models/warehouse_void_invoice_items.d.ts +0 -176
  48. package/lib/schemas/models/warehouse_void_invoice_items.js +0 -176
  49. package/lib/schemas/types/inventory_entries.d.ts +0 -41
  50. package/lib/schemas/types/inventory_entries.js +0 -2
  51. package/lib/schemas/types/materialized_reports.d.ts +0 -82
  52. package/lib/schemas/types/materialized_reports.js +0 -2
  53. package/lib/schemas/types/warehouse_invoices.d.ts +0 -69
  54. package/lib/schemas/types/warehouse_invoices.js +0 -2
  55. package/lib/schemas/types/warehouse_void_invoice_items.d.ts +0 -37
  56. package/lib/schemas/types/warehouse_void_invoice_items.js +0 -2
  57. package/lib/tests/materialized-report-helpers.test.d.ts +0 -1
@@ -1,327 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WAREHOUSE_INVOICES_COLLECTION_NAME = exports.WarehouseClientInvoicesSchema = void 0;
4
- const mongoose_1 = require("mongoose");
5
- const constants_1 = require("../../constants");
6
- const common_models_1 = require("./common-models");
7
- const warehouse_clients_1 = require("./warehouse_clients");
8
- const warehouses_1 = require("./warehouses");
9
- const StaffDetailsSchema = new mongoose_1.Schema({
10
- staff_id: {
11
- type: String,
12
- required: true,
13
- },
14
- staff_name: {
15
- type: String,
16
- default: '',
17
- },
18
- staff_mobile: {
19
- type: String,
20
- default: null,
21
- },
22
- staff_email: {
23
- type: String,
24
- default: null,
25
- },
26
- }, { _id: false, minimize: false });
27
- const ItemsModal = new mongoose_1.Schema({
28
- _id: {
29
- type: mongoose_1.Schema.Types.ObjectId,
30
- required: true,
31
- immutable: true,
32
- },
33
- item_id: {
34
- type: mongoose_1.Schema.Types.ObjectId,
35
- required: true,
36
- immutable: true,
37
- },
38
- is_ready: {
39
- type: Boolean,
40
- required: false,
41
- },
42
- void_reason: {
43
- type: String,
44
- required: false,
45
- },
46
- name: {
47
- type: String,
48
- required: true,
49
- },
50
- price: {
51
- type: Number,
52
- min: 0,
53
- required: true,
54
- },
55
- subtotal: {
56
- type: Number,
57
- min: 0,
58
- required: true,
59
- },
60
- quantity: {
61
- type: Number,
62
- min: 0,
63
- required: true,
64
- },
65
- _gst_amount: {
66
- type: Number,
67
- min: 0,
68
- required: true,
69
- },
70
- _net_amount: {
71
- type: Number,
72
- min: 0,
73
- required: true,
74
- },
75
- _gross_amount: {
76
- type: Number,
77
- min: 0,
78
- required: true,
79
- },
80
- _discount_amount: {
81
- type: Number,
82
- min: 0,
83
- required: true,
84
- },
85
- special_instructions: {
86
- type: String,
87
- default: '',
88
- },
89
- });
90
- const CatergoriesSchema = new mongoose_1.Schema({
91
- category_id: {
92
- type: mongoose_1.Schema.Types.ObjectId,
93
- required: true,
94
- immutable: true,
95
- ref: 'warehouse_categories',
96
- },
97
- name: {
98
- type: String,
99
- required: true,
100
- },
101
- items: {
102
- type: [ItemsModal],
103
- default: [],
104
- },
105
- }, {
106
- _id: false,
107
- minimize: false,
108
- });
109
- const WarehouseClientInvoiceIterationSchema = new mongoose_1.Schema({
110
- categories: {
111
- type: [CatergoriesSchema],
112
- required: true,
113
- },
114
- special_instructions: {
115
- type: String,
116
- default: '',
117
- },
118
- payments: {
119
- type: [common_models_1.PaymentsSchema],
120
- required: true,
121
- },
122
- order_status: {
123
- type: String,
124
- enum: constants_1.ALL_WAREHOUSE_INVOICE_STATUS_NAMES,
125
- required: true,
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
- staff_details: {
143
- type: StaffDetailsSchema,
144
- required: false,
145
- },
146
- gst: {
147
- type: Number,
148
- min: 0,
149
- required: false,
150
- },
151
- gst_amount: {
152
- type: Number,
153
- min: 0,
154
- required: false,
155
- },
156
- is_gst_inclusive: {
157
- type: Boolean,
158
- required: false,
159
- },
160
- tax_number: {
161
- type: String,
162
- default: '',
163
- },
164
- updatedAt: {
165
- type: mongoose_1.Schema.Types.Date,
166
- required: true,
167
- },
168
- }, {
169
- _id: false,
170
- timestamps: false,
171
- versionKey: false,
172
- });
173
- exports.WarehouseClientInvoicesSchema = new mongoose_1.Schema({
174
- _id: {
175
- type: mongoose_1.Schema.Types.ObjectId,
176
- required: true,
177
- immutable: true,
178
- },
179
- warehouse_id: {
180
- type: String,
181
- required: true,
182
- ref: warehouses_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
183
- },
184
- client_id: {
185
- type: mongoose_1.Schema.Types.ObjectId,
186
- required: true,
187
- ref: warehouse_clients_1.WAREHOUSE_CLIENTS_COLLECTION_NAME,
188
- },
189
- client_name: {
190
- type: String,
191
- default: '',
192
- },
193
- categories: {
194
- type: [CatergoriesSchema],
195
- default: [],
196
- },
197
- iterations: {
198
- type: [WarehouseClientInvoiceIterationSchema],
199
- default: [],
200
- },
201
- special_instructions: {
202
- type: String,
203
- default: '',
204
- },
205
- payments: {
206
- type: [common_models_1.PaymentsSchema],
207
- required: true,
208
- },
209
- order_status: {
210
- type: String,
211
- enum: constants_1.ALL_WAREHOUSE_INVOICE_STATUS_NAMES,
212
- required: true,
213
- },
214
- tax_number: {
215
- type: String,
216
- default: '',
217
- },
218
- price: {
219
- type: Number,
220
- min: 0,
221
- required: true,
222
- },
223
- amount_collected: {
224
- type: Number,
225
- min: 0,
226
- required: true,
227
- },
228
- amount_earned: {
229
- type: Number,
230
- min: 0,
231
- required: true,
232
- },
233
- grand_total: {
234
- type: Number,
235
- min: 0,
236
- required: true,
237
- },
238
- order_number: {
239
- type: Number,
240
- min: 0,
241
- default: null,
242
- },
243
- //
244
- delete_reason: {
245
- type: String,
246
- required: false,
247
- },
248
- cancel_reason: {
249
- type: String,
250
- required: false,
251
- },
252
- // common fields
253
- staff_details: {
254
- type: StaffDetailsSchema,
255
- required: true,
256
- },
257
- gst: {
258
- type: Number,
259
- min: 0,
260
- required: false,
261
- },
262
- gst_amount: {
263
- type: Number,
264
- min: 0,
265
- required: false,
266
- },
267
- is_gst_inclusive: {
268
- type: Boolean,
269
- required: false,
270
- },
271
- //
272
- is_deleted: {
273
- type: Boolean,
274
- default: false,
275
- },
276
- order_status_updated_at: {
277
- type: mongoose_1.Schema.Types.Date,
278
- required: true,
279
- default: () => new Date(),
280
- },
281
- is_reopened: {
282
- type: Boolean,
283
- required: false,
284
- },
285
- deferred_settlement: {
286
- type: Boolean,
287
- required: false,
288
- },
289
- order_settled_at: {
290
- type: mongoose_1.Schema.Types.Date,
291
- required: true,
292
- default: () => new Date(),
293
- },
294
- order_settled_at_mins: {
295
- type: Number,
296
- required: true,
297
- default: () => {
298
- const date = new Date();
299
- return Math.floor(date.getHours() * 60 + date.getMinutes());
300
- },
301
- },
302
- createdAt_mins: {
303
- type: Number,
304
- required: true,
305
- immutable: true,
306
- default: () => {
307
- const date = new Date();
308
- return Math.floor(date.getHours() * 60 + date.getMinutes());
309
- },
310
- },
311
- createdAt: {
312
- type: mongoose_1.Schema.Types.Date,
313
- required: true,
314
- default: () => new Date(),
315
- immutable: true,
316
- },
317
- updatedAt: {
318
- type: mongoose_1.Schema.Types.Date,
319
- required: true,
320
- default: () => new Date(),
321
- },
322
- }, {
323
- timestamps: true,
324
- versionKey: false,
325
- minimize: false,
326
- });
327
- exports.WAREHOUSE_INVOICES_COLLECTION_NAME = 'warehouse_invoices';
@@ -1,176 +0,0 @@
1
- import { Schema } from 'mongoose';
2
- export declare const VoidWarehouseInvoiceItemSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
3
- timestamps: true;
4
- versionKey: false;
5
- minimize: false;
6
- }, {
7
- createdAt: NativeDate;
8
- updatedAt: NativeDate;
9
- } & {
10
- _id: import("mongoose").Types.ObjectId;
11
- name: string;
12
- order_id: import("mongoose").Types.ObjectId;
13
- staff_id: string;
14
- staff_name: string;
15
- createdAt_mins: number;
16
- createdAt: NativeDate;
17
- updatedAt: NativeDate;
18
- description: string;
19
- order_number: number;
20
- warehouse_id: string;
21
- client_name: string;
22
- client_id: import("mongoose").Types.ObjectId;
23
- subtotal: number;
24
- item_id: import("mongoose").Types.ObjectId;
25
- void_reason: string;
26
- quantity: number;
27
- order_item_id: import("mongoose").Types.ObjectId;
28
- void_type: import("../../constants").VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
29
- iteration: number;
30
- total_adjusted_quantity: number;
31
- total_adjusted_subtotal: number;
32
- order_punched_at: NativeDate;
33
- adjustments?: import("mongoose").Types.DocumentArray<{
34
- _id: import("mongoose").Types.ObjectId;
35
- order_id: import("mongoose").Types.ObjectId;
36
- staff_id: string;
37
- staff_name: string;
38
- order_number: number;
39
- subtotal: number;
40
- quantity: number;
41
- order_item_id: import("mongoose").Types.ObjectId;
42
- }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
43
- _id: import("mongoose").Types.ObjectId;
44
- order_id: import("mongoose").Types.ObjectId;
45
- staff_id: string;
46
- staff_name: string;
47
- order_number: number;
48
- subtotal: number;
49
- quantity: number;
50
- order_item_id: import("mongoose").Types.ObjectId;
51
- }> & {
52
- _id: import("mongoose").Types.ObjectId;
53
- order_id: import("mongoose").Types.ObjectId;
54
- staff_id: string;
55
- staff_name: string;
56
- order_number: number;
57
- subtotal: number;
58
- quantity: number;
59
- order_item_id: import("mongoose").Types.ObjectId;
60
- }> | null | undefined;
61
- }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
62
- createdAt: NativeDate;
63
- updatedAt: NativeDate;
64
- } & {
65
- _id: import("mongoose").Types.ObjectId;
66
- name: string;
67
- order_id: import("mongoose").Types.ObjectId;
68
- staff_id: string;
69
- staff_name: string;
70
- createdAt_mins: number;
71
- createdAt: NativeDate;
72
- updatedAt: NativeDate;
73
- description: string;
74
- order_number: number;
75
- warehouse_id: string;
76
- client_name: string;
77
- client_id: import("mongoose").Types.ObjectId;
78
- subtotal: number;
79
- item_id: import("mongoose").Types.ObjectId;
80
- void_reason: string;
81
- quantity: number;
82
- order_item_id: import("mongoose").Types.ObjectId;
83
- void_type: import("../../constants").VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
84
- iteration: number;
85
- total_adjusted_quantity: number;
86
- total_adjusted_subtotal: number;
87
- order_punched_at: NativeDate;
88
- adjustments?: import("mongoose").Types.DocumentArray<{
89
- _id: import("mongoose").Types.ObjectId;
90
- order_id: import("mongoose").Types.ObjectId;
91
- staff_id: string;
92
- staff_name: string;
93
- order_number: number;
94
- subtotal: number;
95
- quantity: number;
96
- order_item_id: import("mongoose").Types.ObjectId;
97
- }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
98
- _id: import("mongoose").Types.ObjectId;
99
- order_id: import("mongoose").Types.ObjectId;
100
- staff_id: string;
101
- staff_name: string;
102
- order_number: number;
103
- subtotal: number;
104
- quantity: number;
105
- order_item_id: import("mongoose").Types.ObjectId;
106
- }> & {
107
- _id: import("mongoose").Types.ObjectId;
108
- order_id: import("mongoose").Types.ObjectId;
109
- staff_id: string;
110
- staff_name: string;
111
- order_number: number;
112
- subtotal: number;
113
- quantity: number;
114
- order_item_id: import("mongoose").Types.ObjectId;
115
- }> | null | undefined;
116
- }>> & import("mongoose").FlatRecord<{
117
- createdAt: NativeDate;
118
- updatedAt: NativeDate;
119
- } & {
120
- _id: import("mongoose").Types.ObjectId;
121
- name: string;
122
- order_id: import("mongoose").Types.ObjectId;
123
- staff_id: string;
124
- staff_name: string;
125
- createdAt_mins: number;
126
- createdAt: NativeDate;
127
- updatedAt: NativeDate;
128
- description: string;
129
- order_number: number;
130
- warehouse_id: string;
131
- client_name: string;
132
- client_id: import("mongoose").Types.ObjectId;
133
- subtotal: number;
134
- item_id: import("mongoose").Types.ObjectId;
135
- void_reason: string;
136
- quantity: number;
137
- order_item_id: import("mongoose").Types.ObjectId;
138
- void_type: import("../../constants").VOID_WAREHOUSE_INVOICE_ITEM_TYPE_ENUM;
139
- iteration: number;
140
- total_adjusted_quantity: number;
141
- total_adjusted_subtotal: number;
142
- order_punched_at: NativeDate;
143
- adjustments?: import("mongoose").Types.DocumentArray<{
144
- _id: import("mongoose").Types.ObjectId;
145
- order_id: import("mongoose").Types.ObjectId;
146
- staff_id: string;
147
- staff_name: string;
148
- order_number: number;
149
- subtotal: number;
150
- quantity: number;
151
- order_item_id: import("mongoose").Types.ObjectId;
152
- }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
153
- _id: import("mongoose").Types.ObjectId;
154
- order_id: import("mongoose").Types.ObjectId;
155
- staff_id: string;
156
- staff_name: string;
157
- order_number: number;
158
- subtotal: number;
159
- quantity: number;
160
- order_item_id: import("mongoose").Types.ObjectId;
161
- }> & {
162
- _id: import("mongoose").Types.ObjectId;
163
- order_id: import("mongoose").Types.ObjectId;
164
- staff_id: string;
165
- staff_name: string;
166
- order_number: number;
167
- subtotal: number;
168
- quantity: number;
169
- order_item_id: import("mongoose").Types.ObjectId;
170
- }> | null | undefined;
171
- }> & Required<{
172
- _id: import("mongoose").Types.ObjectId;
173
- }> & {
174
- __v: number;
175
- }>;
176
- export declare const WAREHOUSE_VOID_INVOICE_ITEMS_COLLECTION_NAME = "warehouse_void_invoice_items";
@@ -1,176 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WAREHOUSE_VOID_INVOICE_ITEMS_COLLECTION_NAME = exports.VoidWarehouseInvoiceItemSchema = void 0;
4
- const mongoose_1 = require("mongoose");
5
- const constants_1 = require("../../constants");
6
- const warehouse_clients_1 = require("./warehouse_clients");
7
- const warehouse_invoices_1 = require("./warehouse_invoices");
8
- const warehouses_1 = require("./warehouses");
9
- const VoidWarehouseInvoiceItemAdjustmentSchema = new mongoose_1.Schema({
10
- _id: {
11
- type: mongoose_1.Schema.Types.ObjectId,
12
- required: true,
13
- immutable: true,
14
- },
15
- order_id: {
16
- type: mongoose_1.Schema.Types.ObjectId,
17
- required: true,
18
- immutable: true,
19
- ref: warehouse_invoices_1.WAREHOUSE_INVOICES_COLLECTION_NAME,
20
- },
21
- order_number: {
22
- type: Number,
23
- min: 0,
24
- default: null,
25
- },
26
- order_item_id: {
27
- type: mongoose_1.Schema.Types.ObjectId,
28
- required: true,
29
- immutable: true,
30
- },
31
- quantity: {
32
- type: Number,
33
- required: true,
34
- },
35
- subtotal: {
36
- type: Number,
37
- min: 0,
38
- required: true,
39
- },
40
- staff_id: {
41
- type: String,
42
- required: true,
43
- },
44
- staff_name: {
45
- type: String,
46
- required: true,
47
- },
48
- }, {
49
- minimize: false,
50
- });
51
- exports.VoidWarehouseInvoiceItemSchema = new mongoose_1.Schema({
52
- _id: {
53
- type: mongoose_1.Schema.Types.ObjectId,
54
- required: true,
55
- immutable: true,
56
- },
57
- warehouse_id: {
58
- type: String,
59
- required: true,
60
- ref: warehouses_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
61
- immutable: true,
62
- },
63
- order_id: {
64
- type: mongoose_1.Schema.Types.ObjectId,
65
- required: true,
66
- immutable: true,
67
- ref: warehouse_invoices_1.WAREHOUSE_INVOICES_COLLECTION_NAME,
68
- },
69
- order_number: {
70
- type: Number,
71
- min: 0,
72
- default: null,
73
- },
74
- item_id: {
75
- type: mongoose_1.Schema.Types.ObjectId,
76
- required: true,
77
- immutable: true,
78
- ref: 'items',
79
- },
80
- order_item_id: {
81
- type: mongoose_1.Schema.Types.ObjectId,
82
- required: true,
83
- immutable: true,
84
- },
85
- void_type: {
86
- type: String,
87
- required: true,
88
- enum: constants_1.ALL_VOID_WAREHOUSE_INVOICE_ITEM_TYPE_NAMES,
89
- },
90
- client_id: {
91
- type: mongoose_1.Schema.Types.ObjectId,
92
- required: true,
93
- ref: warehouse_clients_1.WAREHOUSE_CLIENTS_COLLECTION_NAME,
94
- },
95
- client_name: {
96
- type: String,
97
- required: true,
98
- },
99
- staff_id: {
100
- type: String,
101
- required: true,
102
- },
103
- staff_name: {
104
- type: String,
105
- required: true,
106
- },
107
- void_reason: {
108
- type: String,
109
- required: true,
110
- },
111
- iteration: {
112
- type: Number,
113
- required: true,
114
- },
115
- name: {
116
- type: String,
117
- required: true,
118
- },
119
- quantity: {
120
- type: Number,
121
- required: true,
122
- },
123
- subtotal: {
124
- type: Number,
125
- min: 0,
126
- required: true,
127
- },
128
- description: {
129
- type: String,
130
- required: true,
131
- },
132
- total_adjusted_quantity: {
133
- type: Number,
134
- required: true,
135
- default: 0,
136
- },
137
- total_adjusted_subtotal: {
138
- type: Number,
139
- required: true,
140
- default: 0,
141
- },
142
- adjustments: {
143
- type: [VoidWarehouseInvoiceItemAdjustmentSchema],
144
- required: false,
145
- },
146
- order_punched_at: {
147
- type: mongoose_1.Schema.Types.Date,
148
- required: true,
149
- default: () => new Date(),
150
- },
151
- createdAt_mins: {
152
- type: Number,
153
- required: true,
154
- immutable: true,
155
- default: () => {
156
- const date = new Date();
157
- return Math.floor(date.getHours() * 60 + date.getMinutes());
158
- },
159
- },
160
- createdAt: {
161
- type: mongoose_1.Schema.Types.Date,
162
- required: true,
163
- default: () => new Date(),
164
- immutable: true,
165
- },
166
- updatedAt: {
167
- type: mongoose_1.Schema.Types.Date,
168
- required: true,
169
- default: () => new Date(),
170
- },
171
- }, {
172
- timestamps: true,
173
- versionKey: false,
174
- minimize: false,
175
- });
176
- exports.WAREHOUSE_VOID_INVOICE_ITEMS_COLLECTION_NAME = 'warehouse_void_invoice_items';
@@ -1,41 +0,0 @@
1
- import { INVENTORY_ITEM_UNIT_ENUM, INVENTORY_TRANSACTION_CATEGORY_ENUM, INVENTORY_TRANSACTION_TYPE_ENUM, WAREHOUSE_REF_TYPE_ENUM } from '../../constants';
2
- export interface IInventoryEntryActorRef {
3
- _id: string;
4
- name: string;
5
- }
6
- export interface IInventoryEntryPreparationEntry {
7
- usage_quantity: number;
8
- waste_quantity: number;
9
- unit_cost: number;
10
- final_cost: number;
11
- waste_cost: number;
12
- }
13
- export interface IInventoryEntryItem {
14
- _id: string;
15
- inventory_code: string;
16
- inventory_name: string;
17
- unit: INVENTORY_ITEM_UNIT_ENUM;
18
- transaction_type: INVENTORY_TRANSACTION_TYPE_ENUM;
19
- transaction_quantity: number;
20
- stock_price?: number;
21
- preparation?: Record<string, IInventoryEntryPreparationEntry> | null;
22
- }
23
- export interface IInventoryEntry {
24
- _id: string;
25
- ref_id: string;
26
- ref_type: WAREHOUSE_REF_TYPE_ENUM;
27
- /**
28
- * Set only for department utility operations — the tenant owns the stock and the
29
- * department is a sub-location inside it. Null for warehouse + tenant kitchen utilities.
30
- */
31
- department_code?: string | null;
32
- doc_number: string;
33
- transaction_category: INVENTORY_TRANSACTION_CATEGORY_ENUM;
34
- description?: string | null;
35
- items: IInventoryEntryItem[];
36
- total_items: number;
37
- total_stock_price: number;
38
- created_by: IInventoryEntryActorRef;
39
- createdAt: Date;
40
- updatedAt: Date;
41
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });