@managesome/eposmatic-toolkit 0.2.732 → 0.2.733

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.
@@ -23,6 +23,7 @@ export * from './internal_operational_roles';
23
23
  export * from './internal_staffs';
24
24
  export * from './inventories';
25
25
  export * from './inventory_categories';
26
+ export * from './inventory_entries';
26
27
  export * from './inventory_transactions';
27
28
  export * from './item_transactions';
28
29
  export * from './items';
@@ -39,6 +39,7 @@ __exportStar(require("./internal_operational_roles"), exports);
39
39
  __exportStar(require("./internal_staffs"), exports);
40
40
  __exportStar(require("./inventories"), exports);
41
41
  __exportStar(require("./inventory_categories"), exports);
42
+ __exportStar(require("./inventory_entries"), exports);
42
43
  __exportStar(require("./inventory_transactions"), exports);
43
44
  __exportStar(require("./item_transactions"), exports);
44
45
  __exportStar(require("./items"), 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';
@@ -28,6 +28,7 @@ export * from './inventory_categories';
28
28
  export * from './inventory_department_transactions';
29
29
  export * from './inventory_department_utilities';
30
30
  export * from './inventory_departments';
31
+ export * from './inventory_entries';
31
32
  export * from './inventory_transactions';
32
33
  export * from './item_transactions';
33
34
  export * from './items';
@@ -44,6 +44,7 @@ __exportStar(require("./inventory_categories"), exports);
44
44
  __exportStar(require("./inventory_department_transactions"), exports);
45
45
  __exportStar(require("./inventory_department_utilities"), exports);
46
46
  __exportStar(require("./inventory_departments"), exports);
47
+ __exportStar(require("./inventory_entries"), exports);
47
48
  __exportStar(require("./inventory_transactions"), exports);
48
49
  __exportStar(require("./item_transactions"), exports);
49
50
  __exportStar(require("./items"), 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 });
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.733",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",