@managesome/eposmatic-toolkit 0.2.339 → 0.2.342-beta.0
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 +35 -0
- package/lib/constants/ENUMS.js +48 -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/utils/code-redemption-helpers.d.ts +84 -0
- package/lib/helpers/utils/code-redemption-helpers.js +459 -0
- package/lib/schemas/models/index.d.ts +3 -0
- package/lib/schemas/models/index.js +3 -0
- 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 +3 -0
- package/lib/schemas/models/purchase_orders.js +10 -1
- package/lib/schemas/models/void_purchase_order_items.js +2 -1
- package/lib/schemas/models/warehouse.d.ts +7 -1
- package/lib/schemas/models/warehouse.js +9 -0
- package/lib/schemas/models/warehouse_items.d.ts +19 -0
- 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 +4 -0
- package/lib/schemas/types/index.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 +33 -0
- package/lib/schemas/types/purchase_order_receipts.js +2 -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 +42 -0
- package/lib/schemas/types/purchase_order_vendor_returns.js +2 -0
- package/lib/schemas/types/purchase_orders.d.ts +7 -43
- package/lib/schemas/types/warehouse.d.ts +3 -1
- package/lib/schemas/types/warehouse_items.d.ts +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PURCHASE_ORDER_RECEIPTS_COLLECTION_NAME = exports.PurchaseOrderReceiptsSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const purchase_orders_1 = require("./purchase_orders");
|
|
7
|
+
const warehouse_items_1 = require("./warehouse_items");
|
|
8
|
+
const warehouse_1 = require("./warehouse");
|
|
9
|
+
const warehouse_vendors_1 = require("./warehouse_vendors");
|
|
10
|
+
const PurchaseOrderReceiptCreatedBySchema = new mongoose_1.Schema({
|
|
11
|
+
_id: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
name: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
default: '',
|
|
19
|
+
},
|
|
20
|
+
}, { _id: false, minimize: false });
|
|
21
|
+
const PurchaseOrderReceiptItemsSchema = new mongoose_1.Schema({
|
|
22
|
+
_id: {
|
|
23
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
24
|
+
required: true,
|
|
25
|
+
immutable: true,
|
|
26
|
+
},
|
|
27
|
+
item_id: {
|
|
28
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
29
|
+
required: true,
|
|
30
|
+
immutable: true,
|
|
31
|
+
ref: warehouse_items_1.WAREHOUSE_ITEMS_COLLECTION_NAME,
|
|
32
|
+
},
|
|
33
|
+
name: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
ordered_quantity: {
|
|
38
|
+
type: Number,
|
|
39
|
+
min: 0,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
received_quantity: {
|
|
43
|
+
type: Number,
|
|
44
|
+
min: 0,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
price: {
|
|
48
|
+
type: Number,
|
|
49
|
+
min: 0,
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
52
|
+
subtotal: {
|
|
53
|
+
type: Number,
|
|
54
|
+
min: 0,
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
}, {
|
|
58
|
+
_id: false,
|
|
59
|
+
minimize: false,
|
|
60
|
+
});
|
|
61
|
+
exports.PurchaseOrderReceiptsSchema = new mongoose_1.Schema({
|
|
62
|
+
_id: {
|
|
63
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
64
|
+
required: true,
|
|
65
|
+
immutable: true,
|
|
66
|
+
},
|
|
67
|
+
warehouse_id: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: true,
|
|
70
|
+
ref: warehouse_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
|
|
71
|
+
},
|
|
72
|
+
purchase_order_id: {
|
|
73
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
74
|
+
required: true,
|
|
75
|
+
ref: purchase_orders_1.PURCHASE_ORDER_COLLECTION_NAME,
|
|
76
|
+
},
|
|
77
|
+
vendor_id: {
|
|
78
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
79
|
+
required: true,
|
|
80
|
+
ref: warehouse_vendors_1.WAREHOUSE_VENDORS_COLLECTION_NAME,
|
|
81
|
+
},
|
|
82
|
+
vendor_name: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: '',
|
|
85
|
+
},
|
|
86
|
+
receipt_status: {
|
|
87
|
+
type: String,
|
|
88
|
+
enum: constants_1.ALL_PURCHASE_ORDER_RECEIPT_STATUS_NAMES,
|
|
89
|
+
required: true,
|
|
90
|
+
default: constants_1.PURCHASE_ORDER_RECEIPT_STATUS_ENUM.DRAFT,
|
|
91
|
+
},
|
|
92
|
+
items: {
|
|
93
|
+
type: [PurchaseOrderReceiptItemsSchema],
|
|
94
|
+
required: true,
|
|
95
|
+
default: [],
|
|
96
|
+
},
|
|
97
|
+
total_received_amount: {
|
|
98
|
+
type: Number,
|
|
99
|
+
min: 0,
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
102
|
+
notes: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: false,
|
|
105
|
+
},
|
|
106
|
+
created_by: {
|
|
107
|
+
type: PurchaseOrderReceiptCreatedBySchema,
|
|
108
|
+
required: false,
|
|
109
|
+
},
|
|
110
|
+
validated_by: {
|
|
111
|
+
type: PurchaseOrderReceiptCreatedBySchema,
|
|
112
|
+
required: false,
|
|
113
|
+
},
|
|
114
|
+
validated_at: {
|
|
115
|
+
type: mongoose_1.Schema.Types.Date,
|
|
116
|
+
required: false,
|
|
117
|
+
},
|
|
118
|
+
cancelled_at: {
|
|
119
|
+
type: mongoose_1.Schema.Types.Date,
|
|
120
|
+
required: false,
|
|
121
|
+
},
|
|
122
|
+
cancel_reason: {
|
|
123
|
+
type: String,
|
|
124
|
+
required: false,
|
|
125
|
+
},
|
|
126
|
+
createdAt_mins: {
|
|
127
|
+
type: Number,
|
|
128
|
+
required: true,
|
|
129
|
+
immutable: true,
|
|
130
|
+
default: () => {
|
|
131
|
+
const date = new Date();
|
|
132
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
createdAt: {
|
|
136
|
+
type: mongoose_1.Schema.Types.Date,
|
|
137
|
+
required: true,
|
|
138
|
+
default: () => new Date(),
|
|
139
|
+
immutable: true,
|
|
140
|
+
},
|
|
141
|
+
updatedAt: {
|
|
142
|
+
type: mongoose_1.Schema.Types.Date,
|
|
143
|
+
required: true,
|
|
144
|
+
default: () => new Date(),
|
|
145
|
+
},
|
|
146
|
+
}, {
|
|
147
|
+
timestamps: true,
|
|
148
|
+
versionKey: false,
|
|
149
|
+
minimize: false,
|
|
150
|
+
});
|
|
151
|
+
exports.PURCHASE_ORDER_RECEIPTS_COLLECTION_NAME = 'purchase_order_receipts';
|