@managesome/eposmatic-toolkit 0.2.352 → 0.2.355
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 +1 -0
- package/lib/constants/ENUMS.js +2 -0
- package/lib/constants/SWITCHPAY.d.ts +11 -4
- package/lib/constants/SWITCHPAY.js +26 -3
- package/lib/helpers/types/switchpay.d.ts +23 -3
- package/lib/helpers/types/workers.d.ts +17 -1
- package/lib/helpers/utils/minified-catalog.js +2 -1
- package/lib/schemas/models/item.d.ts +3 -0
- package/lib/schemas/models/item.js +4 -0
- package/lib/schemas/types/item.d.ts +1 -0
- package/package.json +1 -1
- package/lib/helpers/utils/offer-apply-helpers.test.d.ts +0 -1
- package/lib/helpers/utils/offer-apply-helpers.test.js +0 -110
- package/lib/helpers/utils/offers-helpers.test.d.ts +0 -1
- package/lib/helpers/utils/offers-helpers.test.js +0 -157
- package/lib/schemas/models/purchase_order_receipts.d.ts +0 -165
- package/lib/schemas/models/purchase_order_receipts.js +0 -151
- package/lib/schemas/models/purchase_order_rfq.d.ts +0 -1938
- package/lib/schemas/models/purchase_order_rfq.js +0 -309
- package/lib/schemas/models/purchase_order_vendor_returns.d.ts +0 -234
- package/lib/schemas/models/purchase_order_vendor_returns.js +0 -188
- package/lib/schemas/types/customer_wallet_assignments.d.ts +0 -61
- package/lib/schemas/types/customer_wallet_assignments.js +0 -23
- package/lib/schemas/types/purchase_order_common.d.ts +0 -39
- package/lib/schemas/types/purchase_order_common.js +0 -2
- package/lib/schemas/types/purchase_order_receipts.d.ts +0 -33
- package/lib/schemas/types/purchase_order_receipts.js +0 -2
- package/lib/schemas/types/purchase_order_rfq.d.ts +0 -25
- package/lib/schemas/types/purchase_order_rfq.js +0 -2
- package/lib/schemas/types/purchase_order_vendor_returns.d.ts +0 -42
- package/lib/schemas/types/purchase_order_vendor_returns.js +0 -2
- package/lib/tests/common-order-actions.test.d.ts +0 -1
- package/lib/tests/common-order-actions.test.js +0 -18
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PURCHASE_ORDER_VENDOR_RETURNS_COLLECTION_NAME = exports.PurchaseOrderVendorReturnsSchema = 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 PurchaseOrderVendorReturnActorSchema = 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 PurchaseOrderVendorReturnItemsSchema = 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
|
-
return_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
|
-
reason: {
|
|
58
|
-
type: String,
|
|
59
|
-
required: false,
|
|
60
|
-
},
|
|
61
|
-
}, {
|
|
62
|
-
_id: false,
|
|
63
|
-
minimize: false,
|
|
64
|
-
});
|
|
65
|
-
exports.PurchaseOrderVendorReturnsSchema = new mongoose_1.Schema({
|
|
66
|
-
_id: {
|
|
67
|
-
type: mongoose_1.Schema.Types.ObjectId,
|
|
68
|
-
required: true,
|
|
69
|
-
immutable: true,
|
|
70
|
-
},
|
|
71
|
-
warehouse_id: {
|
|
72
|
-
type: String,
|
|
73
|
-
required: true,
|
|
74
|
-
ref: warehouse_1.WAREHOUSE_SETTINGS_COLLECTION_NAME,
|
|
75
|
-
},
|
|
76
|
-
purchase_order_id: {
|
|
77
|
-
type: mongoose_1.Schema.Types.ObjectId,
|
|
78
|
-
required: true,
|
|
79
|
-
ref: purchase_orders_1.PURCHASE_ORDER_COLLECTION_NAME,
|
|
80
|
-
},
|
|
81
|
-
vendor_id: {
|
|
82
|
-
type: mongoose_1.Schema.Types.ObjectId,
|
|
83
|
-
required: true,
|
|
84
|
-
ref: warehouse_vendors_1.WAREHOUSE_VENDORS_COLLECTION_NAME,
|
|
85
|
-
},
|
|
86
|
-
vendor_name: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: '',
|
|
89
|
-
},
|
|
90
|
-
return_status: {
|
|
91
|
-
type: String,
|
|
92
|
-
enum: constants_1.ALL_PURCHASE_ORDER_VENDOR_RETURN_STATUS_NAMES,
|
|
93
|
-
required: true,
|
|
94
|
-
default: constants_1.PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.CREATED,
|
|
95
|
-
},
|
|
96
|
-
inventory_consumed: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
required: true,
|
|
99
|
-
default: false,
|
|
100
|
-
},
|
|
101
|
-
items: {
|
|
102
|
-
type: [PurchaseOrderVendorReturnItemsSchema],
|
|
103
|
-
required: true,
|
|
104
|
-
default: [],
|
|
105
|
-
},
|
|
106
|
-
total_return_amount: {
|
|
107
|
-
type: Number,
|
|
108
|
-
min: 0,
|
|
109
|
-
required: true,
|
|
110
|
-
},
|
|
111
|
-
notes: {
|
|
112
|
-
type: String,
|
|
113
|
-
required: false,
|
|
114
|
-
},
|
|
115
|
-
created_by: {
|
|
116
|
-
type: PurchaseOrderVendorReturnActorSchema,
|
|
117
|
-
required: false,
|
|
118
|
-
},
|
|
119
|
-
approved_by: {
|
|
120
|
-
type: PurchaseOrderVendorReturnActorSchema,
|
|
121
|
-
required: false,
|
|
122
|
-
},
|
|
123
|
-
dispatched_by: {
|
|
124
|
-
type: PurchaseOrderVendorReturnActorSchema,
|
|
125
|
-
required: false,
|
|
126
|
-
},
|
|
127
|
-
vendor_confirmed_by: {
|
|
128
|
-
type: PurchaseOrderVendorReturnActorSchema,
|
|
129
|
-
required: false,
|
|
130
|
-
},
|
|
131
|
-
completed_by: {
|
|
132
|
-
type: PurchaseOrderVendorReturnActorSchema,
|
|
133
|
-
required: false,
|
|
134
|
-
},
|
|
135
|
-
cancelled_by: {
|
|
136
|
-
type: PurchaseOrderVendorReturnActorSchema,
|
|
137
|
-
required: false,
|
|
138
|
-
},
|
|
139
|
-
approved_at: {
|
|
140
|
-
type: mongoose_1.Schema.Types.Date,
|
|
141
|
-
required: false,
|
|
142
|
-
},
|
|
143
|
-
dispatched_at: {
|
|
144
|
-
type: mongoose_1.Schema.Types.Date,
|
|
145
|
-
required: false,
|
|
146
|
-
},
|
|
147
|
-
vendor_confirmed_at: {
|
|
148
|
-
type: mongoose_1.Schema.Types.Date,
|
|
149
|
-
required: false,
|
|
150
|
-
},
|
|
151
|
-
completed_at: {
|
|
152
|
-
type: mongoose_1.Schema.Types.Date,
|
|
153
|
-
required: false,
|
|
154
|
-
},
|
|
155
|
-
cancelled_at: {
|
|
156
|
-
type: mongoose_1.Schema.Types.Date,
|
|
157
|
-
required: false,
|
|
158
|
-
},
|
|
159
|
-
cancel_reason: {
|
|
160
|
-
type: String,
|
|
161
|
-
required: false,
|
|
162
|
-
},
|
|
163
|
-
createdAt_mins: {
|
|
164
|
-
type: Number,
|
|
165
|
-
required: true,
|
|
166
|
-
immutable: true,
|
|
167
|
-
default: () => {
|
|
168
|
-
const date = new Date();
|
|
169
|
-
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
createdAt: {
|
|
173
|
-
type: mongoose_1.Schema.Types.Date,
|
|
174
|
-
required: true,
|
|
175
|
-
default: () => new Date(),
|
|
176
|
-
immutable: true,
|
|
177
|
-
},
|
|
178
|
-
updatedAt: {
|
|
179
|
-
type: mongoose_1.Schema.Types.Date,
|
|
180
|
-
required: true,
|
|
181
|
-
default: () => new Date(),
|
|
182
|
-
},
|
|
183
|
-
}, {
|
|
184
|
-
timestamps: true,
|
|
185
|
-
versionKey: false,
|
|
186
|
-
minimize: false,
|
|
187
|
-
});
|
|
188
|
-
exports.PURCHASE_ORDER_VENDOR_RETURNS_COLLECTION_NAME = 'vendor_returns';
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export declare enum WALLET_ASSET_TYPE_ENUM {
|
|
2
|
-
VOUCHER = "VOUCHER",
|
|
3
|
-
GIFT_CARD = "GIFT_CARD"
|
|
4
|
-
}
|
|
5
|
-
export declare enum WALLET_ASSIGNMENT_BEHAVIOR_ENUM {
|
|
6
|
-
INCREMENT = "INCREMENT",
|
|
7
|
-
DECREMENT = "DECREMENT",
|
|
8
|
-
ABSOLUTE = "ABSOLUTE"
|
|
9
|
-
}
|
|
10
|
-
export declare enum CUSTOMER_TARGET_MODE_ENUM {
|
|
11
|
-
EXISTING_CUSTOMERS = "EXISTING_CUSTOMERS",
|
|
12
|
-
MANUAL_NUMBERS = "MANUAL_NUMBERS",
|
|
13
|
-
TOP_CUSTOMERS_BY_REVENUE = "TOP_CUSTOMERS_BY_REVENUE",
|
|
14
|
-
TOP_CUSTOMERS_BY_ORDERS = "TOP_CUSTOMERS_BY_ORDERS",
|
|
15
|
-
TOP_DELIVERY_CUSTOMERS_BY_REVENUE = "TOP_DELIVERY_CUSTOMERS_BY_REVENUE",
|
|
16
|
-
TOP_DELIVERY_CUSTOMERS_BY_ORDERS = "TOP_DELIVERY_CUSTOMERS_BY_ORDERS"
|
|
17
|
-
}
|
|
18
|
-
export interface IPreviewTargetCustomersBody {
|
|
19
|
-
mode: CUSTOMER_TARGET_MODE_ENUM;
|
|
20
|
-
search?: string;
|
|
21
|
-
limit?: number;
|
|
22
|
-
phone_numbers?: string[];
|
|
23
|
-
}
|
|
24
|
-
export interface ICustomerWalletPreview {
|
|
25
|
-
phone_number: string;
|
|
26
|
-
display_name: string | null;
|
|
27
|
-
total_orders: number;
|
|
28
|
-
total_spent: number;
|
|
29
|
-
delivery_orders: number;
|
|
30
|
-
delivery_spent: number;
|
|
31
|
-
voucher_total_count: number;
|
|
32
|
-
gift_card_total_count: number;
|
|
33
|
-
voucher_distinct_count: number;
|
|
34
|
-
gift_card_distinct_count: number;
|
|
35
|
-
exists: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface IPreviewTargetCustomersResponse {
|
|
38
|
-
mode: CUSTOMER_TARGET_MODE_ENUM;
|
|
39
|
-
total: number;
|
|
40
|
-
customers: ICustomerWalletPreview[];
|
|
41
|
-
}
|
|
42
|
-
export interface IAssignWalletAssetsBody {
|
|
43
|
-
behavior: WALLET_ASSIGNMENT_BEHAVIOR_ENUM;
|
|
44
|
-
code_quantities: Record<string, number>;
|
|
45
|
-
phone_numbers: string[];
|
|
46
|
-
auto_create_missing?: boolean;
|
|
47
|
-
}
|
|
48
|
-
export interface IWalletAssignmentFailure {
|
|
49
|
-
phone_number: string;
|
|
50
|
-
reason: string;
|
|
51
|
-
}
|
|
52
|
-
export interface IWalletAssignmentResponse {
|
|
53
|
-
asset_type: WALLET_ASSET_TYPE_ENUM;
|
|
54
|
-
behavior: WALLET_ASSIGNMENT_BEHAVIOR_ENUM;
|
|
55
|
-
code_quantities: Record<string, number>;
|
|
56
|
-
requested_count: number;
|
|
57
|
-
updated_count: number;
|
|
58
|
-
failed_count: number;
|
|
59
|
-
updated_phone_numbers: string[];
|
|
60
|
-
failures: IWalletAssignmentFailure[];
|
|
61
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CUSTOMER_TARGET_MODE_ENUM = exports.WALLET_ASSIGNMENT_BEHAVIOR_ENUM = exports.WALLET_ASSET_TYPE_ENUM = void 0;
|
|
4
|
-
var WALLET_ASSET_TYPE_ENUM;
|
|
5
|
-
(function (WALLET_ASSET_TYPE_ENUM) {
|
|
6
|
-
WALLET_ASSET_TYPE_ENUM["VOUCHER"] = "VOUCHER";
|
|
7
|
-
WALLET_ASSET_TYPE_ENUM["GIFT_CARD"] = "GIFT_CARD";
|
|
8
|
-
})(WALLET_ASSET_TYPE_ENUM || (exports.WALLET_ASSET_TYPE_ENUM = WALLET_ASSET_TYPE_ENUM = {}));
|
|
9
|
-
var WALLET_ASSIGNMENT_BEHAVIOR_ENUM;
|
|
10
|
-
(function (WALLET_ASSIGNMENT_BEHAVIOR_ENUM) {
|
|
11
|
-
WALLET_ASSIGNMENT_BEHAVIOR_ENUM["INCREMENT"] = "INCREMENT";
|
|
12
|
-
WALLET_ASSIGNMENT_BEHAVIOR_ENUM["DECREMENT"] = "DECREMENT";
|
|
13
|
-
WALLET_ASSIGNMENT_BEHAVIOR_ENUM["ABSOLUTE"] = "ABSOLUTE";
|
|
14
|
-
})(WALLET_ASSIGNMENT_BEHAVIOR_ENUM || (exports.WALLET_ASSIGNMENT_BEHAVIOR_ENUM = WALLET_ASSIGNMENT_BEHAVIOR_ENUM = {}));
|
|
15
|
-
var CUSTOMER_TARGET_MODE_ENUM;
|
|
16
|
-
(function (CUSTOMER_TARGET_MODE_ENUM) {
|
|
17
|
-
CUSTOMER_TARGET_MODE_ENUM["EXISTING_CUSTOMERS"] = "EXISTING_CUSTOMERS";
|
|
18
|
-
CUSTOMER_TARGET_MODE_ENUM["MANUAL_NUMBERS"] = "MANUAL_NUMBERS";
|
|
19
|
-
CUSTOMER_TARGET_MODE_ENUM["TOP_CUSTOMERS_BY_REVENUE"] = "TOP_CUSTOMERS_BY_REVENUE";
|
|
20
|
-
CUSTOMER_TARGET_MODE_ENUM["TOP_CUSTOMERS_BY_ORDERS"] = "TOP_CUSTOMERS_BY_ORDERS";
|
|
21
|
-
CUSTOMER_TARGET_MODE_ENUM["TOP_DELIVERY_CUSTOMERS_BY_REVENUE"] = "TOP_DELIVERY_CUSTOMERS_BY_REVENUE";
|
|
22
|
-
CUSTOMER_TARGET_MODE_ENUM["TOP_DELIVERY_CUSTOMERS_BY_ORDERS"] = "TOP_DELIVERY_CUSTOMERS_BY_ORDERS";
|
|
23
|
-
})(CUSTOMER_TARGET_MODE_ENUM || (exports.CUSTOMER_TARGET_MODE_ENUM = CUSTOMER_TARGET_MODE_ENUM = {}));
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { IStaffDetails } from './order';
|
|
2
|
-
export interface IPurchaseOrderCommonItem {
|
|
3
|
-
_id: string;
|
|
4
|
-
item_id: string;
|
|
5
|
-
is_ready?: boolean;
|
|
6
|
-
void_reason?: string | null;
|
|
7
|
-
name: string;
|
|
8
|
-
price: number;
|
|
9
|
-
subtotal: number;
|
|
10
|
-
quantity: number;
|
|
11
|
-
_net_amount: number;
|
|
12
|
-
_gross_amount: number;
|
|
13
|
-
_gst_amount: number;
|
|
14
|
-
_discount_amount: number;
|
|
15
|
-
special_instructions: string;
|
|
16
|
-
}
|
|
17
|
-
export interface IPurchaseOrderCommonCategoryByCategoryId {
|
|
18
|
-
name: string;
|
|
19
|
-
category_id: string;
|
|
20
|
-
items: IPurchaseOrderCommonItem[];
|
|
21
|
-
}
|
|
22
|
-
export interface IPurchaseOrderCommonCategoryById {
|
|
23
|
-
_id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
items: IPurchaseOrderCommonItem[];
|
|
26
|
-
}
|
|
27
|
-
export interface IPurchaseOrderCommonIterationBase<TCategory, TStatus> {
|
|
28
|
-
categories: TCategory[];
|
|
29
|
-
staff_details: IStaffDetails;
|
|
30
|
-
is_gst_inclusive?: boolean;
|
|
31
|
-
gst?: number | null;
|
|
32
|
-
gst_amount?: number | null;
|
|
33
|
-
special_instructions: string;
|
|
34
|
-
price: number;
|
|
35
|
-
amount_earned: number;
|
|
36
|
-
grand_total: number;
|
|
37
|
-
order_status: TStatus;
|
|
38
|
-
updatedAt: Date;
|
|
39
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { PURCHASE_ORDER_RECEIPT_STATUS_ENUM } from '../../constants';
|
|
2
|
-
export interface IPurchaseOrderReceiptItem {
|
|
3
|
-
_id: string;
|
|
4
|
-
item_id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
ordered_quantity: number;
|
|
7
|
-
received_quantity: number;
|
|
8
|
-
price: number;
|
|
9
|
-
subtotal: number;
|
|
10
|
-
}
|
|
11
|
-
export interface IPurchaseOrderReceiptActor {
|
|
12
|
-
_id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
}
|
|
15
|
-
export interface IPurchaseOrderReceipt {
|
|
16
|
-
_id: string;
|
|
17
|
-
warehouse_id: string;
|
|
18
|
-
purchase_order_id: string;
|
|
19
|
-
vendor_id: string;
|
|
20
|
-
vendor_name: string;
|
|
21
|
-
receipt_status: PURCHASE_ORDER_RECEIPT_STATUS_ENUM;
|
|
22
|
-
items: IPurchaseOrderReceiptItem[];
|
|
23
|
-
total_received_amount: number;
|
|
24
|
-
notes?: string | null;
|
|
25
|
-
created_by?: IPurchaseOrderReceiptActor | null;
|
|
26
|
-
validated_by?: IPurchaseOrderReceiptActor | null;
|
|
27
|
-
validated_at?: Date | null;
|
|
28
|
-
cancelled_at?: Date | null;
|
|
29
|
-
cancel_reason?: string | null;
|
|
30
|
-
createdAt_mins: number;
|
|
31
|
-
createdAt: Date;
|
|
32
|
-
updatedAt: Date;
|
|
33
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PURCHASE_ORDER_RFQ_STATUS_ENUM } from '../../constants';
|
|
2
|
-
import { IPurchaseOrderCommonCategoryByCategoryId, IPurchaseOrderCommonItem, IPurchaseOrderCommonIterationBase } from './purchase_order_common';
|
|
3
|
-
export type IPurchaseOrderRFQItem = IPurchaseOrderCommonItem;
|
|
4
|
-
export type IPurchaseOrderRFQCategory = IPurchaseOrderCommonCategoryByCategoryId;
|
|
5
|
-
export interface IPurchaseOrderRFQIteration extends IPurchaseOrderCommonIterationBase<IPurchaseOrderRFQCategory, PURCHASE_ORDER_RFQ_STATUS_ENUM | string> {
|
|
6
|
-
tax_number: string;
|
|
7
|
-
}
|
|
8
|
-
export interface IPurchaseOrderRFQ extends IPurchaseOrderRFQIteration {
|
|
9
|
-
_id: string;
|
|
10
|
-
warehouse_id: string;
|
|
11
|
-
vendor_id: string;
|
|
12
|
-
vendor_name: string;
|
|
13
|
-
iterations: IPurchaseOrderRFQIteration[];
|
|
14
|
-
order_number: number | null;
|
|
15
|
-
expected_deadline: string;
|
|
16
|
-
payment_terms: number;
|
|
17
|
-
delete_reason?: string | null;
|
|
18
|
-
cancel_reason?: string | null;
|
|
19
|
-
is_deleted: boolean;
|
|
20
|
-
order_status_updated_at: Date;
|
|
21
|
-
special_instructions: string;
|
|
22
|
-
is_reopened?: boolean;
|
|
23
|
-
createdAt_mins: number;
|
|
24
|
-
createdAt: Date;
|
|
25
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM } from '../../constants';
|
|
2
|
-
export interface IPurchaseOrderVendorReturnItem {
|
|
3
|
-
_id: string;
|
|
4
|
-
item_id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
ordered_quantity: number;
|
|
7
|
-
return_quantity: number;
|
|
8
|
-
price: number;
|
|
9
|
-
subtotal: number;
|
|
10
|
-
reason?: string | null;
|
|
11
|
-
}
|
|
12
|
-
export interface IPurchaseOrderVendorReturnActor {
|
|
13
|
-
_id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
}
|
|
16
|
-
export interface IPurchaseOrderVendorReturn {
|
|
17
|
-
_id: string;
|
|
18
|
-
warehouse_id: string;
|
|
19
|
-
purchase_order_id: string;
|
|
20
|
-
vendor_id: string;
|
|
21
|
-
vendor_name: string;
|
|
22
|
-
return_status: PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM;
|
|
23
|
-
inventory_consumed: boolean;
|
|
24
|
-
items: IPurchaseOrderVendorReturnItem[];
|
|
25
|
-
total_return_amount: number;
|
|
26
|
-
notes?: string | null;
|
|
27
|
-
created_by?: IPurchaseOrderVendorReturnActor | null;
|
|
28
|
-
approved_by?: IPurchaseOrderVendorReturnActor | null;
|
|
29
|
-
dispatched_by?: IPurchaseOrderVendorReturnActor | null;
|
|
30
|
-
vendor_confirmed_by?: IPurchaseOrderVendorReturnActor | null;
|
|
31
|
-
completed_by?: IPurchaseOrderVendorReturnActor | null;
|
|
32
|
-
cancelled_by?: IPurchaseOrderVendorReturnActor | null;
|
|
33
|
-
approved_at?: Date | null;
|
|
34
|
-
dispatched_at?: Date | null;
|
|
35
|
-
vendor_confirmed_at?: Date | null;
|
|
36
|
-
completed_at?: Date | null;
|
|
37
|
-
cancelled_at?: Date | null;
|
|
38
|
-
cancel_reason?: string | null;
|
|
39
|
-
createdAt_mins: number;
|
|
40
|
-
createdAt: Date;
|
|
41
|
-
updatedAt: Date;
|
|
42
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const common_order_actions_1 = require("../helpers/store/common-order-actions");
|
|
4
|
-
describe('getOrderWithAllFields', () => {
|
|
5
|
-
it('defaults missing payment total fields to zero', () => {
|
|
6
|
-
const order = (0, common_order_actions_1.getOrderWithAllFields)({});
|
|
7
|
-
expect(order.amount_collected).toBe(0);
|
|
8
|
-
expect(order.amount_earned).toBe(0);
|
|
9
|
-
});
|
|
10
|
-
it('preserves existing payment total fields', () => {
|
|
11
|
-
const order = (0, common_order_actions_1.getOrderWithAllFields)({
|
|
12
|
-
amount_collected: 25,
|
|
13
|
-
amount_earned: 40,
|
|
14
|
-
});
|
|
15
|
-
expect(order.amount_collected).toBe(25);
|
|
16
|
-
expect(order.amount_earned).toBe(40);
|
|
17
|
-
});
|
|
18
|
-
});
|