@managesome/eposmatic-toolkit 0.2.439 → 0.2.441
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/RFQ.d.ts +0 -37
- package/lib/constants/RFQ.js +0 -85
- package/lib/constants/TENANT_ENUMS.d.ts +17 -0
- package/lib/constants/TENANT_ENUMS.js +24 -0
- package/lib/constants/TENANT_PURCHASE_ORDER.d.ts +16 -0
- package/lib/constants/TENANT_PURCHASE_ORDER.js +94 -0
- package/lib/constants/index.d.ts +3 -2
- package/lib/constants/index.js +3 -2
- package/lib/helpers/store/all-warehouse-purchase-order-rfqs-actions.d.ts +17 -0
- package/lib/helpers/store/all-warehouse-purchase-order-rfqs-actions.js +73 -0
- package/lib/helpers/store/all-warehouse-sale-order-rfqs-actions.d.ts +17 -0
- package/lib/helpers/store/all-warehouse-sale-order-rfqs-actions.js +73 -0
- package/lib/helpers/store/common-warehouse-purchase-order-rfq-actions.d.ts +30 -0
- package/lib/helpers/store/common-warehouse-purchase-order-rfq-actions.js +537 -0
- package/lib/helpers/store/common-warehouse-sale-order-rfq-actions.d.ts +5 -0
- package/lib/helpers/store/common-warehouse-sale-order-rfq-actions.js +60 -0
- package/lib/helpers/store/index.d.ts +7 -3
- package/lib/helpers/store/index.js +7 -3
- package/lib/helpers/types/index.d.ts +1 -0
- package/lib/helpers/types/index.js +1 -0
- package/lib/helpers/types/warehouse-purchase-order-rfq-cart-actions.d.ts +26 -0
- package/lib/helpers/types/warehouse-purchase-order-rfq-cart-actions.js +2 -0
- package/lib/schemas/models/index.d.ts +2 -0
- package/lib/schemas/models/index.js +2 -0
- package/lib/schemas/models/tenant_purchase_order_vendor_returns.d.ts +219 -0
- package/lib/schemas/models/tenant_purchase_order_vendor_returns.js +83 -0
- package/lib/schemas/models/tenant_purchase_orders.d.ts +2783 -0
- package/lib/schemas/models/tenant_purchase_orders.js +138 -0
- package/lib/schemas/models/warehouse_purchase_order_receipts.d.ts +9 -9
- package/lib/schemas/models/warehouse_purchase_order_vendor_returns.d.ts +12 -12
- package/lib/schemas/types/index.d.ts +2 -0
- package/lib/schemas/types/index.js +2 -0
- package/lib/schemas/types/tenant_purchase_order_vendor_returns.d.ts +46 -0
- package/lib/schemas/types/tenant_purchase_order_vendor_returns.js +2 -0
- package/lib/schemas/types/tenant_purchase_orders.d.ts +61 -0
- package/lib/schemas/types/tenant_purchase_orders.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IWarehousePurchaseOrderRFQItem } from '../../schemas';
|
|
2
|
+
export interface IWarehouseGeneralPurchaseOrderRfqItem {
|
|
3
|
+
_id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
category_id: string;
|
|
6
|
+
category_name: string;
|
|
7
|
+
category_image_url: string | null;
|
|
8
|
+
image_url: string | null;
|
|
9
|
+
description: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IWarehousePurchaseOrderRfqCartItem {
|
|
12
|
+
orderItem: IWarehousePurchaseOrderRFQItem;
|
|
13
|
+
image_url: string | null;
|
|
14
|
+
description: string;
|
|
15
|
+
category_name: string;
|
|
16
|
+
category_id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IWarehousePurchaseOrderRfqCartItemsObj {
|
|
19
|
+
unChangedItems: IWarehousePurchaseOrderRfqCartItem[];
|
|
20
|
+
editedItems: IWarehousePurchaseOrderRfqCartItem[];
|
|
21
|
+
removedItems: IWarehousePurchaseOrderRfqCartItem[];
|
|
22
|
+
newItems: IWarehousePurchaseOrderRfqCartItem[];
|
|
23
|
+
totalSelectedItems: number;
|
|
24
|
+
disabledReason: string;
|
|
25
|
+
isAnUpdate: boolean;
|
|
26
|
+
}
|
|
@@ -48,6 +48,8 @@ export * from './specials';
|
|
|
48
48
|
export * from './staff_shifts';
|
|
49
49
|
export * from './tenant_days';
|
|
50
50
|
export * from './tenant_metadata';
|
|
51
|
+
export * from './tenant_purchase_order_vendor_returns';
|
|
52
|
+
export * from './tenant_purchase_orders';
|
|
51
53
|
export * from './tenant_shifts';
|
|
52
54
|
export * from './tenant_staffs';
|
|
53
55
|
export * from './tenant_vendors';
|
|
@@ -64,6 +64,8 @@ __exportStar(require("./specials"), exports);
|
|
|
64
64
|
__exportStar(require("./staff_shifts"), exports);
|
|
65
65
|
__exportStar(require("./tenant_days"), exports);
|
|
66
66
|
__exportStar(require("./tenant_metadata"), exports);
|
|
67
|
+
__exportStar(require("./tenant_purchase_order_vendor_returns"), exports);
|
|
68
|
+
__exportStar(require("./tenant_purchase_orders"), exports);
|
|
67
69
|
__exportStar(require("./tenant_shifts"), exports);
|
|
68
70
|
__exportStar(require("./tenant_staffs"), exports);
|
|
69
71
|
__exportStar(require("./tenant_vendors"), exports);
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM } from '../../constants';
|
|
3
|
+
export declare const TenantPurchaseOrderVendorReturnsSchema: 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
|
+
tenant_id: string;
|
|
13
|
+
createdAt_mins: number;
|
|
14
|
+
createdAt: NativeDate;
|
|
15
|
+
updatedAt: NativeDate;
|
|
16
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
17
|
+
_id: import("mongoose").Types.ObjectId;
|
|
18
|
+
name: string;
|
|
19
|
+
price: number;
|
|
20
|
+
subtotal: number;
|
|
21
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
22
|
+
return_quantity: number;
|
|
23
|
+
ordered_quantity: number;
|
|
24
|
+
reason?: string | null | undefined;
|
|
25
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
26
|
+
_id: import("mongoose").Types.ObjectId;
|
|
27
|
+
name: string;
|
|
28
|
+
price: number;
|
|
29
|
+
subtotal: number;
|
|
30
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
31
|
+
return_quantity: number;
|
|
32
|
+
ordered_quantity: number;
|
|
33
|
+
reason?: string | null | undefined;
|
|
34
|
+
}> & {
|
|
35
|
+
_id: import("mongoose").Types.ObjectId;
|
|
36
|
+
name: string;
|
|
37
|
+
price: number;
|
|
38
|
+
subtotal: number;
|
|
39
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
40
|
+
return_quantity: number;
|
|
41
|
+
ordered_quantity: number;
|
|
42
|
+
reason?: string | null | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
vendor_name: string;
|
|
45
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
46
|
+
tenant_purchase_order_id: import("mongoose").Types.ObjectId;
|
|
47
|
+
return_status: TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM;
|
|
48
|
+
inventory_consumed: boolean;
|
|
49
|
+
total_return_amount: number;
|
|
50
|
+
cancel_reason?: string | null | undefined;
|
|
51
|
+
notes?: string | null | undefined;
|
|
52
|
+
created_by?: {
|
|
53
|
+
_id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
} | null | undefined;
|
|
56
|
+
approved_at?: NativeDate | null | undefined;
|
|
57
|
+
dispatched_at?: NativeDate | null | undefined;
|
|
58
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
59
|
+
approved_by?: {
|
|
60
|
+
_id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
} | null | undefined;
|
|
63
|
+
dispatched_by?: {
|
|
64
|
+
_id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
} | null | undefined;
|
|
67
|
+
cancelled_by?: {
|
|
68
|
+
_id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
} | null | undefined;
|
|
71
|
+
completed_by?: {
|
|
72
|
+
_id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
} | null | undefined;
|
|
75
|
+
completed_at?: NativeDate | null | undefined;
|
|
76
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
77
|
+
createdAt: NativeDate;
|
|
78
|
+
updatedAt: NativeDate;
|
|
79
|
+
} & {
|
|
80
|
+
_id: import("mongoose").Types.ObjectId;
|
|
81
|
+
tenant_id: string;
|
|
82
|
+
createdAt_mins: number;
|
|
83
|
+
createdAt: NativeDate;
|
|
84
|
+
updatedAt: NativeDate;
|
|
85
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
86
|
+
_id: import("mongoose").Types.ObjectId;
|
|
87
|
+
name: string;
|
|
88
|
+
price: number;
|
|
89
|
+
subtotal: number;
|
|
90
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
91
|
+
return_quantity: number;
|
|
92
|
+
ordered_quantity: number;
|
|
93
|
+
reason?: string | null | undefined;
|
|
94
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
95
|
+
_id: import("mongoose").Types.ObjectId;
|
|
96
|
+
name: string;
|
|
97
|
+
price: number;
|
|
98
|
+
subtotal: number;
|
|
99
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
100
|
+
return_quantity: number;
|
|
101
|
+
ordered_quantity: number;
|
|
102
|
+
reason?: string | null | undefined;
|
|
103
|
+
}> & {
|
|
104
|
+
_id: import("mongoose").Types.ObjectId;
|
|
105
|
+
name: string;
|
|
106
|
+
price: number;
|
|
107
|
+
subtotal: number;
|
|
108
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
109
|
+
return_quantity: number;
|
|
110
|
+
ordered_quantity: number;
|
|
111
|
+
reason?: string | null | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
vendor_name: string;
|
|
114
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
115
|
+
tenant_purchase_order_id: import("mongoose").Types.ObjectId;
|
|
116
|
+
return_status: TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM;
|
|
117
|
+
inventory_consumed: boolean;
|
|
118
|
+
total_return_amount: number;
|
|
119
|
+
cancel_reason?: string | null | undefined;
|
|
120
|
+
notes?: string | null | undefined;
|
|
121
|
+
created_by?: {
|
|
122
|
+
_id: string;
|
|
123
|
+
name: string;
|
|
124
|
+
} | null | undefined;
|
|
125
|
+
approved_at?: NativeDate | null | undefined;
|
|
126
|
+
dispatched_at?: NativeDate | null | undefined;
|
|
127
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
128
|
+
approved_by?: {
|
|
129
|
+
_id: string;
|
|
130
|
+
name: string;
|
|
131
|
+
} | null | undefined;
|
|
132
|
+
dispatched_by?: {
|
|
133
|
+
_id: string;
|
|
134
|
+
name: string;
|
|
135
|
+
} | null | undefined;
|
|
136
|
+
cancelled_by?: {
|
|
137
|
+
_id: string;
|
|
138
|
+
name: string;
|
|
139
|
+
} | null | undefined;
|
|
140
|
+
completed_by?: {
|
|
141
|
+
_id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
} | null | undefined;
|
|
144
|
+
completed_at?: NativeDate | null | undefined;
|
|
145
|
+
}>> & import("mongoose").FlatRecord<{
|
|
146
|
+
createdAt: NativeDate;
|
|
147
|
+
updatedAt: NativeDate;
|
|
148
|
+
} & {
|
|
149
|
+
_id: import("mongoose").Types.ObjectId;
|
|
150
|
+
tenant_id: string;
|
|
151
|
+
createdAt_mins: number;
|
|
152
|
+
createdAt: NativeDate;
|
|
153
|
+
updatedAt: NativeDate;
|
|
154
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
155
|
+
_id: import("mongoose").Types.ObjectId;
|
|
156
|
+
name: string;
|
|
157
|
+
price: number;
|
|
158
|
+
subtotal: number;
|
|
159
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
160
|
+
return_quantity: number;
|
|
161
|
+
ordered_quantity: number;
|
|
162
|
+
reason?: string | null | undefined;
|
|
163
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
164
|
+
_id: import("mongoose").Types.ObjectId;
|
|
165
|
+
name: string;
|
|
166
|
+
price: number;
|
|
167
|
+
subtotal: number;
|
|
168
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
169
|
+
return_quantity: number;
|
|
170
|
+
ordered_quantity: number;
|
|
171
|
+
reason?: string | null | undefined;
|
|
172
|
+
}> & {
|
|
173
|
+
_id: import("mongoose").Types.ObjectId;
|
|
174
|
+
name: string;
|
|
175
|
+
price: number;
|
|
176
|
+
subtotal: number;
|
|
177
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
178
|
+
return_quantity: number;
|
|
179
|
+
ordered_quantity: number;
|
|
180
|
+
reason?: string | null | undefined;
|
|
181
|
+
}>;
|
|
182
|
+
vendor_name: string;
|
|
183
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
184
|
+
tenant_purchase_order_id: import("mongoose").Types.ObjectId;
|
|
185
|
+
return_status: TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM;
|
|
186
|
+
inventory_consumed: boolean;
|
|
187
|
+
total_return_amount: number;
|
|
188
|
+
cancel_reason?: string | null | undefined;
|
|
189
|
+
notes?: string | null | undefined;
|
|
190
|
+
created_by?: {
|
|
191
|
+
_id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
} | null | undefined;
|
|
194
|
+
approved_at?: NativeDate | null | undefined;
|
|
195
|
+
dispatched_at?: NativeDate | null | undefined;
|
|
196
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
197
|
+
approved_by?: {
|
|
198
|
+
_id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
} | null | undefined;
|
|
201
|
+
dispatched_by?: {
|
|
202
|
+
_id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
} | null | undefined;
|
|
205
|
+
cancelled_by?: {
|
|
206
|
+
_id: string;
|
|
207
|
+
name: string;
|
|
208
|
+
} | null | undefined;
|
|
209
|
+
completed_by?: {
|
|
210
|
+
_id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
} | null | undefined;
|
|
213
|
+
completed_at?: NativeDate | null | undefined;
|
|
214
|
+
}> & Required<{
|
|
215
|
+
_id: import("mongoose").Types.ObjectId;
|
|
216
|
+
}> & {
|
|
217
|
+
__v: number;
|
|
218
|
+
}>;
|
|
219
|
+
export declare const TENANT_PURCHASE_ORDER_VENDOR_RETURNS_COLLECTION_NAME = "tenant_purchase_order_vendor_returns";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TENANT_PURCHASE_ORDER_VENDOR_RETURNS_COLLECTION_NAME = exports.TenantPurchaseOrderVendorReturnsSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const tenant_purchase_orders_1 = require("./tenant_purchase_orders");
|
|
7
|
+
const warehouse_items_1 = require("./warehouse_items");
|
|
8
|
+
const warehouse_vendors_1 = require("./warehouse_vendors");
|
|
9
|
+
const VendorReturnActorSchema = new mongoose_1.Schema({
|
|
10
|
+
_id: { type: String, required: true },
|
|
11
|
+
name: { type: String, required: true, default: '' },
|
|
12
|
+
}, { _id: false, minimize: false });
|
|
13
|
+
const VendorReturnItemsSchema = new mongoose_1.Schema({
|
|
14
|
+
_id: { type: mongoose_1.Schema.Types.ObjectId, required: true, immutable: true },
|
|
15
|
+
item_id: {
|
|
16
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
17
|
+
required: true,
|
|
18
|
+
immutable: true,
|
|
19
|
+
ref: warehouse_items_1.WAREHOUSE_ITEMS_COLLECTION_NAME,
|
|
20
|
+
},
|
|
21
|
+
name: { type: String, required: true },
|
|
22
|
+
ordered_quantity: { type: Number, min: 0, required: true },
|
|
23
|
+
return_quantity: { type: Number, min: 0, required: true },
|
|
24
|
+
price: { type: Number, min: 0, required: true },
|
|
25
|
+
subtotal: { type: Number, min: 0, required: true },
|
|
26
|
+
reason: { type: String, required: false },
|
|
27
|
+
}, { _id: false, minimize: false });
|
|
28
|
+
exports.TenantPurchaseOrderVendorReturnsSchema = new mongoose_1.Schema({
|
|
29
|
+
_id: { type: mongoose_1.Schema.Types.ObjectId, required: true, immutable: true },
|
|
30
|
+
tenant_id: { type: String, required: true, ref: 'tenants' },
|
|
31
|
+
tenant_purchase_order_id: {
|
|
32
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
33
|
+
required: true,
|
|
34
|
+
ref: tenant_purchase_orders_1.TENANT_PURCHASE_ORDER_COLLECTION_NAME,
|
|
35
|
+
},
|
|
36
|
+
vendor_id: {
|
|
37
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
38
|
+
required: true,
|
|
39
|
+
ref: warehouse_vendors_1.WAREHOUSE_VENDORS_COLLECTION_NAME,
|
|
40
|
+
},
|
|
41
|
+
vendor_name: { type: String, default: '' },
|
|
42
|
+
return_status: {
|
|
43
|
+
type: String,
|
|
44
|
+
enum: constants_1.ALL_TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_NAMES,
|
|
45
|
+
required: true,
|
|
46
|
+
default: constants_1.TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.CREATED,
|
|
47
|
+
},
|
|
48
|
+
inventory_consumed: { type: Boolean, required: true, default: false },
|
|
49
|
+
items: { type: [VendorReturnItemsSchema], required: true, default: [] },
|
|
50
|
+
total_return_amount: { type: Number, min: 0, required: true },
|
|
51
|
+
notes: { type: String, required: false },
|
|
52
|
+
created_by: { type: VendorReturnActorSchema, required: false },
|
|
53
|
+
approved_by: { type: VendorReturnActorSchema, required: false },
|
|
54
|
+
dispatched_by: { type: VendorReturnActorSchema, required: false },
|
|
55
|
+
completed_by: { type: VendorReturnActorSchema, required: false },
|
|
56
|
+
cancelled_by: { type: VendorReturnActorSchema, required: false },
|
|
57
|
+
approved_at: { type: mongoose_1.Schema.Types.Date, required: false },
|
|
58
|
+
dispatched_at: { type: mongoose_1.Schema.Types.Date, required: false },
|
|
59
|
+
completed_at: { type: mongoose_1.Schema.Types.Date, required: false },
|
|
60
|
+
cancelled_at: { type: mongoose_1.Schema.Types.Date, required: false },
|
|
61
|
+
cancel_reason: { type: String, required: false },
|
|
62
|
+
createdAt_mins: {
|
|
63
|
+
type: Number,
|
|
64
|
+
required: true,
|
|
65
|
+
immutable: true,
|
|
66
|
+
default: () => {
|
|
67
|
+
const date = new Date();
|
|
68
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
createdAt: {
|
|
72
|
+
type: mongoose_1.Schema.Types.Date,
|
|
73
|
+
required: true,
|
|
74
|
+
default: () => new Date(),
|
|
75
|
+
immutable: true,
|
|
76
|
+
},
|
|
77
|
+
updatedAt: {
|
|
78
|
+
type: mongoose_1.Schema.Types.Date,
|
|
79
|
+
required: true,
|
|
80
|
+
default: () => new Date(),
|
|
81
|
+
},
|
|
82
|
+
}, { timestamps: true, versionKey: false, minimize: false });
|
|
83
|
+
exports.TENANT_PURCHASE_ORDER_VENDOR_RETURNS_COLLECTION_NAME = 'tenant_purchase_order_vendor_returns';
|