@managesome/eposmatic-toolkit 0.2.732 → 0.2.734

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.
@@ -62,6 +62,7 @@ export * from './tenant_instore_shifts';
62
62
  export * from './tenant_inventory_department_transactions';
63
63
  export * from './tenant_inventory_department_utilities';
64
64
  export * from './tenant_inventory_departments';
65
+ export * from './tenant_inventory_entries';
65
66
  export * from './tenant_metadata';
66
67
  export * from './tenant_purchase_order_vendor_returns';
67
68
  export * from './tenant_purchase_orders';
@@ -81,6 +82,7 @@ export * from './warehouse_categories';
81
82
  export * from './warehouse_clients';
82
83
  export * from './warehouse_communications';
83
84
  export * from './warehouse_internal_movements';
85
+ export * from './warehouse_inventory_entries';
84
86
  export * from './warehouse_inventory_lot_serial_numbers';
85
87
  export * from './warehouse_inventory_transactions';
86
88
  export * from './warehouse_item_transactions';
@@ -78,6 +78,7 @@ __exportStar(require("./tenant_instore_shifts"), exports);
78
78
  __exportStar(require("./tenant_inventory_department_transactions"), exports);
79
79
  __exportStar(require("./tenant_inventory_department_utilities"), exports);
80
80
  __exportStar(require("./tenant_inventory_departments"), exports);
81
+ __exportStar(require("./tenant_inventory_entries"), exports);
81
82
  __exportStar(require("./tenant_metadata"), exports);
82
83
  __exportStar(require("./tenant_purchase_order_vendor_returns"), exports);
83
84
  __exportStar(require("./tenant_purchase_orders"), exports);
@@ -97,6 +98,7 @@ __exportStar(require("./warehouse_categories"), exports);
97
98
  __exportStar(require("./warehouse_clients"), exports);
98
99
  __exportStar(require("./warehouse_communications"), exports);
99
100
  __exportStar(require("./warehouse_internal_movements"), exports);
101
+ __exportStar(require("./warehouse_inventory_entries"), exports);
100
102
  __exportStar(require("./warehouse_inventory_lot_serial_numbers"), exports);
101
103
  __exportStar(require("./warehouse_inventory_transactions"), exports);
102
104
  __exportStar(require("./warehouse_item_transactions"), exports);
@@ -0,0 +1,152 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const InventoryEntrySchema: 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
+ createdAt: NativeDate;
12
+ updatedAt: NativeDate;
13
+ items: import("mongoose").Types.DocumentArray<{
14
+ _id: import("mongoose").Types.ObjectId;
15
+ inventory_code: string;
16
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
17
+ transaction_quantity: number;
18
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
19
+ inventory_name: string;
20
+ stock_price?: number | null | undefined;
21
+ preparation?: any;
22
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
23
+ _id: import("mongoose").Types.ObjectId;
24
+ inventory_code: string;
25
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
26
+ transaction_quantity: number;
27
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
28
+ inventory_name: string;
29
+ stock_price?: number | null | undefined;
30
+ preparation?: any;
31
+ }> & {
32
+ _id: import("mongoose").Types.ObjectId;
33
+ inventory_code: string;
34
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
35
+ transaction_quantity: number;
36
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
37
+ inventory_name: string;
38
+ stock_price?: number | null | undefined;
39
+ preparation?: any;
40
+ }>;
41
+ ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
42
+ ref_id: string;
43
+ created_by: {
44
+ _id: string;
45
+ name: string;
46
+ };
47
+ doc_number: string;
48
+ total_items: number;
49
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
50
+ total_stock_price: number;
51
+ description?: string | null | undefined;
52
+ department_code?: string | null | undefined;
53
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
54
+ createdAt: NativeDate;
55
+ updatedAt: NativeDate;
56
+ } & {
57
+ _id: import("mongoose").Types.ObjectId;
58
+ createdAt: NativeDate;
59
+ updatedAt: NativeDate;
60
+ items: import("mongoose").Types.DocumentArray<{
61
+ _id: import("mongoose").Types.ObjectId;
62
+ inventory_code: string;
63
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
64
+ transaction_quantity: number;
65
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
66
+ inventory_name: string;
67
+ stock_price?: number | null | undefined;
68
+ preparation?: any;
69
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
70
+ _id: import("mongoose").Types.ObjectId;
71
+ inventory_code: string;
72
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
73
+ transaction_quantity: number;
74
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
75
+ inventory_name: string;
76
+ stock_price?: number | null | undefined;
77
+ preparation?: any;
78
+ }> & {
79
+ _id: import("mongoose").Types.ObjectId;
80
+ inventory_code: string;
81
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
82
+ transaction_quantity: number;
83
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
84
+ inventory_name: string;
85
+ stock_price?: number | null | undefined;
86
+ preparation?: any;
87
+ }>;
88
+ ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
89
+ ref_id: string;
90
+ created_by: {
91
+ _id: string;
92
+ name: string;
93
+ };
94
+ doc_number: string;
95
+ total_items: number;
96
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
97
+ total_stock_price: number;
98
+ description?: string | null | undefined;
99
+ department_code?: string | null | undefined;
100
+ }>> & import("mongoose").FlatRecord<{
101
+ createdAt: NativeDate;
102
+ updatedAt: NativeDate;
103
+ } & {
104
+ _id: import("mongoose").Types.ObjectId;
105
+ createdAt: NativeDate;
106
+ updatedAt: NativeDate;
107
+ items: import("mongoose").Types.DocumentArray<{
108
+ _id: import("mongoose").Types.ObjectId;
109
+ inventory_code: string;
110
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
111
+ transaction_quantity: number;
112
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
113
+ inventory_name: string;
114
+ stock_price?: number | null | undefined;
115
+ preparation?: any;
116
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
117
+ _id: import("mongoose").Types.ObjectId;
118
+ inventory_code: string;
119
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
120
+ transaction_quantity: number;
121
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
122
+ inventory_name: string;
123
+ stock_price?: number | null | undefined;
124
+ preparation?: any;
125
+ }> & {
126
+ _id: import("mongoose").Types.ObjectId;
127
+ inventory_code: string;
128
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
129
+ transaction_quantity: number;
130
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
131
+ inventory_name: string;
132
+ stock_price?: number | null | undefined;
133
+ preparation?: any;
134
+ }>;
135
+ ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
136
+ ref_id: string;
137
+ created_by: {
138
+ _id: string;
139
+ name: string;
140
+ };
141
+ doc_number: string;
142
+ total_items: number;
143
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
144
+ total_stock_price: number;
145
+ description?: string | null | undefined;
146
+ department_code?: string | null | undefined;
147
+ }> & Required<{
148
+ _id: import("mongoose").Types.ObjectId;
149
+ }> & {
150
+ __v: number;
151
+ }>;
152
+ export declare const INVENTORY_ENTRIES_COLLECTION_NAME = "inventory_entries";
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INVENTORY_ENTRIES_COLLECTION_NAME = exports.InventoryEntrySchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const constants_1 = require("../../constants");
6
+ const InventoryEntryActorSchema = new mongoose_1.Schema({
7
+ _id: {
8
+ type: String,
9
+ required: true,
10
+ },
11
+ name: {
12
+ type: String,
13
+ required: true,
14
+ default: '',
15
+ },
16
+ }, {
17
+ _id: false,
18
+ minimize: false,
19
+ });
20
+ const InventoryEntryItemSchema = new mongoose_1.Schema({
21
+ _id: {
22
+ type: mongoose_1.Schema.Types.ObjectId,
23
+ required: true,
24
+ immutable: true,
25
+ },
26
+ inventory_code: {
27
+ type: String,
28
+ required: true,
29
+ trim: true,
30
+ },
31
+ inventory_name: {
32
+ type: String,
33
+ required: true,
34
+ },
35
+ unit: {
36
+ type: String,
37
+ enum: constants_1.ALL_INVENTORY_UNIT_TYPES,
38
+ required: true,
39
+ },
40
+ transaction_type: {
41
+ type: String,
42
+ enum: constants_1.ALL_INVENTORY_TRANSACTION_TYPES,
43
+ required: true,
44
+ },
45
+ transaction_quantity: {
46
+ type: Number,
47
+ min: 0,
48
+ required: true,
49
+ },
50
+ stock_price: {
51
+ type: Number,
52
+ min: 0,
53
+ required: false,
54
+ },
55
+ preparation: {
56
+ type: mongoose_1.Schema.Types.Mixed,
57
+ required: false,
58
+ default: null,
59
+ },
60
+ }, {
61
+ _id: false,
62
+ minimize: false,
63
+ });
64
+ exports.InventoryEntrySchema = new mongoose_1.Schema({
65
+ _id: {
66
+ type: mongoose_1.Schema.Types.ObjectId,
67
+ required: true,
68
+ immutable: true,
69
+ },
70
+ ref_id: {
71
+ type: String,
72
+ required: true,
73
+ trim: true,
74
+ immutable: true,
75
+ },
76
+ ref_type: {
77
+ type: String,
78
+ enum: constants_1.ALL_WAREHOUSE_REF_TYPE_NAMES,
79
+ required: true,
80
+ immutable: true,
81
+ },
82
+ department_code: {
83
+ type: String,
84
+ required: false,
85
+ default: null,
86
+ immutable: true,
87
+ ref: 'tenant_inventory_departments',
88
+ },
89
+ doc_number: {
90
+ type: String,
91
+ required: true,
92
+ trim: true,
93
+ immutable: true,
94
+ },
95
+ transaction_category: {
96
+ type: String,
97
+ enum: constants_1.ALL_INVENTORY_TRANSACTION_CATEGORIES,
98
+ required: true,
99
+ immutable: true,
100
+ },
101
+ description: {
102
+ type: String,
103
+ required: false,
104
+ },
105
+ items: {
106
+ type: [InventoryEntryItemSchema],
107
+ required: true,
108
+ default: [],
109
+ },
110
+ total_items: {
111
+ type: Number,
112
+ min: 0,
113
+ required: true,
114
+ default: 0,
115
+ },
116
+ total_stock_price: {
117
+ type: Number,
118
+ min: 0,
119
+ required: true,
120
+ default: 0,
121
+ },
122
+ created_by: {
123
+ type: InventoryEntryActorSchema,
124
+ required: true,
125
+ },
126
+ createdAt: {
127
+ type: mongoose_1.Schema.Types.Date,
128
+ required: true,
129
+ default: () => new Date(),
130
+ immutable: true,
131
+ },
132
+ updatedAt: {
133
+ type: mongoose_1.Schema.Types.Date,
134
+ required: true,
135
+ default: () => new Date(),
136
+ },
137
+ }, {
138
+ timestamps: true,
139
+ versionKey: false,
140
+ minimize: false,
141
+ });
142
+ exports.INVENTORY_ENTRIES_COLLECTION_NAME = 'inventory_entries';
@@ -0,0 +1,149 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const TenantInventoryEntrySchema: 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
+ tenant_id: string;
12
+ createdAt: NativeDate;
13
+ updatedAt: NativeDate;
14
+ items: import("mongoose").Types.DocumentArray<{
15
+ _id: import("mongoose").Types.ObjectId;
16
+ inventory_code: string;
17
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
18
+ transaction_quantity: number;
19
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
20
+ inventory_name: string;
21
+ stock_price?: number | null | undefined;
22
+ preparation?: any;
23
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
24
+ _id: import("mongoose").Types.ObjectId;
25
+ inventory_code: string;
26
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
27
+ transaction_quantity: number;
28
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
29
+ inventory_name: string;
30
+ stock_price?: number | null | undefined;
31
+ preparation?: any;
32
+ }> & {
33
+ _id: import("mongoose").Types.ObjectId;
34
+ inventory_code: string;
35
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
36
+ transaction_quantity: number;
37
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
38
+ inventory_name: string;
39
+ stock_price?: number | null | undefined;
40
+ preparation?: any;
41
+ }>;
42
+ created_by: {
43
+ _id: string;
44
+ name: string;
45
+ };
46
+ doc_number: string;
47
+ total_items: number;
48
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
49
+ total_stock_price: number;
50
+ description?: string | null | undefined;
51
+ department_code?: string | null | undefined;
52
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
53
+ createdAt: NativeDate;
54
+ updatedAt: NativeDate;
55
+ } & {
56
+ _id: import("mongoose").Types.ObjectId;
57
+ tenant_id: string;
58
+ createdAt: NativeDate;
59
+ updatedAt: NativeDate;
60
+ items: import("mongoose").Types.DocumentArray<{
61
+ _id: import("mongoose").Types.ObjectId;
62
+ inventory_code: string;
63
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
64
+ transaction_quantity: number;
65
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
66
+ inventory_name: string;
67
+ stock_price?: number | null | undefined;
68
+ preparation?: any;
69
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
70
+ _id: import("mongoose").Types.ObjectId;
71
+ inventory_code: string;
72
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
73
+ transaction_quantity: number;
74
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
75
+ inventory_name: string;
76
+ stock_price?: number | null | undefined;
77
+ preparation?: any;
78
+ }> & {
79
+ _id: import("mongoose").Types.ObjectId;
80
+ inventory_code: string;
81
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
82
+ transaction_quantity: number;
83
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
84
+ inventory_name: string;
85
+ stock_price?: number | null | undefined;
86
+ preparation?: any;
87
+ }>;
88
+ created_by: {
89
+ _id: string;
90
+ name: string;
91
+ };
92
+ doc_number: string;
93
+ total_items: number;
94
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
95
+ total_stock_price: number;
96
+ description?: string | null | undefined;
97
+ department_code?: string | null | undefined;
98
+ }>> & import("mongoose").FlatRecord<{
99
+ createdAt: NativeDate;
100
+ updatedAt: NativeDate;
101
+ } & {
102
+ _id: import("mongoose").Types.ObjectId;
103
+ tenant_id: string;
104
+ createdAt: NativeDate;
105
+ updatedAt: NativeDate;
106
+ items: import("mongoose").Types.DocumentArray<{
107
+ _id: import("mongoose").Types.ObjectId;
108
+ inventory_code: string;
109
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
110
+ transaction_quantity: number;
111
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
112
+ inventory_name: string;
113
+ stock_price?: number | null | undefined;
114
+ preparation?: any;
115
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
116
+ _id: import("mongoose").Types.ObjectId;
117
+ inventory_code: string;
118
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
119
+ transaction_quantity: number;
120
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
121
+ inventory_name: string;
122
+ stock_price?: number | null | undefined;
123
+ preparation?: any;
124
+ }> & {
125
+ _id: import("mongoose").Types.ObjectId;
126
+ inventory_code: string;
127
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
128
+ transaction_quantity: number;
129
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
130
+ inventory_name: string;
131
+ stock_price?: number | null | undefined;
132
+ preparation?: any;
133
+ }>;
134
+ created_by: {
135
+ _id: string;
136
+ name: string;
137
+ };
138
+ doc_number: string;
139
+ total_items: number;
140
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
141
+ total_stock_price: number;
142
+ description?: string | null | undefined;
143
+ department_code?: string | null | undefined;
144
+ }> & Required<{
145
+ _id: import("mongoose").Types.ObjectId;
146
+ }> & {
147
+ __v: number;
148
+ }>;
149
+ export declare const TENANT_INVENTORY_ENTRIES_COLLECTION_NAME = "tenant_inventory_entries";
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TENANT_INVENTORY_ENTRIES_COLLECTION_NAME = exports.TenantInventoryEntrySchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const constants_1 = require("../../constants");
6
+ const TenantInventoryEntryActorSchema = new mongoose_1.Schema({
7
+ _id: {
8
+ type: String,
9
+ required: true,
10
+ },
11
+ name: {
12
+ type: String,
13
+ required: true,
14
+ default: '',
15
+ },
16
+ }, {
17
+ _id: false,
18
+ minimize: false,
19
+ });
20
+ const TenantInventoryEntryItemSchema = new mongoose_1.Schema({
21
+ _id: {
22
+ type: mongoose_1.Schema.Types.ObjectId,
23
+ required: true,
24
+ immutable: true,
25
+ },
26
+ inventory_code: {
27
+ type: String,
28
+ required: true,
29
+ trim: true,
30
+ },
31
+ inventory_name: {
32
+ type: String,
33
+ required: true,
34
+ },
35
+ unit: {
36
+ type: String,
37
+ enum: constants_1.ALL_INVENTORY_UNIT_TYPES,
38
+ required: true,
39
+ },
40
+ transaction_type: {
41
+ type: String,
42
+ enum: constants_1.ALL_INVENTORY_TRANSACTION_TYPES,
43
+ required: true,
44
+ },
45
+ transaction_quantity: {
46
+ type: Number,
47
+ min: 0,
48
+ required: true,
49
+ },
50
+ stock_price: {
51
+ type: Number,
52
+ min: 0,
53
+ required: false,
54
+ },
55
+ preparation: {
56
+ type: mongoose_1.Schema.Types.Mixed,
57
+ required: false,
58
+ default: null,
59
+ },
60
+ }, {
61
+ _id: false,
62
+ minimize: false,
63
+ });
64
+ exports.TenantInventoryEntrySchema = new mongoose_1.Schema({
65
+ _id: {
66
+ type: mongoose_1.Schema.Types.ObjectId,
67
+ required: true,
68
+ immutable: true,
69
+ },
70
+ tenant_id: {
71
+ type: String,
72
+ required: true,
73
+ trim: true,
74
+ immutable: true,
75
+ ref: 'tenants',
76
+ },
77
+ department_code: {
78
+ type: String,
79
+ required: false,
80
+ default: null,
81
+ immutable: true,
82
+ ref: 'tenant_inventory_departments',
83
+ },
84
+ doc_number: {
85
+ type: String,
86
+ required: true,
87
+ trim: true,
88
+ immutable: true,
89
+ },
90
+ transaction_category: {
91
+ type: String,
92
+ enum: constants_1.ALL_INVENTORY_TRANSACTION_CATEGORIES,
93
+ required: true,
94
+ immutable: true,
95
+ },
96
+ description: {
97
+ type: String,
98
+ required: false,
99
+ },
100
+ items: {
101
+ type: [TenantInventoryEntryItemSchema],
102
+ required: true,
103
+ default: [],
104
+ },
105
+ total_items: {
106
+ type: Number,
107
+ min: 0,
108
+ required: true,
109
+ default: 0,
110
+ },
111
+ total_stock_price: {
112
+ type: Number,
113
+ min: 0,
114
+ required: true,
115
+ default: 0,
116
+ },
117
+ created_by: {
118
+ type: TenantInventoryEntryActorSchema,
119
+ required: true,
120
+ },
121
+ createdAt: {
122
+ type: mongoose_1.Schema.Types.Date,
123
+ required: true,
124
+ default: () => new Date(),
125
+ immutable: true,
126
+ },
127
+ updatedAt: {
128
+ type: mongoose_1.Schema.Types.Date,
129
+ required: true,
130
+ default: () => new Date(),
131
+ },
132
+ }, {
133
+ timestamps: true,
134
+ versionKey: false,
135
+ minimize: false,
136
+ });
137
+ exports.TENANT_INVENTORY_ENTRIES_COLLECTION_NAME = 'tenant_inventory_entries';
@@ -0,0 +1,146 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const WarehouseInventoryEntrySchema: 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
+ createdAt: NativeDate;
12
+ updatedAt: NativeDate;
13
+ items: import("mongoose").Types.DocumentArray<{
14
+ _id: import("mongoose").Types.ObjectId;
15
+ inventory_code: string;
16
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
17
+ transaction_quantity: number;
18
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
19
+ inventory_name: string;
20
+ stock_price?: number | null | undefined;
21
+ preparation?: any;
22
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
23
+ _id: import("mongoose").Types.ObjectId;
24
+ inventory_code: string;
25
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
26
+ transaction_quantity: number;
27
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
28
+ inventory_name: string;
29
+ stock_price?: number | null | undefined;
30
+ preparation?: any;
31
+ }> & {
32
+ _id: import("mongoose").Types.ObjectId;
33
+ inventory_code: string;
34
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
35
+ transaction_quantity: number;
36
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
37
+ inventory_name: string;
38
+ stock_price?: number | null | undefined;
39
+ preparation?: any;
40
+ }>;
41
+ warehouse_id: string;
42
+ created_by: {
43
+ _id: string;
44
+ name: string;
45
+ };
46
+ doc_number: string;
47
+ total_items: number;
48
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
49
+ total_stock_price: number;
50
+ description?: string | null | undefined;
51
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
52
+ createdAt: NativeDate;
53
+ updatedAt: NativeDate;
54
+ } & {
55
+ _id: import("mongoose").Types.ObjectId;
56
+ createdAt: NativeDate;
57
+ updatedAt: NativeDate;
58
+ items: import("mongoose").Types.DocumentArray<{
59
+ _id: import("mongoose").Types.ObjectId;
60
+ inventory_code: string;
61
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
62
+ transaction_quantity: number;
63
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
64
+ inventory_name: string;
65
+ stock_price?: number | null | undefined;
66
+ preparation?: any;
67
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
68
+ _id: import("mongoose").Types.ObjectId;
69
+ inventory_code: string;
70
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
71
+ transaction_quantity: number;
72
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
73
+ inventory_name: string;
74
+ stock_price?: number | null | undefined;
75
+ preparation?: any;
76
+ }> & {
77
+ _id: import("mongoose").Types.ObjectId;
78
+ inventory_code: string;
79
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
80
+ transaction_quantity: number;
81
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
82
+ inventory_name: string;
83
+ stock_price?: number | null | undefined;
84
+ preparation?: any;
85
+ }>;
86
+ warehouse_id: string;
87
+ created_by: {
88
+ _id: string;
89
+ name: string;
90
+ };
91
+ doc_number: string;
92
+ total_items: number;
93
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
94
+ total_stock_price: number;
95
+ description?: string | null | undefined;
96
+ }>> & import("mongoose").FlatRecord<{
97
+ createdAt: NativeDate;
98
+ updatedAt: NativeDate;
99
+ } & {
100
+ _id: import("mongoose").Types.ObjectId;
101
+ createdAt: NativeDate;
102
+ updatedAt: NativeDate;
103
+ items: import("mongoose").Types.DocumentArray<{
104
+ _id: import("mongoose").Types.ObjectId;
105
+ inventory_code: string;
106
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
107
+ transaction_quantity: number;
108
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
109
+ inventory_name: string;
110
+ stock_price?: number | null | undefined;
111
+ preparation?: any;
112
+ }, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
113
+ _id: import("mongoose").Types.ObjectId;
114
+ inventory_code: string;
115
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
116
+ transaction_quantity: number;
117
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
118
+ inventory_name: string;
119
+ stock_price?: number | null | undefined;
120
+ preparation?: any;
121
+ }> & {
122
+ _id: import("mongoose").Types.ObjectId;
123
+ inventory_code: string;
124
+ unit: import("../../constants").INVENTORY_ITEM_UNIT_ENUM;
125
+ transaction_quantity: number;
126
+ transaction_type: import("../../constants").INVENTORY_TRANSACTION_TYPE_ENUM;
127
+ inventory_name: string;
128
+ stock_price?: number | null | undefined;
129
+ preparation?: any;
130
+ }>;
131
+ warehouse_id: string;
132
+ created_by: {
133
+ _id: string;
134
+ name: string;
135
+ };
136
+ doc_number: string;
137
+ total_items: number;
138
+ transaction_category: import("../../constants").INVENTORY_TRANSACTION_CATEGORY_ENUM;
139
+ total_stock_price: number;
140
+ description?: string | null | undefined;
141
+ }> & Required<{
142
+ _id: import("mongoose").Types.ObjectId;
143
+ }> & {
144
+ __v: number;
145
+ }>;
146
+ export declare const WAREHOUSE_INVENTORY_ENTRIES_COLLECTION_NAME = "warehouse_inventory_entries";
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WAREHOUSE_INVENTORY_ENTRIES_COLLECTION_NAME = exports.WarehouseInventoryEntrySchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const constants_1 = require("../../constants");
6
+ const WarehouseInventoryEntryActorSchema = new mongoose_1.Schema({
7
+ _id: {
8
+ type: String,
9
+ required: true,
10
+ },
11
+ name: {
12
+ type: String,
13
+ required: true,
14
+ default: '',
15
+ },
16
+ }, {
17
+ _id: false,
18
+ minimize: false,
19
+ });
20
+ const WarehouseInventoryEntryItemSchema = new mongoose_1.Schema({
21
+ _id: {
22
+ type: mongoose_1.Schema.Types.ObjectId,
23
+ required: true,
24
+ immutable: true,
25
+ },
26
+ inventory_code: {
27
+ type: String,
28
+ required: true,
29
+ trim: true,
30
+ },
31
+ inventory_name: {
32
+ type: String,
33
+ required: true,
34
+ },
35
+ unit: {
36
+ type: String,
37
+ enum: constants_1.ALL_INVENTORY_UNIT_TYPES,
38
+ required: true,
39
+ },
40
+ transaction_type: {
41
+ type: String,
42
+ enum: constants_1.ALL_INVENTORY_TRANSACTION_TYPES,
43
+ required: true,
44
+ },
45
+ transaction_quantity: {
46
+ type: Number,
47
+ min: 0,
48
+ required: true,
49
+ },
50
+ stock_price: {
51
+ type: Number,
52
+ min: 0,
53
+ required: false,
54
+ },
55
+ preparation: {
56
+ type: mongoose_1.Schema.Types.Mixed,
57
+ required: false,
58
+ default: null,
59
+ },
60
+ }, {
61
+ _id: false,
62
+ minimize: false,
63
+ });
64
+ exports.WarehouseInventoryEntrySchema = new mongoose_1.Schema({
65
+ _id: {
66
+ type: mongoose_1.Schema.Types.ObjectId,
67
+ required: true,
68
+ immutable: true,
69
+ },
70
+ warehouse_id: {
71
+ type: String,
72
+ required: true,
73
+ trim: true,
74
+ immutable: true,
75
+ ref: 'tenants',
76
+ },
77
+ doc_number: {
78
+ type: String,
79
+ required: true,
80
+ trim: true,
81
+ immutable: true,
82
+ },
83
+ transaction_category: {
84
+ type: String,
85
+ enum: constants_1.ALL_INVENTORY_TRANSACTION_CATEGORIES,
86
+ required: true,
87
+ immutable: true,
88
+ },
89
+ description: {
90
+ type: String,
91
+ required: false,
92
+ },
93
+ items: {
94
+ type: [WarehouseInventoryEntryItemSchema],
95
+ required: true,
96
+ default: [],
97
+ },
98
+ total_items: {
99
+ type: Number,
100
+ min: 0,
101
+ required: true,
102
+ default: 0,
103
+ },
104
+ total_stock_price: {
105
+ type: Number,
106
+ min: 0,
107
+ required: true,
108
+ default: 0,
109
+ },
110
+ created_by: {
111
+ type: WarehouseInventoryEntryActorSchema,
112
+ required: true,
113
+ },
114
+ createdAt: {
115
+ type: mongoose_1.Schema.Types.Date,
116
+ required: true,
117
+ default: () => new Date(),
118
+ immutable: true,
119
+ },
120
+ updatedAt: {
121
+ type: mongoose_1.Schema.Types.Date,
122
+ required: true,
123
+ default: () => new Date(),
124
+ },
125
+ }, {
126
+ timestamps: true,
127
+ versionKey: false,
128
+ minimize: false,
129
+ });
130
+ exports.WAREHOUSE_INVENTORY_ENTRIES_COLLECTION_NAME = 'warehouse_inventory_entries';
@@ -66,6 +66,7 @@ export * from './tenant_hr_shift_schedules';
66
66
  export * from './tenant_hr_shifts';
67
67
  export * from './tenant_instore_shift_sessions';
68
68
  export * from './tenant_instore_shifts';
69
+ export * from './tenant_inventory_entries';
69
70
  export * from './tenant_metadata';
70
71
  export * from './tenant_purchase_order_vendor_returns';
71
72
  export * from './tenant_purchase_orders';
@@ -85,6 +86,7 @@ export * from './warehouse_categories';
85
86
  export * from './warehouse_clients';
86
87
  export * from './warehouse_communications';
87
88
  export * from './warehouse_internal_movements';
89
+ export * from './warehouse_inventory_entries';
88
90
  export * from './warehouse_inventory_lot_serial_numbers';
89
91
  export * from './warehouse_inventory_transactions';
90
92
  export * from './warehouse_item_transactions';
@@ -82,6 +82,7 @@ __exportStar(require("./tenant_hr_shift_schedules"), exports);
82
82
  __exportStar(require("./tenant_hr_shifts"), exports);
83
83
  __exportStar(require("./tenant_instore_shift_sessions"), exports);
84
84
  __exportStar(require("./tenant_instore_shifts"), exports);
85
+ __exportStar(require("./tenant_inventory_entries"), exports);
85
86
  __exportStar(require("./tenant_metadata"), exports);
86
87
  __exportStar(require("./tenant_purchase_order_vendor_returns"), exports);
87
88
  __exportStar(require("./tenant_purchase_orders"), exports);
@@ -101,6 +102,7 @@ __exportStar(require("./warehouse_categories"), exports);
101
102
  __exportStar(require("./warehouse_clients"), exports);
102
103
  __exportStar(require("./warehouse_communications"), exports);
103
104
  __exportStar(require("./warehouse_internal_movements"), exports);
105
+ __exportStar(require("./warehouse_inventory_entries"), exports);
104
106
  __exportStar(require("./warehouse_inventory_lot_serial_numbers"), exports);
105
107
  __exportStar(require("./warehouse_inventory_transactions"), exports);
106
108
  __exportStar(require("./warehouse_item_transactions"), exports);
@@ -0,0 +1,41 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,39 @@
1
+ import { INVENTORY_ITEM_UNIT_ENUM, INVENTORY_TRANSACTION_CATEGORY_ENUM, INVENTORY_TRANSACTION_TYPE_ENUM } from '../../constants';
2
+ export interface ITenantInventoryEntryActorRef {
3
+ _id: string;
4
+ name: string;
5
+ }
6
+ export interface ITenantInventoryEntryPreparationEntry {
7
+ usage_quantity: number;
8
+ waste_quantity: number;
9
+ unit_cost: number;
10
+ final_cost: number;
11
+ waste_cost: number;
12
+ }
13
+ export interface ITenantInventoryEntryItem {
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, ITenantInventoryEntryPreparationEntry> | null;
22
+ }
23
+ export interface ITenantInventoryEntry {
24
+ _id: string;
25
+ tenant_id: string;
26
+ /**
27
+ * Set only for department utility operations — null for the tenant's kitchen utility.
28
+ */
29
+ department_code?: string | null;
30
+ doc_number: string;
31
+ transaction_category: INVENTORY_TRANSACTION_CATEGORY_ENUM;
32
+ description?: string | null;
33
+ items: ITenantInventoryEntryItem[];
34
+ total_items: number;
35
+ total_stock_price: number;
36
+ created_by: ITenantInventoryEntryActorRef;
37
+ createdAt: Date;
38
+ updatedAt: Date;
39
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ import { INVENTORY_ITEM_UNIT_ENUM, INVENTORY_TRANSACTION_CATEGORY_ENUM, INVENTORY_TRANSACTION_TYPE_ENUM } from '../../constants';
2
+ export interface IWarehouseInventoryEntryActorRef {
3
+ _id: string;
4
+ name: string;
5
+ }
6
+ export interface IWarehouseInventoryEntryPreparationEntry {
7
+ usage_quantity: number;
8
+ waste_quantity: number;
9
+ unit_cost: number;
10
+ final_cost: number;
11
+ waste_cost: number;
12
+ }
13
+ export interface IWarehouseInventoryEntryItem {
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, IWarehouseInventoryEntryPreparationEntry> | null;
22
+ }
23
+ export interface IWarehouseInventoryEntry {
24
+ _id: string;
25
+ warehouse_id: string;
26
+ doc_number: string;
27
+ transaction_category: INVENTORY_TRANSACTION_CATEGORY_ENUM;
28
+ description?: string | null;
29
+ items: IWarehouseInventoryEntryItem[];
30
+ total_items: number;
31
+ total_stock_price: number;
32
+ created_by: IWarehouseInventoryEntryActorRef;
33
+ createdAt: Date;
34
+ updatedAt: Date;
35
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.732",
3
+ "version": "0.2.734",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",