storemw-core-client 1.0.1
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/.env +1 -0
- package/.vscode/launch.json +24 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +13 -0
- package/dist/config/env.d.ts +7 -0
- package/dist/config/env.js +16 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32 -0
- package/dist/lib/ApiService.d.ts +41 -0
- package/dist/lib/ApiService.js +143 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.js +9 -0
- package/dist/lib/queryParams.d.ts +43 -0
- package/dist/lib/queryParams.js +99 -0
- package/dist/services/account/AccountService.d.ts +52 -0
- package/dist/services/account/AccountService.js +119 -0
- package/dist/services/auth/AuthService.d.ts +44 -0
- package/dist/services/auth/AuthService.js +76 -0
- package/dist/services/branch/BranchService.d.ts +124 -0
- package/dist/services/branch/BranchService.js +162 -0
- package/dist/services/business/BusinessService.d.ts +91 -0
- package/dist/services/business/BusinessService.js +153 -0
- package/dist/services/document/DocumentService.d.ts +578 -0
- package/dist/services/document/DocumentService.js +615 -0
- package/dist/services/index.d.ts +36 -0
- package/dist/services/index.js +97 -0
- package/dist/services/injection_field/InjectionFieldService.d.ts +113 -0
- package/dist/services/injection_field/InjectionFieldService.js +220 -0
- package/dist/services/inventory/InventoryService.d.ts +27 -0
- package/dist/services/inventory/InventoryService.js +231 -0
- package/dist/services/item/ItemService.d.ts +227 -0
- package/dist/services/item/ItemService.js +411 -0
- package/dist/services/location/LocationService.d.ts +154 -0
- package/dist/services/location/LocationService.js +256 -0
- package/dist/services/logistic/LogisticService.d.ts +104 -0
- package/dist/services/logistic/LogisticService.js +150 -0
- package/dist/services/permission/PermissionService.d.ts +296 -0
- package/dist/services/permission/PermissionService.js +576 -0
- package/dist/services/permission/config/custom/adminPermission.d.ts +4 -0
- package/dist/services/permission/config/custom/adminPermission.js +18 -0
- package/dist/services/permission/config/custom/config.d.ts +40 -0
- package/dist/services/permission/config/custom/config.js +23 -0
- package/dist/services/permission/config/default/adminPermission.d.ts +2 -0
- package/dist/services/permission/config/default/adminPermission.js +129 -0
- package/dist/services/permission/config/default/agentPermission.d.ts +2 -0
- package/dist/services/permission/config/default/agentPermission.js +43 -0
- package/dist/services/permission/config/default/customerPermission.d.ts +2 -0
- package/dist/services/permission/config/default/customerPermission.js +10 -0
- package/dist/services/permission/config/default/driverPermission.d.ts +2 -0
- package/dist/services/permission/config/default/driverPermission.js +4 -0
- package/dist/services/permission/config/default/workerPermission.d.ts +2 -0
- package/dist/services/permission/config/default/workerPermission.js +25 -0
- package/dist/services/rate/RateService.d.ts +201 -0
- package/dist/services/rate/RateService.js +303 -0
- package/dist/services/region/RegionService.d.ts +111 -0
- package/dist/services/region/RegionService.js +193 -0
- package/dist/services/repository/RepositoryService.d.ts +153 -0
- package/dist/services/repository/RepositoryService.js +243 -0
- package/dist/services/transaction/TransactionService.d.ts +153 -0
- package/dist/services/transaction/TransactionService.js +173 -0
- package/dist/services/user/BranchUserService.d.ts +129 -0
- package/dist/services/user/BranchUserService.js +193 -0
- package/dist/services/user/UserRoleService.d.ts +105 -0
- package/dist/services/user/UserRoleService.js +193 -0
- package/dist/services/user/UserService.d.ts +269 -0
- package/dist/services/user/UserService.js +477 -0
- package/dist/services/wallet/WalletService.d.ts +104 -0
- package/dist/services/wallet/WalletService.js +163 -0
- package/dist/utils/dateUtils.d.ts +6 -0
- package/dist/utils/dateUtils.js +28 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +13 -0
- package/package.json +27 -0
- package/src/config/config.ts +15 -0
- package/src/config/env.ts +18 -0
- package/src/config/index.ts +2 -0
- package/src/index.ts +41 -0
- package/src/lib/ApiService.ts +170 -0
- package/src/lib/index.ts +5 -0
- package/src/lib/queryParams.ts +162 -0
- package/src/services/account/AccountService.ts +232 -0
- package/src/services/auth/AuthService.ts +125 -0
- package/src/services/branch/BranchService.ts +330 -0
- package/src/services/business/BusinessService.ts +277 -0
- package/src/services/document/DocumentService.ts +1471 -0
- package/src/services/index.ts +73 -0
- package/src/services/injection_field/InjectionFieldService.ts +483 -0
- package/src/services/inventory/InventoryService.ts +314 -0
- package/src/services/item/ItemService.ts +707 -0
- package/src/services/location/LocationService.ts +505 -0
- package/src/services/logistic/LogisticService.ts +285 -0
- package/src/services/permission/PermissionService.ts +1069 -0
- package/src/services/permission/config/custom/adminPermission.ts +19 -0
- package/src/services/permission/config/custom/config.ts +39 -0
- package/src/services/permission/config/default/adminPermission.ts +129 -0
- package/src/services/permission/config/default/agentPermission.ts +42 -0
- package/src/services/permission/config/default/customerPermission.ts +9 -0
- package/src/services/permission/config/default/driverPermission.ts +4 -0
- package/src/services/permission/config/default/workerPermission.ts +25 -0
- package/src/services/rate/RateService.ts +570 -0
- package/src/services/region/RegionService.ts +353 -0
- package/src/services/repository/RepositoryService.ts +437 -0
- package/src/services/transaction/TransactionService.ts +404 -0
- package/src/services/user/BranchUserService.ts +381 -0
- package/src/services/user/UserRoleService.ts +342 -0
- package/src/services/user/UserService.ts +807 -0
- package/src/services/wallet/WalletService.ts +300 -0
- package/src/utils/dateUtils.ts +26 -0
- package/src/utils/index.ts +2 -0
- package/tsconfig.json +119 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserService = exports.inventoryTargetTypes = exports.inventoryTypes = void 0;
|
|
4
|
+
const lib_1 = require("@/lib");
|
|
5
|
+
const lib_2 = require("@/lib");
|
|
6
|
+
exports.inventoryTypes = {
|
|
7
|
+
inventory: "inventory",
|
|
8
|
+
// item_threshold: "inventory/item_threshold"
|
|
9
|
+
inventoryRelocateThreshold: "relocate_threshold",
|
|
10
|
+
inventoryReorderThreshold: "reorder_threshold",
|
|
11
|
+
};
|
|
12
|
+
exports.inventoryTargetTypes = {
|
|
13
|
+
inventory: "inventory"
|
|
14
|
+
};
|
|
15
|
+
// export type GetInventoryProps = BuildApiGetParamsProps & {
|
|
16
|
+
// id: number | string
|
|
17
|
+
// inventoryType?: InventoryType
|
|
18
|
+
// }
|
|
19
|
+
// export type CreateInventoryProps = {
|
|
20
|
+
// inventoryTargetType?: InventoryTargetType
|
|
21
|
+
// inventoryType?: InventoryType
|
|
22
|
+
// data:
|
|
23
|
+
// // administrator
|
|
24
|
+
// {
|
|
25
|
+
// administrator: {
|
|
26
|
+
// credential: UserCredential,
|
|
27
|
+
// locationIds: number[]
|
|
28
|
+
// }
|
|
29
|
+
// } |
|
|
30
|
+
// // customer
|
|
31
|
+
// {
|
|
32
|
+
// customer: {
|
|
33
|
+
// credential: UserCredential,
|
|
34
|
+
// code: string
|
|
35
|
+
// accountCode: string
|
|
36
|
+
// companyName: string
|
|
37
|
+
// regNo: string
|
|
38
|
+
// secondaryRegNo: string
|
|
39
|
+
// taxIdentificationNo: string,
|
|
40
|
+
// taxRegistrationNo: string,
|
|
41
|
+
// remark: string
|
|
42
|
+
// salesperson: string
|
|
43
|
+
// excludeTaxRate: number[]
|
|
44
|
+
// }
|
|
45
|
+
// }
|
|
46
|
+
// }
|
|
47
|
+
// export type UpdateInventoryProps = {
|
|
48
|
+
// id: number
|
|
49
|
+
// inventoryTargetType?: InventoryTargetType
|
|
50
|
+
// inventoryType?: InventoryType
|
|
51
|
+
// data:
|
|
52
|
+
// // administatrator
|
|
53
|
+
// {
|
|
54
|
+
// administrator: {
|
|
55
|
+
// credential: Omit<UserCredential, "username" | "password"> & { password?: string },
|
|
56
|
+
// locationIds: number[]
|
|
57
|
+
// }
|
|
58
|
+
// } |
|
|
59
|
+
// // customer
|
|
60
|
+
// {
|
|
61
|
+
// customer: {
|
|
62
|
+
// credential: Omit<UserCredential, "username" | "password"> & { password?: string },
|
|
63
|
+
// code: string
|
|
64
|
+
// accountCode: string
|
|
65
|
+
// companyName: string
|
|
66
|
+
// regNo: string
|
|
67
|
+
// secondaryRegNo: string
|
|
68
|
+
// taxIdentificationNo: string,
|
|
69
|
+
// taxRegistrationNo: string,
|
|
70
|
+
// remark: string
|
|
71
|
+
// salesperson: string
|
|
72
|
+
// excludeTaxRate: number[]
|
|
73
|
+
// }
|
|
74
|
+
// }
|
|
75
|
+
// }
|
|
76
|
+
// export type RemoveInventoryProps = {
|
|
77
|
+
// inventoryTargetType?: InventoryTargetType
|
|
78
|
+
// ids: number[]
|
|
79
|
+
// }
|
|
80
|
+
// export type GetDataTypeInventoryProps = {
|
|
81
|
+
// inventoryType?: InventoryType
|
|
82
|
+
// }
|
|
83
|
+
// const getCreatePayload = (inventoryType: InventoryType, data: CreateInventoryProps["data"]) => {
|
|
84
|
+
// if (inventoryType === "inventory" && "inventory" in data) {
|
|
85
|
+
// return {
|
|
86
|
+
// credential: {
|
|
87
|
+
// username: data.administrator.credential.username,
|
|
88
|
+
// password: data.administrator.credential.password,
|
|
89
|
+
// user_type: inventoryType,
|
|
90
|
+
// firstname: data.administrator.credential.firstname,
|
|
91
|
+
// lastname: data.administrator.credential.lastname,
|
|
92
|
+
// contact: data.administrator.credential.contact,
|
|
93
|
+
// email: data.administrator.credential.email,
|
|
94
|
+
// status: (data.administrator.credential.status === true) ? 1 : 0,
|
|
95
|
+
// address: data.administrator.credential.address
|
|
96
|
+
// },
|
|
97
|
+
// administrator: [],
|
|
98
|
+
// props: {
|
|
99
|
+
// location_id: data.administrator.locationIds
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
// }
|
|
103
|
+
// }
|
|
104
|
+
// const getUpdatePayload = (inventoryType: InventoryType, data: UpdateInventoryProps["data"]) => {
|
|
105
|
+
// if (inventoryType === "administrator" && "administrator" in data) {
|
|
106
|
+
// return {
|
|
107
|
+
// credential: {
|
|
108
|
+
// ...(data.administrator.credential.password ? { password: data.administrator.credential.password } : {}),
|
|
109
|
+
// firstname: data.administrator.credential.firstname,
|
|
110
|
+
// lastname: data.administrator.credential.lastname,
|
|
111
|
+
// contact: data.administrator.credential.contact,
|
|
112
|
+
// email: data.administrator.credential.email,
|
|
113
|
+
// status: (data.administrator.credential.status === true) ? 1 : 0,
|
|
114
|
+
// address: data.administrator.credential.address
|
|
115
|
+
// },
|
|
116
|
+
// administrator: [],
|
|
117
|
+
// props: {
|
|
118
|
+
// location_id: data.administrator.locationIds
|
|
119
|
+
// }
|
|
120
|
+
// }
|
|
121
|
+
// }
|
|
122
|
+
// }
|
|
123
|
+
const UserService = (props) => {
|
|
124
|
+
const { inventoryType = "inventory", inventoryTargetType, ...rest } = props ?? {};
|
|
125
|
+
const { makeCall } = (0, lib_1.ApiService)(rest?.customToken ? { customToken: rest.customToken } : {});
|
|
126
|
+
const endpoint1 = "inventories";
|
|
127
|
+
const endpoint2 = "inventories";
|
|
128
|
+
const list = async (props) => {
|
|
129
|
+
const { inventoryType: overrideInventoryType } = props;
|
|
130
|
+
let _inventoryType = overrideInventoryType || inventoryType;
|
|
131
|
+
let path = _inventoryType;
|
|
132
|
+
if (_inventoryType === "relocate_threshold") {
|
|
133
|
+
path = `inventory/${_inventoryType}`;
|
|
134
|
+
}
|
|
135
|
+
if (_inventoryType === "reorder_threshold") {
|
|
136
|
+
path = `inventory/${_inventoryType}`;
|
|
137
|
+
}
|
|
138
|
+
const url = (0, lib_2.buildApiListUrl)(`${endpoint2}/${path}`, props);
|
|
139
|
+
const response = await makeCall({
|
|
140
|
+
url,
|
|
141
|
+
method: "get",
|
|
142
|
+
payload: {},
|
|
143
|
+
// configuration
|
|
144
|
+
});
|
|
145
|
+
return response;
|
|
146
|
+
};
|
|
147
|
+
// const get = async (props: GetInventoryProps) => {
|
|
148
|
+
// const { id, inventoryType: overrideInventoryType } = props;
|
|
149
|
+
// const url = buildApiGetUrl(
|
|
150
|
+
// `${endpoint1}/${overrideInventoryType || inventoryType}/${id}`,
|
|
151
|
+
// props
|
|
152
|
+
// );
|
|
153
|
+
// const response = await makeCall({
|
|
154
|
+
// url,
|
|
155
|
+
// method: "get",
|
|
156
|
+
// payload: {},
|
|
157
|
+
// // configuration
|
|
158
|
+
// });
|
|
159
|
+
// return response;
|
|
160
|
+
// }
|
|
161
|
+
// const create = async ({ data, inventoryType: overrideInventoryType, inventoryTargetType: overrideInventoryTargetType }: CreateInventoryProps) => {
|
|
162
|
+
// let _inventoryType = overrideInventoryType || inventoryType
|
|
163
|
+
// let payload: any = getCreatePayload(_inventoryType, data)
|
|
164
|
+
// let url = `${endpoint1}`;
|
|
165
|
+
// let postData = {
|
|
166
|
+
// scope: {
|
|
167
|
+
// target: overrideInventoryTargetType || inventoryTargetType,
|
|
168
|
+
// action: "",
|
|
169
|
+
// },
|
|
170
|
+
// payload
|
|
171
|
+
// }
|
|
172
|
+
// const response = await makeCall({
|
|
173
|
+
// url,
|
|
174
|
+
// method: "post",
|
|
175
|
+
// payload: postData
|
|
176
|
+
// });
|
|
177
|
+
// return response;
|
|
178
|
+
// }
|
|
179
|
+
// const update = async ({ id, data, inventoryType: overrideInventoryType, inventoryTargetType: overrideInventoryTargetType }: UpdateInventoryProps) => {
|
|
180
|
+
// let url = `${endpoint1}/${id}`
|
|
181
|
+
// let _inventoryType = overrideInventoryType || inventoryType
|
|
182
|
+
// let payload: any = getUpdatePayload(_inventoryType, data)
|
|
183
|
+
// const postData = {
|
|
184
|
+
// scope: {
|
|
185
|
+
// target: overrideInventoryTargetType || inventoryTargetType,
|
|
186
|
+
// action: "",
|
|
187
|
+
// },
|
|
188
|
+
// payload
|
|
189
|
+
// }
|
|
190
|
+
// const response = await makeCall({
|
|
191
|
+
// url,
|
|
192
|
+
// method: "put",
|
|
193
|
+
// payload: postData
|
|
194
|
+
// });
|
|
195
|
+
// return response;
|
|
196
|
+
// }
|
|
197
|
+
// const remove = async ({ ids, inventoryTargetType: overrideInventoryTargetType }: RemoveInventoryProps) => {
|
|
198
|
+
// let url = `${endpoint2}/delete`
|
|
199
|
+
// const postData = {
|
|
200
|
+
// scope: {
|
|
201
|
+
// target: overrideInventoryTargetType || inventoryTargetType,
|
|
202
|
+
// },
|
|
203
|
+
// payload: {
|
|
204
|
+
// ids
|
|
205
|
+
// }
|
|
206
|
+
// }
|
|
207
|
+
// const response = await makeCall({
|
|
208
|
+
// url,
|
|
209
|
+
// method: "post",
|
|
210
|
+
// payload: postData
|
|
211
|
+
// });
|
|
212
|
+
// return response;
|
|
213
|
+
// }
|
|
214
|
+
// const getDataTypes = async ({ inventoryType: overrideInventoryType }: GetDataTypeInventoryProps) => {
|
|
215
|
+
// let url = `${endpoint2}/data_types/${overrideInventoryType || inventoryType}`
|
|
216
|
+
// const response = await makeCall({
|
|
217
|
+
// url,
|
|
218
|
+
// method: "get",
|
|
219
|
+
// });
|
|
220
|
+
// return response;
|
|
221
|
+
// }
|
|
222
|
+
return {
|
|
223
|
+
list,
|
|
224
|
+
// get,
|
|
225
|
+
// create,
|
|
226
|
+
// update,
|
|
227
|
+
// remove,
|
|
228
|
+
// getDataTypes
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
exports.UserService = UserService;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { ApiServiceType } from '@/lib';
|
|
2
|
+
import { BuildApiListParamsProps, BuildApiGetParamsProps } from '@/lib';
|
|
3
|
+
export declare const uomConfig: {
|
|
4
|
+
decimalPlaces: number[];
|
|
5
|
+
metricTypes: {
|
|
6
|
+
weight: {
|
|
7
|
+
id: string;
|
|
8
|
+
abbreviation: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}[];
|
|
11
|
+
volume: {
|
|
12
|
+
id: string;
|
|
13
|
+
abbreviation: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}[];
|
|
16
|
+
unit: {
|
|
17
|
+
id: string;
|
|
18
|
+
abbreviation: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const itemTypes: {
|
|
24
|
+
readonly item: "item";
|
|
25
|
+
readonly brand: "item_brand";
|
|
26
|
+
readonly category: "item_category";
|
|
27
|
+
readonly uom: "item_uom";
|
|
28
|
+
readonly product: "product";
|
|
29
|
+
};
|
|
30
|
+
export declare const itemTargetTypes: {
|
|
31
|
+
readonly item: "item";
|
|
32
|
+
readonly brand: "item_brand";
|
|
33
|
+
readonly category: "item_category";
|
|
34
|
+
readonly uom: "item_uom";
|
|
35
|
+
readonly product: "product";
|
|
36
|
+
};
|
|
37
|
+
export type ItemType = typeof itemTypes[keyof typeof itemTypes];
|
|
38
|
+
export type ItemTargetType = typeof itemTargetTypes[keyof typeof itemTargetTypes];
|
|
39
|
+
export type ItemTargetKey = keyof typeof itemTargetTypes;
|
|
40
|
+
export type ItemServiceProps = ApiServiceType & {
|
|
41
|
+
itemTargetType?: ItemTargetType;
|
|
42
|
+
itemType?: ItemType;
|
|
43
|
+
};
|
|
44
|
+
export type ListItemProps = BuildApiListParamsProps & {
|
|
45
|
+
itemType?: ItemType;
|
|
46
|
+
};
|
|
47
|
+
export type GetItemProps = BuildApiGetParamsProps & {
|
|
48
|
+
id: number | string;
|
|
49
|
+
itemType: ItemType;
|
|
50
|
+
};
|
|
51
|
+
type Product = {
|
|
52
|
+
name: string;
|
|
53
|
+
model: string;
|
|
54
|
+
productCode: string;
|
|
55
|
+
description: string;
|
|
56
|
+
categoryId: number;
|
|
57
|
+
brandId: number;
|
|
58
|
+
summary: string;
|
|
59
|
+
defaultUomItemId: number;
|
|
60
|
+
status: boolean;
|
|
61
|
+
};
|
|
62
|
+
type ItemProp = {
|
|
63
|
+
supplierId: number[];
|
|
64
|
+
transformRatio?: number;
|
|
65
|
+
repackRemark: string;
|
|
66
|
+
scanningCodePrefix: string;
|
|
67
|
+
scanningCodeSuffix: string;
|
|
68
|
+
relocateTopupQty: number;
|
|
69
|
+
reorderTopupQty: number;
|
|
70
|
+
relocateThresholdQty: number;
|
|
71
|
+
reorderThresholdQty: number;
|
|
72
|
+
};
|
|
73
|
+
type Item = {
|
|
74
|
+
productId: number;
|
|
75
|
+
isPackage: boolean;
|
|
76
|
+
status: boolean;
|
|
77
|
+
code: string;
|
|
78
|
+
description: string;
|
|
79
|
+
remark: string;
|
|
80
|
+
cost: number;
|
|
81
|
+
uomId: number;
|
|
82
|
+
uomPrice: number;
|
|
83
|
+
floorPrice: number;
|
|
84
|
+
volumeWeight: number;
|
|
85
|
+
grossWeight: number;
|
|
86
|
+
netWeight: number;
|
|
87
|
+
dimensionWidth: number;
|
|
88
|
+
dimensionHeight: number;
|
|
89
|
+
dimensionLength: number;
|
|
90
|
+
cbm: number;
|
|
91
|
+
};
|
|
92
|
+
type Category = {
|
|
93
|
+
parentCategoryId: number;
|
|
94
|
+
name: string;
|
|
95
|
+
description: string;
|
|
96
|
+
status: boolean;
|
|
97
|
+
};
|
|
98
|
+
type Brand = {
|
|
99
|
+
name: string;
|
|
100
|
+
description: string;
|
|
101
|
+
status: boolean;
|
|
102
|
+
};
|
|
103
|
+
type Uom = {
|
|
104
|
+
name: string;
|
|
105
|
+
description: string;
|
|
106
|
+
metricType: "weight" | "unit" | "volume";
|
|
107
|
+
metricTypeDisplayName: string;
|
|
108
|
+
decimalDigit: number;
|
|
109
|
+
status: boolean;
|
|
110
|
+
};
|
|
111
|
+
export type CreateItemProps = {
|
|
112
|
+
itemTargetType?: ItemTargetType;
|
|
113
|
+
itemType?: ItemType;
|
|
114
|
+
data: {
|
|
115
|
+
product: {
|
|
116
|
+
product: Product;
|
|
117
|
+
item: Omit<Item, "productId">;
|
|
118
|
+
props?: ItemProp;
|
|
119
|
+
status: {
|
|
120
|
+
scanningShowCbm: boolean;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
} | {
|
|
124
|
+
item: {
|
|
125
|
+
item: Item;
|
|
126
|
+
props: ItemProp;
|
|
127
|
+
status: {
|
|
128
|
+
scanningShowCbm: boolean;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
itemCategory: Category;
|
|
133
|
+
} | {
|
|
134
|
+
itemBrand: Brand;
|
|
135
|
+
} | {
|
|
136
|
+
itemUom: Uom;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
export type CreateMultipleItemProps = {
|
|
140
|
+
itemTargetType?: Extract<ItemTargetType, "item">;
|
|
141
|
+
itemType?: Extract<ItemType, "item">;
|
|
142
|
+
data: Item[];
|
|
143
|
+
};
|
|
144
|
+
export type CreateMultipleItemPropsProps = {
|
|
145
|
+
itemTargetType?: Extract<ItemTargetType, "item">;
|
|
146
|
+
itemType?: Extract<ItemType, "item">;
|
|
147
|
+
data: (ItemProp & {
|
|
148
|
+
itemId: number;
|
|
149
|
+
})[];
|
|
150
|
+
};
|
|
151
|
+
export type UpdateItemProps = {
|
|
152
|
+
id: number;
|
|
153
|
+
itemTargetType?: ItemTargetType;
|
|
154
|
+
itemType?: ItemType;
|
|
155
|
+
data: // product
|
|
156
|
+
{
|
|
157
|
+
product: Product;
|
|
158
|
+
item: Omit<Item, "productId">;
|
|
159
|
+
props?: ItemProp;
|
|
160
|
+
status: {
|
|
161
|
+
scanningShowCbm: boolean;
|
|
162
|
+
};
|
|
163
|
+
} | {
|
|
164
|
+
item: Omit<Item, "productId">;
|
|
165
|
+
props: ItemProp;
|
|
166
|
+
status: {
|
|
167
|
+
scanningShowCbm: boolean;
|
|
168
|
+
};
|
|
169
|
+
} | {
|
|
170
|
+
itemCategory: Category;
|
|
171
|
+
} | {
|
|
172
|
+
itemBrand: Brand;
|
|
173
|
+
} | {
|
|
174
|
+
itemUom: Uom;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export type RemoveItemProps = {
|
|
178
|
+
itemTargetType?: ItemTargetType;
|
|
179
|
+
ids: number[];
|
|
180
|
+
};
|
|
181
|
+
export type GetDataTypeItemProps = {
|
|
182
|
+
itemType?: ItemType;
|
|
183
|
+
};
|
|
184
|
+
export declare const ItemService: (props?: ItemServiceProps) => {
|
|
185
|
+
filterOperatorTypes: Record<string, string>;
|
|
186
|
+
list: (props: ListItemProps) => Promise<{
|
|
187
|
+
status: boolean;
|
|
188
|
+
message: string;
|
|
189
|
+
data?: any;
|
|
190
|
+
}>;
|
|
191
|
+
get: (props: GetItemProps) => Promise<{
|
|
192
|
+
status: boolean;
|
|
193
|
+
message: string;
|
|
194
|
+
data?: any;
|
|
195
|
+
}>;
|
|
196
|
+
create: ({ data, itemType: overrideItemType, itemTargetType: overrideItemTargetType }: CreateItemProps) => Promise<{
|
|
197
|
+
status: boolean;
|
|
198
|
+
message: string;
|
|
199
|
+
data?: any;
|
|
200
|
+
}>;
|
|
201
|
+
multipleItemCreate: ({ data, itemType: overrideItemType, itemTargetType: overrideItemTargetType }: CreateMultipleItemProps) => Promise<{
|
|
202
|
+
status: boolean;
|
|
203
|
+
message: string;
|
|
204
|
+
data?: any;
|
|
205
|
+
}>;
|
|
206
|
+
multipleItemPropsCreate: ({ data, itemType: overrideItemType, itemTargetType: overrideItemTargetType }: CreateMultipleItemPropsProps) => Promise<{
|
|
207
|
+
status: boolean;
|
|
208
|
+
message: string;
|
|
209
|
+
data?: any;
|
|
210
|
+
}>;
|
|
211
|
+
update: ({ id, data, itemType: overrideItemType, itemTargetType: overrideItemTargetType }: UpdateItemProps) => Promise<{
|
|
212
|
+
status: boolean;
|
|
213
|
+
message: string;
|
|
214
|
+
data?: any;
|
|
215
|
+
}>;
|
|
216
|
+
remove: ({ ids, itemTargetType: overrideItemTargetType }: RemoveItemProps) => Promise<{
|
|
217
|
+
status: boolean;
|
|
218
|
+
message: string;
|
|
219
|
+
data?: any;
|
|
220
|
+
}>;
|
|
221
|
+
getDataTypes: ({ itemType: overrideItemType }: GetDataTypeItemProps) => Promise<{
|
|
222
|
+
status: boolean;
|
|
223
|
+
message: string;
|
|
224
|
+
data?: any;
|
|
225
|
+
}>;
|
|
226
|
+
};
|
|
227
|
+
export {};
|