@managesome/eposmatic-toolkit 0.2.439 → 0.2.440
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/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 -1
- package/lib/constants/index.js +3 -1
- 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,17 @@
|
|
|
1
|
+
export declare enum TENANT_PURCHASE_ORDER_STATUS_ENUM {
|
|
2
|
+
DRAFT = "DRAFT",
|
|
3
|
+
SUBMITTED = "SUBMITTED",
|
|
4
|
+
PARTIALLY_RECEIVED = "PARTIALLY_RECEIVED",
|
|
5
|
+
RECEIVED = "RECEIVED",
|
|
6
|
+
COMPLETED = "COMPLETED",
|
|
7
|
+
CANCELLED = "CANCELLED"
|
|
8
|
+
}
|
|
9
|
+
export declare const ALL_TENANT_PURCHASE_ORDER_STATUS_NAMES: TENANT_PURCHASE_ORDER_STATUS_ENUM[];
|
|
10
|
+
export declare enum TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM {
|
|
11
|
+
CREATED = "CREATED",
|
|
12
|
+
APPROVED = "APPROVED",
|
|
13
|
+
DISPATCHED = "DISPATCHED",
|
|
14
|
+
COMPLETED = "COMPLETED",
|
|
15
|
+
CANCELLED = "CANCELLED"
|
|
16
|
+
}
|
|
17
|
+
export declare const ALL_TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_NAMES: TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ALL_TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_NAMES = exports.TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM = exports.ALL_TENANT_PURCHASE_ORDER_STATUS_NAMES = exports.TENANT_PURCHASE_ORDER_STATUS_ENUM = void 0;
|
|
4
|
+
// ======================>> TENANT PURCHASE ORDER <<====================== //
|
|
5
|
+
var TENANT_PURCHASE_ORDER_STATUS_ENUM;
|
|
6
|
+
(function (TENANT_PURCHASE_ORDER_STATUS_ENUM) {
|
|
7
|
+
TENANT_PURCHASE_ORDER_STATUS_ENUM["DRAFT"] = "DRAFT";
|
|
8
|
+
TENANT_PURCHASE_ORDER_STATUS_ENUM["SUBMITTED"] = "SUBMITTED";
|
|
9
|
+
TENANT_PURCHASE_ORDER_STATUS_ENUM["PARTIALLY_RECEIVED"] = "PARTIALLY_RECEIVED";
|
|
10
|
+
TENANT_PURCHASE_ORDER_STATUS_ENUM["RECEIVED"] = "RECEIVED";
|
|
11
|
+
TENANT_PURCHASE_ORDER_STATUS_ENUM["COMPLETED"] = "COMPLETED";
|
|
12
|
+
TENANT_PURCHASE_ORDER_STATUS_ENUM["CANCELLED"] = "CANCELLED";
|
|
13
|
+
})(TENANT_PURCHASE_ORDER_STATUS_ENUM || (exports.TENANT_PURCHASE_ORDER_STATUS_ENUM = TENANT_PURCHASE_ORDER_STATUS_ENUM = {}));
|
|
14
|
+
exports.ALL_TENANT_PURCHASE_ORDER_STATUS_NAMES = Object.values(TENANT_PURCHASE_ORDER_STATUS_ENUM);
|
|
15
|
+
// ======================>> TENANT PURCHASE ORDER VENDOR RETURN <<====================== //
|
|
16
|
+
var TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM;
|
|
17
|
+
(function (TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM) {
|
|
18
|
+
TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM["CREATED"] = "CREATED";
|
|
19
|
+
TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM["APPROVED"] = "APPROVED";
|
|
20
|
+
TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM["DISPATCHED"] = "DISPATCHED";
|
|
21
|
+
TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM["COMPLETED"] = "COMPLETED";
|
|
22
|
+
TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM["CANCELLED"] = "CANCELLED";
|
|
23
|
+
})(TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM || (exports.TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM = TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM = {}));
|
|
24
|
+
exports.ALL_TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_NAMES = Object.values(TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ITenantPurchaseOrderVendorReturnStatus } from '../schemas';
|
|
2
|
+
import { TENANT_PURCHASE_ORDER_STATUS_ENUM } from './TENANT_ENUMS';
|
|
3
|
+
export interface ITenantPurchaseOrderStatus {
|
|
4
|
+
status: TENANT_PURCHASE_ORDER_STATUS_ENUM;
|
|
5
|
+
color: string;
|
|
6
|
+
contrast_color: string;
|
|
7
|
+
priority: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ITenantPurchaseOrderStatusColorCode {
|
|
10
|
+
color: string;
|
|
11
|
+
contrast_color: string;
|
|
12
|
+
}
|
|
13
|
+
export type ITenantPurchaseOrderStatusColorCodeMap = Record<TENANT_PURCHASE_ORDER_STATUS_ENUM, ITenantPurchaseOrderStatusColorCode>;
|
|
14
|
+
export declare const DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP: ITenantPurchaseOrderStatusColorCodeMap;
|
|
15
|
+
export declare const DEFAULT_TENANT_PURCHASE_ORDER_STATUS: ITenantPurchaseOrderStatus[];
|
|
16
|
+
export declare const DEFAULT_TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUSES: ITenantPurchaseOrderVendorReturnStatus[];
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUSES = exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS = exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP = void 0;
|
|
4
|
+
const TENANT_ENUMS_1 = require("./TENANT_ENUMS");
|
|
5
|
+
exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP = {
|
|
6
|
+
[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.DRAFT]: {
|
|
7
|
+
color: '#727472',
|
|
8
|
+
contrast_color: '#FFFFFF',
|
|
9
|
+
},
|
|
10
|
+
[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.SUBMITTED]: {
|
|
11
|
+
color: '#0000FF',
|
|
12
|
+
contrast_color: '#FFFFFF',
|
|
13
|
+
},
|
|
14
|
+
[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.PARTIALLY_RECEIVED]: {
|
|
15
|
+
color: '#E67E22',
|
|
16
|
+
contrast_color: '#FFFFFF',
|
|
17
|
+
},
|
|
18
|
+
[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.RECEIVED]: {
|
|
19
|
+
color: '#FBB117',
|
|
20
|
+
contrast_color: '#FFFFFF',
|
|
21
|
+
},
|
|
22
|
+
[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.COMPLETED]: {
|
|
23
|
+
color: '#4CC417',
|
|
24
|
+
contrast_color: '#FFFFFF',
|
|
25
|
+
},
|
|
26
|
+
[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.CANCELLED]: {
|
|
27
|
+
color: '#FF0000',
|
|
28
|
+
contrast_color: '#FFFFFF',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS = [
|
|
32
|
+
{
|
|
33
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.DRAFT,
|
|
34
|
+
...exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.DRAFT],
|
|
35
|
+
priority: 0,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.SUBMITTED,
|
|
39
|
+
...exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.SUBMITTED],
|
|
40
|
+
priority: 1,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.PARTIALLY_RECEIVED,
|
|
44
|
+
...exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.PARTIALLY_RECEIVED],
|
|
45
|
+
priority: 2,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.RECEIVED,
|
|
49
|
+
...exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.RECEIVED],
|
|
50
|
+
priority: 3,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.COMPLETED,
|
|
54
|
+
...exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.COMPLETED],
|
|
55
|
+
priority: 4,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.CANCELLED,
|
|
59
|
+
...exports.DEFAULT_TENANT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_STATUS_ENUM.CANCELLED],
|
|
60
|
+
priority: 5,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
exports.DEFAULT_TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUSES = [
|
|
64
|
+
{
|
|
65
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.CREATED,
|
|
66
|
+
color: '#727472',
|
|
67
|
+
contrast_color: '#FFFFFF',
|
|
68
|
+
priority: 0,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.APPROVED,
|
|
72
|
+
color: '#0000FF',
|
|
73
|
+
contrast_color: '#FFFFFF',
|
|
74
|
+
priority: 1,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.DISPATCHED,
|
|
78
|
+
color: '#FBB117',
|
|
79
|
+
contrast_color: '#FFFFFF',
|
|
80
|
+
priority: 2,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.COMPLETED,
|
|
84
|
+
color: '#4CC417',
|
|
85
|
+
contrast_color: '#FFFFFF',
|
|
86
|
+
priority: 3,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
status: TENANT_ENUMS_1.TENANT_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.CANCELLED,
|
|
90
|
+
color: '#FF0000',
|
|
91
|
+
contrast_color: '#FFFFFF',
|
|
92
|
+
priority: 4,
|
|
93
|
+
},
|
|
94
|
+
];
|
package/lib/constants/index.d.ts
CHANGED
|
@@ -7,17 +7,19 @@ export * from './HUBRISE_ENUMS';
|
|
|
7
7
|
export * from './NOTIFICATIONS';
|
|
8
8
|
export * from './ORDER';
|
|
9
9
|
export * from './PRA_ENUMS';
|
|
10
|
-
export * from './WAREHOUSE_PURCHASE_ORDER';
|
|
11
10
|
export * from './REPORT_WEBVIEW';
|
|
12
11
|
export * from './RFQ';
|
|
13
12
|
export * from './SMARTPAY_ENUMS';
|
|
14
13
|
export * from './SOCKET';
|
|
15
14
|
export * from './SRB_ENUMS';
|
|
16
15
|
export * from './SWITCHPAY';
|
|
16
|
+
export * from './TENANT_ENUMS';
|
|
17
|
+
export * from './TENANT_PURCHASE_ORDER';
|
|
17
18
|
export * from './types';
|
|
18
19
|
export * from './WALLET';
|
|
19
20
|
export * from './WAREHOUSE_ANALYTICS';
|
|
20
21
|
export * from './WAREHOUSE_ENUMS';
|
|
21
22
|
export * from './WAREHOUSE_INVOICE';
|
|
23
|
+
export * from './WAREHOUSE_PURCHASE_ORDER';
|
|
22
24
|
export * from './WEBVIEW';
|
|
23
25
|
export * from './WORKER_ENDPOINTS';
|
package/lib/constants/index.js
CHANGED
|
@@ -23,17 +23,19 @@ __exportStar(require("./HUBRISE_ENUMS"), exports);
|
|
|
23
23
|
__exportStar(require("./NOTIFICATIONS"), exports);
|
|
24
24
|
__exportStar(require("./ORDER"), exports);
|
|
25
25
|
__exportStar(require("./PRA_ENUMS"), exports);
|
|
26
|
-
__exportStar(require("./WAREHOUSE_PURCHASE_ORDER"), exports);
|
|
27
26
|
__exportStar(require("./REPORT_WEBVIEW"), exports);
|
|
28
27
|
__exportStar(require("./RFQ"), exports);
|
|
29
28
|
__exportStar(require("./SMARTPAY_ENUMS"), exports);
|
|
30
29
|
__exportStar(require("./SOCKET"), exports);
|
|
31
30
|
__exportStar(require("./SRB_ENUMS"), exports);
|
|
32
31
|
__exportStar(require("./SWITCHPAY"), exports);
|
|
32
|
+
__exportStar(require("./TENANT_ENUMS"), exports);
|
|
33
|
+
__exportStar(require("./TENANT_PURCHASE_ORDER"), exports);
|
|
33
34
|
__exportStar(require("./types"), exports);
|
|
34
35
|
__exportStar(require("./WALLET"), exports);
|
|
35
36
|
__exportStar(require("./WAREHOUSE_ANALYTICS"), exports);
|
|
36
37
|
__exportStar(require("./WAREHOUSE_ENUMS"), exports);
|
|
37
38
|
__exportStar(require("./WAREHOUSE_INVOICE"), exports);
|
|
39
|
+
__exportStar(require("./WAREHOUSE_PURCHASE_ORDER"), exports);
|
|
38
40
|
__exportStar(require("./WEBVIEW"), exports);
|
|
39
41
|
__exportStar(require("./WORKER_ENDPOINTS"), exports);
|
|
@@ -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';
|