@managesome/eposmatic-toolkit 0.2.364 → 0.2.366
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 +223 -1
- package/lib/constants/ENUMS.js +271 -4
- package/lib/constants/PURCHASE_ORDER.js +12 -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/types/email-templates.d.ts +31 -1
- package/lib/helpers/utils/email-helpers.js +5 -0
- package/lib/schemas/models/index.d.ts +11 -0
- package/lib/schemas/models/index.js +11 -0
- package/lib/schemas/models/internal_movements.d.ts +357 -0
- package/lib/schemas/models/internal_movements.js +323 -0
- package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +154 -0
- package/lib/schemas/models/inventory_lot_serial_numbers.js +193 -0
- package/lib/schemas/models/item_transactions.d.ts +3 -3
- 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 +6 -3
- package/lib/schemas/models/purchase_orders.js +10 -1
- package/lib/schemas/models/rewards_usage.d.ts +3 -3
- package/lib/schemas/models/rider.d.ts +3 -3
- package/lib/schemas/models/sale_order_deliveries.d.ts +167 -0
- package/lib/schemas/models/sale_order_deliveries.js +155 -0
- package/lib/schemas/models/sale_order_invoices.d.ts +218 -0
- package/lib/schemas/models/sale_order_invoices.js +192 -0
- package/lib/schemas/models/sale_order_rfq.d.ts +1938 -0
- package/lib/schemas/models/sale_order_rfq.js +309 -0
- package/lib/schemas/models/sale_orders.d.ts +1943 -0
- package/lib/schemas/models/sale_orders.js +324 -0
- package/lib/schemas/models/void_purchase_order_items.d.ts +3 -3
- package/lib/schemas/models/void_purchase_order_items.js +2 -1
- package/lib/schemas/models/void_warehouse_invoice_items.d.ts +9 -9
- package/lib/schemas/models/warehouse-activity-logs.d.ts +127 -0
- package/lib/schemas/models/warehouse-activity-logs.js +143 -0
- package/lib/schemas/models/warehouse-communications.d.ts +228 -0
- package/lib/schemas/models/warehouse-communications.js +216 -0
- package/lib/schemas/models/warehouse.d.ts +7 -1
- package/lib/schemas/models/warehouse.js +9 -0
- package/lib/schemas/models/warehouse_categories.d.ts +4 -0
- package/lib/schemas/models/warehouse_categories.js +6 -0
- package/lib/schemas/models/warehouse_clients.d.ts +6 -0
- package/lib/schemas/models/warehouse_clients.js +8 -0
- package/lib/schemas/models/warehouse_inventory_transactions.d.ts +3 -3
- package/lib/schemas/models/warehouse_invoices.d.ts +3 -3
- package/lib/schemas/models/warehouse_item_transactions.d.ts +6 -6
- package/lib/schemas/models/warehouse_items.d.ts +28 -9
- 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 +13 -0
- package/lib/schemas/types/index.js +13 -0
- package/lib/schemas/types/internal_movements.d.ts +73 -0
- package/lib/schemas/types/internal_movements.js +2 -0
- package/lib/schemas/types/inventory_lot_serial_numbers.d.ts +85 -0
- package/lib/schemas/types/inventory_lot_serial_numbers.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 +39 -0
- package/lib/schemas/types/purchase_order_receipts.js +21 -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 +49 -0
- package/lib/schemas/types/purchase_order_vendor_returns.js +42 -0
- package/lib/schemas/types/purchase_orders.d.ts +7 -43
- package/lib/schemas/types/sale_order_common.d.ts +39 -0
- package/lib/schemas/types/sale_order_common.js +2 -0
- package/lib/schemas/types/sale_order_deliveries.d.ts +67 -0
- package/lib/schemas/types/sale_order_deliveries.js +2 -0
- package/lib/schemas/types/sale_order_invoices.d.ts +46 -0
- package/lib/schemas/types/sale_order_invoices.js +2 -0
- package/lib/schemas/types/sale_order_rfq.d.ts +25 -0
- package/lib/schemas/types/sale_order_rfq.js +2 -0
- package/lib/schemas/types/sale_orders.d.ts +30 -0
- package/lib/schemas/types/sale_orders.js +2 -0
- package/lib/schemas/types/warehouse-activity-logs.d.ts +35 -0
- package/lib/schemas/types/warehouse-activity-logs.js +4 -0
- package/lib/schemas/types/warehouse-communications.d.ts +53 -0
- package/lib/schemas/types/warehouse-communications.js +2 -0
- package/lib/schemas/types/warehouse.d.ts +3 -1
- package/lib/schemas/types/warehouse_categories.d.ts +2 -0
- package/lib/schemas/types/warehouse_clients.d.ts +2 -0
- package/lib/schemas/types/warehouse_items.d.ts +7 -1
- package/package.json +1 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { PURCHASE_ORDER_RECEIPT_STATUS_ENUM } from '../../constants';
|
|
3
|
+
export declare const PurchaseOrderReceiptsSchema: 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
|
+
createdAt_mins: number;
|
|
13
|
+
createdAt: NativeDate;
|
|
14
|
+
updatedAt: NativeDate;
|
|
15
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
name: string;
|
|
18
|
+
price: number;
|
|
19
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
20
|
+
subtotal: number;
|
|
21
|
+
ordered_quantity: number;
|
|
22
|
+
received_quantity: number;
|
|
23
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
24
|
+
_id: import("mongoose").Types.ObjectId;
|
|
25
|
+
name: string;
|
|
26
|
+
price: number;
|
|
27
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
28
|
+
subtotal: number;
|
|
29
|
+
ordered_quantity: number;
|
|
30
|
+
received_quantity: number;
|
|
31
|
+
}> & {
|
|
32
|
+
_id: import("mongoose").Types.ObjectId;
|
|
33
|
+
name: string;
|
|
34
|
+
price: number;
|
|
35
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
36
|
+
subtotal: number;
|
|
37
|
+
ordered_quantity: number;
|
|
38
|
+
received_quantity: number;
|
|
39
|
+
}>;
|
|
40
|
+
warehouse_id: string;
|
|
41
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
42
|
+
vendor_name: string;
|
|
43
|
+
purchase_order_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
receipt_status: PURCHASE_ORDER_RECEIPT_STATUS_ENUM;
|
|
45
|
+
total_received_amount: number;
|
|
46
|
+
cancel_reason?: string | null | undefined;
|
|
47
|
+
notes?: string | null | undefined;
|
|
48
|
+
created_by?: {
|
|
49
|
+
_id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
} | null | undefined;
|
|
52
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
53
|
+
validated_by?: {
|
|
54
|
+
_id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
} | null | undefined;
|
|
57
|
+
validated_at?: NativeDate | null | undefined;
|
|
58
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
59
|
+
createdAt: NativeDate;
|
|
60
|
+
updatedAt: NativeDate;
|
|
61
|
+
} & {
|
|
62
|
+
_id: import("mongoose").Types.ObjectId;
|
|
63
|
+
createdAt_mins: number;
|
|
64
|
+
createdAt: NativeDate;
|
|
65
|
+
updatedAt: NativeDate;
|
|
66
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
67
|
+
_id: import("mongoose").Types.ObjectId;
|
|
68
|
+
name: string;
|
|
69
|
+
price: number;
|
|
70
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
71
|
+
subtotal: number;
|
|
72
|
+
ordered_quantity: number;
|
|
73
|
+
received_quantity: number;
|
|
74
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
75
|
+
_id: import("mongoose").Types.ObjectId;
|
|
76
|
+
name: string;
|
|
77
|
+
price: number;
|
|
78
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
79
|
+
subtotal: number;
|
|
80
|
+
ordered_quantity: number;
|
|
81
|
+
received_quantity: number;
|
|
82
|
+
}> & {
|
|
83
|
+
_id: import("mongoose").Types.ObjectId;
|
|
84
|
+
name: string;
|
|
85
|
+
price: number;
|
|
86
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
87
|
+
subtotal: number;
|
|
88
|
+
ordered_quantity: number;
|
|
89
|
+
received_quantity: number;
|
|
90
|
+
}>;
|
|
91
|
+
warehouse_id: string;
|
|
92
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
93
|
+
vendor_name: string;
|
|
94
|
+
purchase_order_id: import("mongoose").Types.ObjectId;
|
|
95
|
+
receipt_status: PURCHASE_ORDER_RECEIPT_STATUS_ENUM;
|
|
96
|
+
total_received_amount: number;
|
|
97
|
+
cancel_reason?: string | null | undefined;
|
|
98
|
+
notes?: string | null | undefined;
|
|
99
|
+
created_by?: {
|
|
100
|
+
_id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
} | null | undefined;
|
|
103
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
104
|
+
validated_by?: {
|
|
105
|
+
_id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
} | null | undefined;
|
|
108
|
+
validated_at?: NativeDate | null | undefined;
|
|
109
|
+
}>> & import("mongoose").FlatRecord<{
|
|
110
|
+
createdAt: NativeDate;
|
|
111
|
+
updatedAt: NativeDate;
|
|
112
|
+
} & {
|
|
113
|
+
_id: import("mongoose").Types.ObjectId;
|
|
114
|
+
createdAt_mins: number;
|
|
115
|
+
createdAt: NativeDate;
|
|
116
|
+
updatedAt: NativeDate;
|
|
117
|
+
items: import("mongoose").Types.DocumentArray<{
|
|
118
|
+
_id: import("mongoose").Types.ObjectId;
|
|
119
|
+
name: string;
|
|
120
|
+
price: number;
|
|
121
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
122
|
+
subtotal: number;
|
|
123
|
+
ordered_quantity: number;
|
|
124
|
+
received_quantity: number;
|
|
125
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
126
|
+
_id: import("mongoose").Types.ObjectId;
|
|
127
|
+
name: string;
|
|
128
|
+
price: number;
|
|
129
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
130
|
+
subtotal: number;
|
|
131
|
+
ordered_quantity: number;
|
|
132
|
+
received_quantity: number;
|
|
133
|
+
}> & {
|
|
134
|
+
_id: import("mongoose").Types.ObjectId;
|
|
135
|
+
name: string;
|
|
136
|
+
price: number;
|
|
137
|
+
item_id: import("mongoose").Types.ObjectId;
|
|
138
|
+
subtotal: number;
|
|
139
|
+
ordered_quantity: number;
|
|
140
|
+
received_quantity: number;
|
|
141
|
+
}>;
|
|
142
|
+
warehouse_id: string;
|
|
143
|
+
vendor_id: import("mongoose").Types.ObjectId;
|
|
144
|
+
vendor_name: string;
|
|
145
|
+
purchase_order_id: import("mongoose").Types.ObjectId;
|
|
146
|
+
receipt_status: PURCHASE_ORDER_RECEIPT_STATUS_ENUM;
|
|
147
|
+
total_received_amount: number;
|
|
148
|
+
cancel_reason?: string | null | undefined;
|
|
149
|
+
notes?: string | null | undefined;
|
|
150
|
+
created_by?: {
|
|
151
|
+
_id: string;
|
|
152
|
+
name: string;
|
|
153
|
+
} | null | undefined;
|
|
154
|
+
cancelled_at?: NativeDate | null | undefined;
|
|
155
|
+
validated_by?: {
|
|
156
|
+
_id: string;
|
|
157
|
+
name: string;
|
|
158
|
+
} | null | undefined;
|
|
159
|
+
validated_at?: NativeDate | null | undefined;
|
|
160
|
+
}> & Required<{
|
|
161
|
+
_id: import("mongoose").Types.ObjectId;
|
|
162
|
+
}> & {
|
|
163
|
+
__v: number;
|
|
164
|
+
}>;
|
|
165
|
+
export declare const PURCHASE_ORDER_RECEIPTS_COLLECTION_NAME = "purchase_order_receipts";
|
|
@@ -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';
|