@arascreative/erp-api-client 0.1.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/dist/index.d.mts +1074 -0
- package/dist/index.d.ts +1074 -0
- package/dist/index.js +747 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +631 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +37 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1074 @@
|
|
|
1
|
+
import { UseMutationOptions, UseQueryOptions, DataTag, QueryKey, QueryClient, UseMutationResult, DefinedInitialDataOptions, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
|
+
import * as zod from 'zod';
|
|
4
|
+
|
|
5
|
+
interface AddressData {
|
|
6
|
+
addressId: string;
|
|
7
|
+
subDistrictName: string;
|
|
8
|
+
districtName: string;
|
|
9
|
+
cityName: string;
|
|
10
|
+
provinceName: string;
|
|
11
|
+
zipCode: string;
|
|
12
|
+
}
|
|
13
|
+
type AddressSearchResultItemDtoExternalId = null | string;
|
|
14
|
+
interface AddressSearchResultItemDto {
|
|
15
|
+
addressId?: string;
|
|
16
|
+
externalId?: AddressSearchResultItemDtoExternalId;
|
|
17
|
+
destinationCode?: string;
|
|
18
|
+
originCode?: string;
|
|
19
|
+
provinceName?: string;
|
|
20
|
+
cityName?: string;
|
|
21
|
+
districtName?: string;
|
|
22
|
+
subDistrictName?: string;
|
|
23
|
+
zipCode?: string;
|
|
24
|
+
}
|
|
25
|
+
type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoCode = null | string;
|
|
26
|
+
type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoData = null | AddressSearchResultItemDto[];
|
|
27
|
+
type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoMessage = null | string;
|
|
28
|
+
type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoErrors = null | string[];
|
|
29
|
+
type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoRequestId = null | string;
|
|
30
|
+
interface ApiResponseOfIReadOnlyListOfAddressSearchResultItemDto {
|
|
31
|
+
code?: ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoCode;
|
|
32
|
+
data?: ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoData;
|
|
33
|
+
success?: boolean;
|
|
34
|
+
statusCode?: number;
|
|
35
|
+
message?: ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoMessage;
|
|
36
|
+
errors?: ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoErrors;
|
|
37
|
+
requestId?: ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoRequestId;
|
|
38
|
+
timestamp?: string;
|
|
39
|
+
}
|
|
40
|
+
type ApiResponseOfListOfWarehouseOptionResponseCode = null | string;
|
|
41
|
+
type ApiResponseOfListOfWarehouseOptionResponseData = null | WarehouseOptionResponse[];
|
|
42
|
+
type ApiResponseOfListOfWarehouseOptionResponseMessage = null | string;
|
|
43
|
+
type ApiResponseOfListOfWarehouseOptionResponseErrors = null | string[];
|
|
44
|
+
type ApiResponseOfListOfWarehouseOptionResponseRequestId = null | string;
|
|
45
|
+
interface ApiResponseOfListOfWarehouseOptionResponse {
|
|
46
|
+
code?: ApiResponseOfListOfWarehouseOptionResponseCode;
|
|
47
|
+
data?: ApiResponseOfListOfWarehouseOptionResponseData;
|
|
48
|
+
success?: boolean;
|
|
49
|
+
statusCode?: number;
|
|
50
|
+
message?: ApiResponseOfListOfWarehouseOptionResponseMessage;
|
|
51
|
+
errors?: ApiResponseOfListOfWarehouseOptionResponseErrors;
|
|
52
|
+
requestId?: ApiResponseOfListOfWarehouseOptionResponseRequestId;
|
|
53
|
+
timestamp?: string;
|
|
54
|
+
}
|
|
55
|
+
type ApiResponseOfObjectCode = null | string;
|
|
56
|
+
type ApiResponseOfObjectMessage = null | string;
|
|
57
|
+
type ApiResponseOfObjectErrors = null | string[];
|
|
58
|
+
type ApiResponseOfObjectRequestId = null | string;
|
|
59
|
+
interface ApiResponseOfObject {
|
|
60
|
+
code?: ApiResponseOfObjectCode;
|
|
61
|
+
data?: unknown;
|
|
62
|
+
success?: boolean;
|
|
63
|
+
statusCode?: number;
|
|
64
|
+
message?: ApiResponseOfObjectMessage;
|
|
65
|
+
errors?: ApiResponseOfObjectErrors;
|
|
66
|
+
requestId?: ApiResponseOfObjectRequestId;
|
|
67
|
+
timestamp?: string;
|
|
68
|
+
}
|
|
69
|
+
type ApiResponseOfPagedListOfStockItemResponseCode = null | string;
|
|
70
|
+
type ApiResponseOfPagedListOfStockItemResponseData = null | PagedListOfStockItemResponse;
|
|
71
|
+
type ApiResponseOfPagedListOfStockItemResponseMessage = null | string;
|
|
72
|
+
type ApiResponseOfPagedListOfStockItemResponseErrors = null | string[];
|
|
73
|
+
type ApiResponseOfPagedListOfStockItemResponseRequestId = null | string;
|
|
74
|
+
interface ApiResponseOfPagedListOfStockItemResponse {
|
|
75
|
+
code?: ApiResponseOfPagedListOfStockItemResponseCode;
|
|
76
|
+
data?: ApiResponseOfPagedListOfStockItemResponseData;
|
|
77
|
+
success?: boolean;
|
|
78
|
+
statusCode?: number;
|
|
79
|
+
message?: ApiResponseOfPagedListOfStockItemResponseMessage;
|
|
80
|
+
errors?: ApiResponseOfPagedListOfStockItemResponseErrors;
|
|
81
|
+
requestId?: ApiResponseOfPagedListOfStockItemResponseRequestId;
|
|
82
|
+
timestamp?: string;
|
|
83
|
+
}
|
|
84
|
+
type ApiResponseOfPagedListOfStockMovementResponseCode = null | string;
|
|
85
|
+
type ApiResponseOfPagedListOfStockMovementResponseData = null | PagedListOfStockMovementResponse;
|
|
86
|
+
type ApiResponseOfPagedListOfStockMovementResponseMessage = null | string;
|
|
87
|
+
type ApiResponseOfPagedListOfStockMovementResponseErrors = null | string[];
|
|
88
|
+
type ApiResponseOfPagedListOfStockMovementResponseRequestId = null | string;
|
|
89
|
+
interface ApiResponseOfPagedListOfStockMovementResponse {
|
|
90
|
+
code?: ApiResponseOfPagedListOfStockMovementResponseCode;
|
|
91
|
+
data?: ApiResponseOfPagedListOfStockMovementResponseData;
|
|
92
|
+
success?: boolean;
|
|
93
|
+
statusCode?: number;
|
|
94
|
+
message?: ApiResponseOfPagedListOfStockMovementResponseMessage;
|
|
95
|
+
errors?: ApiResponseOfPagedListOfStockMovementResponseErrors;
|
|
96
|
+
requestId?: ApiResponseOfPagedListOfStockMovementResponseRequestId;
|
|
97
|
+
timestamp?: string;
|
|
98
|
+
}
|
|
99
|
+
type ApiResponseOfPagedListOfWarehouseResponseCode = null | string;
|
|
100
|
+
type ApiResponseOfPagedListOfWarehouseResponseData = null | PagedListOfWarehouseResponse;
|
|
101
|
+
type ApiResponseOfPagedListOfWarehouseResponseMessage = null | string;
|
|
102
|
+
type ApiResponseOfPagedListOfWarehouseResponseErrors = null | string[];
|
|
103
|
+
type ApiResponseOfPagedListOfWarehouseResponseRequestId = null | string;
|
|
104
|
+
interface ApiResponseOfPagedListOfWarehouseResponse {
|
|
105
|
+
code?: ApiResponseOfPagedListOfWarehouseResponseCode;
|
|
106
|
+
data?: ApiResponseOfPagedListOfWarehouseResponseData;
|
|
107
|
+
success?: boolean;
|
|
108
|
+
statusCode?: number;
|
|
109
|
+
message?: ApiResponseOfPagedListOfWarehouseResponseMessage;
|
|
110
|
+
errors?: ApiResponseOfPagedListOfWarehouseResponseErrors;
|
|
111
|
+
requestId?: ApiResponseOfPagedListOfWarehouseResponseRequestId;
|
|
112
|
+
timestamp?: string;
|
|
113
|
+
}
|
|
114
|
+
type ApiResponseOfWarehouseResponseCode = null | string;
|
|
115
|
+
type ApiResponseOfWarehouseResponseData = null | WarehouseResponse;
|
|
116
|
+
type ApiResponseOfWarehouseResponseMessage = null | string;
|
|
117
|
+
type ApiResponseOfWarehouseResponseErrors = null | string[];
|
|
118
|
+
type ApiResponseOfWarehouseResponseRequestId = null | string;
|
|
119
|
+
interface ApiResponseOfWarehouseResponse {
|
|
120
|
+
code?: ApiResponseOfWarehouseResponseCode;
|
|
121
|
+
data?: ApiResponseOfWarehouseResponseData;
|
|
122
|
+
success?: boolean;
|
|
123
|
+
statusCode?: number;
|
|
124
|
+
message?: ApiResponseOfWarehouseResponseMessage;
|
|
125
|
+
errors?: ApiResponseOfWarehouseResponseErrors;
|
|
126
|
+
requestId?: ApiResponseOfWarehouseResponseRequestId;
|
|
127
|
+
timestamp?: string;
|
|
128
|
+
}
|
|
129
|
+
type ConsumeBatchRequestExternalReferenceNo = null | string;
|
|
130
|
+
type ConsumeBatchRequestNote = null | string;
|
|
131
|
+
interface ConsumeBatchRequest {
|
|
132
|
+
quantity: number;
|
|
133
|
+
sourceType: ConsumeBatchSourceType;
|
|
134
|
+
externalReferenceNo?: ConsumeBatchRequestExternalReferenceNo;
|
|
135
|
+
note?: ConsumeBatchRequestNote;
|
|
136
|
+
}
|
|
137
|
+
type ConsumeBatchSourceType = (typeof ConsumeBatchSourceType)[keyof typeof ConsumeBatchSourceType];
|
|
138
|
+
declare const ConsumeBatchSourceType: {
|
|
139
|
+
readonly LOAN_OUT: "LOAN_OUT";
|
|
140
|
+
readonly TRANSFER_OUT: "TRANSFER_OUT";
|
|
141
|
+
readonly ADJUSTMENT: "ADJUSTMENT";
|
|
142
|
+
readonly SAMPLE: "SAMPLE";
|
|
143
|
+
readonly DAMAGED: "DAMAGED";
|
|
144
|
+
readonly INTERNAL_USE: "INTERNAL_USE";
|
|
145
|
+
};
|
|
146
|
+
type CreateBatchRequestExpiresOn = null | string;
|
|
147
|
+
type CreateBatchRequestExternalReferenceNo = null | string;
|
|
148
|
+
type CreateBatchRequestNote = null | string;
|
|
149
|
+
type CreateBatchRequestReceivedBy = null | string;
|
|
150
|
+
interface CreateBatchRequest {
|
|
151
|
+
itemId: string;
|
|
152
|
+
warehouseId: string;
|
|
153
|
+
receivedQty: number;
|
|
154
|
+
unitCost: number;
|
|
155
|
+
receivedAt: string;
|
|
156
|
+
expiresOn?: CreateBatchRequestExpiresOn;
|
|
157
|
+
sourceType: SourceTypeEnum;
|
|
158
|
+
externalReferenceNo?: CreateBatchRequestExternalReferenceNo;
|
|
159
|
+
note?: CreateBatchRequestNote;
|
|
160
|
+
receivedBy?: CreateBatchRequestReceivedBy;
|
|
161
|
+
}
|
|
162
|
+
interface CreateStockItemCommand {
|
|
163
|
+
name: string;
|
|
164
|
+
sku: string;
|
|
165
|
+
unit: string;
|
|
166
|
+
}
|
|
167
|
+
type CreateWarehouseCommandFullAddressText = null | string;
|
|
168
|
+
interface CreateWarehouseCommand {
|
|
169
|
+
name: string;
|
|
170
|
+
addressId: string;
|
|
171
|
+
personInCharge: PersonInChargeData;
|
|
172
|
+
fullAddressText?: CreateWarehouseCommandFullAddressText;
|
|
173
|
+
}
|
|
174
|
+
interface PagedListOfStockItemResponse {
|
|
175
|
+
items: StockItemResponse[];
|
|
176
|
+
page: number;
|
|
177
|
+
pageSize: number;
|
|
178
|
+
totalCount: number;
|
|
179
|
+
totalPages?: number;
|
|
180
|
+
hasNextPage?: boolean;
|
|
181
|
+
hasPreviousPage?: boolean;
|
|
182
|
+
}
|
|
183
|
+
interface PagedListOfStockMovementResponse {
|
|
184
|
+
items: StockMovementResponse[];
|
|
185
|
+
page: number;
|
|
186
|
+
pageSize: number;
|
|
187
|
+
totalCount: number;
|
|
188
|
+
totalPages?: number;
|
|
189
|
+
hasNextPage?: boolean;
|
|
190
|
+
hasPreviousPage?: boolean;
|
|
191
|
+
}
|
|
192
|
+
interface PagedListOfWarehouseResponse {
|
|
193
|
+
items: WarehouseResponse[];
|
|
194
|
+
page: number;
|
|
195
|
+
pageSize: number;
|
|
196
|
+
totalCount: number;
|
|
197
|
+
totalPages?: number;
|
|
198
|
+
hasNextPage?: boolean;
|
|
199
|
+
hasPreviousPage?: boolean;
|
|
200
|
+
}
|
|
201
|
+
type PersonInChargeDataPhone = null | string;
|
|
202
|
+
interface PersonInChargeData {
|
|
203
|
+
name: string;
|
|
204
|
+
phone: PersonInChargeDataPhone;
|
|
205
|
+
}
|
|
206
|
+
type SourceTypeEnum = (typeof SourceTypeEnum)[keyof typeof SourceTypeEnum];
|
|
207
|
+
declare const SourceTypeEnum: {
|
|
208
|
+
readonly PURCHASE: "PURCHASE";
|
|
209
|
+
readonly CUSTOMER_RETURN: "CUSTOMER_RETURN";
|
|
210
|
+
readonly LOAN_RETURN: "LOAN_RETURN";
|
|
211
|
+
};
|
|
212
|
+
type StockItemResponseWarehouseId = null | string;
|
|
213
|
+
type StockItemResponseWarehouseName = null | string;
|
|
214
|
+
interface StockItemResponse {
|
|
215
|
+
id?: string;
|
|
216
|
+
sku?: string;
|
|
217
|
+
name?: string;
|
|
218
|
+
unit?: string;
|
|
219
|
+
isActive?: boolean;
|
|
220
|
+
warehouseId?: StockItemResponseWarehouseId;
|
|
221
|
+
warehouseName?: StockItemResponseWarehouseName;
|
|
222
|
+
onHandQty?: number;
|
|
223
|
+
reservedQty?: number;
|
|
224
|
+
availableQty?: number;
|
|
225
|
+
}
|
|
226
|
+
type StockMovementResponseWarehouseName = null | string;
|
|
227
|
+
type StockMovementResponseBatchId = null | string;
|
|
228
|
+
type StockMovementResponseSourceReferenceId = null | string;
|
|
229
|
+
type StockMovementResponseExternalReferenceNo = null | string;
|
|
230
|
+
type StockMovementResponseNote = null | string;
|
|
231
|
+
type StockMovementResponseReceivedBy = null | string;
|
|
232
|
+
interface StockMovementResponse {
|
|
233
|
+
id?: string;
|
|
234
|
+
itemId?: string;
|
|
235
|
+
itemName?: string;
|
|
236
|
+
warehouseId?: string;
|
|
237
|
+
warehouseName?: StockMovementResponseWarehouseName;
|
|
238
|
+
batchId?: StockMovementResponseBatchId;
|
|
239
|
+
direction?: string;
|
|
240
|
+
quantity?: number;
|
|
241
|
+
sourceType?: string;
|
|
242
|
+
sourceReferenceId?: StockMovementResponseSourceReferenceId;
|
|
243
|
+
externalReferenceNo?: StockMovementResponseExternalReferenceNo;
|
|
244
|
+
note?: StockMovementResponseNote;
|
|
245
|
+
createdAt?: string;
|
|
246
|
+
recordedBy?: string;
|
|
247
|
+
receivedBy?: StockMovementResponseReceivedBy;
|
|
248
|
+
}
|
|
249
|
+
type UpdateWarehouseCommandFullAddressText = null | string;
|
|
250
|
+
interface UpdateWarehouseCommand {
|
|
251
|
+
warehouseId?: string;
|
|
252
|
+
name: string;
|
|
253
|
+
addressId: string;
|
|
254
|
+
personInCharge: PersonInChargeData;
|
|
255
|
+
fullAddressText?: UpdateWarehouseCommandFullAddressText;
|
|
256
|
+
}
|
|
257
|
+
interface WarehouseOptionResponse {
|
|
258
|
+
warehouseId: string;
|
|
259
|
+
name: string;
|
|
260
|
+
}
|
|
261
|
+
type WarehouseResponseFullAddressText = null | string;
|
|
262
|
+
interface WarehouseResponse {
|
|
263
|
+
warehouseId: string;
|
|
264
|
+
name: string;
|
|
265
|
+
isActive: boolean;
|
|
266
|
+
personInCharge: PersonInChargeData;
|
|
267
|
+
address: AddressData;
|
|
268
|
+
fullAddressText?: WarehouseResponseFullAddressText;
|
|
269
|
+
}
|
|
270
|
+
type ListWarehousesParams = {
|
|
271
|
+
/**
|
|
272
|
+
* Page number, starting at 1.
|
|
273
|
+
*/
|
|
274
|
+
page?: number;
|
|
275
|
+
/**
|
|
276
|
+
* Number of items per page (max 100).
|
|
277
|
+
*/
|
|
278
|
+
pageSize?: number;
|
|
279
|
+
};
|
|
280
|
+
type SearchAddressesParams = {
|
|
281
|
+
keyword: string;
|
|
282
|
+
limit?: number;
|
|
283
|
+
};
|
|
284
|
+
type ListStockItemsParams = {
|
|
285
|
+
/**
|
|
286
|
+
* Free-text search on name or SKU.
|
|
287
|
+
*/
|
|
288
|
+
search?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Filters by active status.
|
|
291
|
+
*/
|
|
292
|
+
isActive?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* Page number, starting at 1.
|
|
295
|
+
*/
|
|
296
|
+
page?: number;
|
|
297
|
+
/**
|
|
298
|
+
* Number of items per page (max 100).
|
|
299
|
+
*/
|
|
300
|
+
pageSize?: number;
|
|
301
|
+
/**
|
|
302
|
+
* Sort field (Sku, Name, IsActive, OnHandQty, CreatedAt, UpdatedAt).
|
|
303
|
+
*/
|
|
304
|
+
orderBy?: string;
|
|
305
|
+
/**
|
|
306
|
+
* Sort descending when true.
|
|
307
|
+
*/
|
|
308
|
+
descending?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* Filters by warehouse.
|
|
311
|
+
*/
|
|
312
|
+
warehouseId?: string;
|
|
313
|
+
};
|
|
314
|
+
type ListStockMovementsParams = {
|
|
315
|
+
/**
|
|
316
|
+
* Filters by stock item.
|
|
317
|
+
*/
|
|
318
|
+
itemId?: string;
|
|
319
|
+
/**
|
|
320
|
+
* Filters by batch.
|
|
321
|
+
*/
|
|
322
|
+
batchId?: string;
|
|
323
|
+
/**
|
|
324
|
+
* Filters by warehouse.
|
|
325
|
+
*/
|
|
326
|
+
warehouseId?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Page number, starting at 1.
|
|
329
|
+
*/
|
|
330
|
+
page?: number;
|
|
331
|
+
/**
|
|
332
|
+
* Number of items per page (max 100).
|
|
333
|
+
*/
|
|
334
|
+
pageSize?: number;
|
|
335
|
+
/**
|
|
336
|
+
* Sort field (CreatedAt, Direction, Quantity).
|
|
337
|
+
*/
|
|
338
|
+
orderBy?: string;
|
|
339
|
+
/**
|
|
340
|
+
* Sort descending when true.
|
|
341
|
+
*/
|
|
342
|
+
descending?: boolean;
|
|
343
|
+
};
|
|
344
|
+
declare const getHealth: (options?: AxiosRequestConfig) => Promise<AxiosResponse<void>>;
|
|
345
|
+
declare const getGetHealthQueryKey: () => readonly ["/health"];
|
|
346
|
+
declare const getGetHealthQueryOptions: <TData = Awaited<ReturnType<typeof getHealth>>, TError = AxiosError<unknown>>(options?: {
|
|
347
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getHealth>>, TError, TData>>;
|
|
348
|
+
axios?: AxiosRequestConfig;
|
|
349
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getHealth>>, TError, TData> & {
|
|
350
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
351
|
+
};
|
|
352
|
+
type GetHealthQueryResult = NonNullable<Awaited<ReturnType<typeof getHealth>>>;
|
|
353
|
+
type GetHealthQueryError = AxiosError<unknown>;
|
|
354
|
+
declare function useGetHealth<TData = Awaited<ReturnType<typeof getHealth>>, TError = AxiosError<unknown>>(options: {
|
|
355
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getHealth>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getHealth>>, TError, Awaited<ReturnType<typeof getHealth>>>, 'initialData'>;
|
|
356
|
+
axios?: AxiosRequestConfig;
|
|
357
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
358
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
359
|
+
};
|
|
360
|
+
declare function useGetHealth<TData = Awaited<ReturnType<typeof getHealth>>, TError = AxiosError<unknown>>(options?: {
|
|
361
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getHealth>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getHealth>>, TError, Awaited<ReturnType<typeof getHealth>>>, 'initialData'>;
|
|
362
|
+
axios?: AxiosRequestConfig;
|
|
363
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
364
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
365
|
+
};
|
|
366
|
+
declare function useGetHealth<TData = Awaited<ReturnType<typeof getHealth>>, TError = AxiosError<unknown>>(options?: {
|
|
367
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getHealth>>, TError, TData>>;
|
|
368
|
+
axios?: AxiosRequestConfig;
|
|
369
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
370
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Returns the id and name of every warehouse for use in dropdowns and selectors.
|
|
374
|
+
* @summary List warehouse options
|
|
375
|
+
*/
|
|
376
|
+
declare const getWarehouseOptions: (options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiResponseOfListOfWarehouseOptionResponse>>;
|
|
377
|
+
declare const getGetWarehouseOptionsQueryKey: () => readonly ["/api/warehouses/options"];
|
|
378
|
+
declare const getGetWarehouseOptionsQueryOptions: <TData = Awaited<ReturnType<typeof getWarehouseOptions>>, TError = AxiosError<unknown>>(options?: {
|
|
379
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getWarehouseOptions>>, TError, TData>>;
|
|
380
|
+
axios?: AxiosRequestConfig;
|
|
381
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getWarehouseOptions>>, TError, TData> & {
|
|
382
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
383
|
+
};
|
|
384
|
+
type GetWarehouseOptionsQueryResult = NonNullable<Awaited<ReturnType<typeof getWarehouseOptions>>>;
|
|
385
|
+
type GetWarehouseOptionsQueryError = AxiosError<unknown>;
|
|
386
|
+
declare function useGetWarehouseOptions<TData = Awaited<ReturnType<typeof getWarehouseOptions>>, TError = AxiosError<unknown>>(options: {
|
|
387
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getWarehouseOptions>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getWarehouseOptions>>, TError, Awaited<ReturnType<typeof getWarehouseOptions>>>, 'initialData'>;
|
|
388
|
+
axios?: AxiosRequestConfig;
|
|
389
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
390
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
391
|
+
};
|
|
392
|
+
declare function useGetWarehouseOptions<TData = Awaited<ReturnType<typeof getWarehouseOptions>>, TError = AxiosError<unknown>>(options?: {
|
|
393
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getWarehouseOptions>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getWarehouseOptions>>, TError, Awaited<ReturnType<typeof getWarehouseOptions>>>, 'initialData'>;
|
|
394
|
+
axios?: AxiosRequestConfig;
|
|
395
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
396
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
397
|
+
};
|
|
398
|
+
declare function useGetWarehouseOptions<TData = Awaited<ReturnType<typeof getWarehouseOptions>>, TError = AxiosError<unknown>>(options?: {
|
|
399
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getWarehouseOptions>>, TError, TData>>;
|
|
400
|
+
axios?: AxiosRequestConfig;
|
|
401
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
402
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* Returns a paginated list of warehouses with their active status and address details.
|
|
406
|
+
* @summary List warehouses
|
|
407
|
+
*/
|
|
408
|
+
declare const listWarehouses: (params?: ListWarehousesParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiResponseOfPagedListOfWarehouseResponse>>;
|
|
409
|
+
declare const getListWarehousesQueryKey: (params?: ListWarehousesParams) => readonly ["/api/warehouses", ...ListWarehousesParams[]];
|
|
410
|
+
declare const getListWarehousesQueryOptions: <TData = Awaited<ReturnType<typeof listWarehouses>>, TError = AxiosError<unknown>>(params?: ListWarehousesParams, options?: {
|
|
411
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listWarehouses>>, TError, TData>>;
|
|
412
|
+
axios?: AxiosRequestConfig;
|
|
413
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof listWarehouses>>, TError, TData> & {
|
|
414
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
415
|
+
};
|
|
416
|
+
type ListWarehousesQueryResult = NonNullable<Awaited<ReturnType<typeof listWarehouses>>>;
|
|
417
|
+
type ListWarehousesQueryError = AxiosError<unknown>;
|
|
418
|
+
declare function useListWarehouses<TData = Awaited<ReturnType<typeof listWarehouses>>, TError = AxiosError<unknown>>(params: undefined | ListWarehousesParams, options: {
|
|
419
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listWarehouses>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listWarehouses>>, TError, Awaited<ReturnType<typeof listWarehouses>>>, 'initialData'>;
|
|
420
|
+
axios?: AxiosRequestConfig;
|
|
421
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
422
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
423
|
+
};
|
|
424
|
+
declare function useListWarehouses<TData = Awaited<ReturnType<typeof listWarehouses>>, TError = AxiosError<unknown>>(params?: ListWarehousesParams, options?: {
|
|
425
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listWarehouses>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listWarehouses>>, TError, Awaited<ReturnType<typeof listWarehouses>>>, 'initialData'>;
|
|
426
|
+
axios?: AxiosRequestConfig;
|
|
427
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
428
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
429
|
+
};
|
|
430
|
+
declare function useListWarehouses<TData = Awaited<ReturnType<typeof listWarehouses>>, TError = AxiosError<unknown>>(params?: ListWarehousesParams, options?: {
|
|
431
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listWarehouses>>, TError, TData>>;
|
|
432
|
+
axios?: AxiosRequestConfig;
|
|
433
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
434
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* Creates a new warehouse that must reference an existing address. Validation failures return 400.
|
|
438
|
+
* @summary Create a warehouse
|
|
439
|
+
*/
|
|
440
|
+
declare const createWarehouse: (createWarehouseCommand: CreateWarehouseCommand, options?: AxiosRequestConfig) => Promise<AxiosResponse<void>>;
|
|
441
|
+
declare const getCreateWarehouseMutationOptions: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
442
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createWarehouse>>, TError, {
|
|
443
|
+
data: CreateWarehouseCommand;
|
|
444
|
+
}, TContext>;
|
|
445
|
+
axios?: AxiosRequestConfig;
|
|
446
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof createWarehouse>>, TError, {
|
|
447
|
+
data: CreateWarehouseCommand;
|
|
448
|
+
}, TContext>;
|
|
449
|
+
type CreateWarehouseMutationResult = NonNullable<Awaited<ReturnType<typeof createWarehouse>>>;
|
|
450
|
+
type CreateWarehouseMutationBody = CreateWarehouseCommand;
|
|
451
|
+
type CreateWarehouseMutationError = AxiosError<ApiResponseOfObject>;
|
|
452
|
+
/**
|
|
453
|
+
* @summary Create a warehouse
|
|
454
|
+
*/
|
|
455
|
+
declare const useCreateWarehouse: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
456
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createWarehouse>>, TError, {
|
|
457
|
+
data: CreateWarehouseCommand;
|
|
458
|
+
}, TContext>;
|
|
459
|
+
axios?: AxiosRequestConfig;
|
|
460
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createWarehouse>>, TError, {
|
|
461
|
+
data: CreateWarehouseCommand;
|
|
462
|
+
}, TContext>;
|
|
463
|
+
/**
|
|
464
|
+
* Returns the warehouse with the given identifier, or 404 when it does not exist.
|
|
465
|
+
* @summary Get warehouse by id
|
|
466
|
+
*/
|
|
467
|
+
declare const getWarehouseById: (id: string, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiResponseOfWarehouseResponse>>;
|
|
468
|
+
declare const getGetWarehouseByIdQueryKey: (id?: string) => readonly [`/api/warehouses/${string}`];
|
|
469
|
+
declare const getGetWarehouseByIdQueryOptions: <TData = Awaited<ReturnType<typeof getWarehouseById>>, TError = AxiosError<ApiResponseOfObject>>(id: string, options?: {
|
|
470
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getWarehouseById>>, TError, TData>>;
|
|
471
|
+
axios?: AxiosRequestConfig;
|
|
472
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof getWarehouseById>>, TError, TData> & {
|
|
473
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
474
|
+
};
|
|
475
|
+
type GetWarehouseByIdQueryResult = NonNullable<Awaited<ReturnType<typeof getWarehouseById>>>;
|
|
476
|
+
type GetWarehouseByIdQueryError = AxiosError<ApiResponseOfObject>;
|
|
477
|
+
declare function useGetWarehouseById<TData = Awaited<ReturnType<typeof getWarehouseById>>, TError = AxiosError<ApiResponseOfObject>>(id: string, options: {
|
|
478
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getWarehouseById>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getWarehouseById>>, TError, Awaited<ReturnType<typeof getWarehouseById>>>, 'initialData'>;
|
|
479
|
+
axios?: AxiosRequestConfig;
|
|
480
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
481
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
482
|
+
};
|
|
483
|
+
declare function useGetWarehouseById<TData = Awaited<ReturnType<typeof getWarehouseById>>, TError = AxiosError<ApiResponseOfObject>>(id: string, options?: {
|
|
484
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getWarehouseById>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getWarehouseById>>, TError, Awaited<ReturnType<typeof getWarehouseById>>>, 'initialData'>;
|
|
485
|
+
axios?: AxiosRequestConfig;
|
|
486
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
487
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
488
|
+
};
|
|
489
|
+
declare function useGetWarehouseById<TData = Awaited<ReturnType<typeof getWarehouseById>>, TError = AxiosError<ApiResponseOfObject>>(id: string, options?: {
|
|
490
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getWarehouseById>>, TError, TData>>;
|
|
491
|
+
axios?: AxiosRequestConfig;
|
|
492
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
493
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* Updates warehouse details such as name, address and person in charge.
|
|
497
|
+
* @summary Update a warehouse
|
|
498
|
+
*/
|
|
499
|
+
declare const updateWarehouse: (id: string, updateWarehouseCommand: UpdateWarehouseCommand, options?: AxiosRequestConfig) => Promise<AxiosResponse<void>>;
|
|
500
|
+
declare const getUpdateWarehouseMutationOptions: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
501
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof updateWarehouse>>, TError, {
|
|
502
|
+
id: string;
|
|
503
|
+
data: UpdateWarehouseCommand;
|
|
504
|
+
}, TContext>;
|
|
505
|
+
axios?: AxiosRequestConfig;
|
|
506
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof updateWarehouse>>, TError, {
|
|
507
|
+
id: string;
|
|
508
|
+
data: UpdateWarehouseCommand;
|
|
509
|
+
}, TContext>;
|
|
510
|
+
type UpdateWarehouseMutationResult = NonNullable<Awaited<ReturnType<typeof updateWarehouse>>>;
|
|
511
|
+
type UpdateWarehouseMutationBody = UpdateWarehouseCommand;
|
|
512
|
+
type UpdateWarehouseMutationError = AxiosError<ApiResponseOfObject>;
|
|
513
|
+
/**
|
|
514
|
+
* @summary Update a warehouse
|
|
515
|
+
*/
|
|
516
|
+
declare const useUpdateWarehouse: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
517
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof updateWarehouse>>, TError, {
|
|
518
|
+
id: string;
|
|
519
|
+
data: UpdateWarehouseCommand;
|
|
520
|
+
}, TContext>;
|
|
521
|
+
axios?: AxiosRequestConfig;
|
|
522
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof updateWarehouse>>, TError, {
|
|
523
|
+
id: string;
|
|
524
|
+
data: UpdateWarehouseCommand;
|
|
525
|
+
}, TContext>;
|
|
526
|
+
/**
|
|
527
|
+
* Deletes an inactive warehouse that has no associated stock.
|
|
528
|
+
* @summary Delete a warehouse
|
|
529
|
+
*/
|
|
530
|
+
declare const deleteWarehouse: (id: string, options?: AxiosRequestConfig) => Promise<AxiosResponse<void>>;
|
|
531
|
+
declare const getDeleteWarehouseMutationOptions: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
532
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteWarehouse>>, TError, {
|
|
533
|
+
id: string;
|
|
534
|
+
}, TContext>;
|
|
535
|
+
axios?: AxiosRequestConfig;
|
|
536
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof deleteWarehouse>>, TError, {
|
|
537
|
+
id: string;
|
|
538
|
+
}, TContext>;
|
|
539
|
+
type DeleteWarehouseMutationResult = NonNullable<Awaited<ReturnType<typeof deleteWarehouse>>>;
|
|
540
|
+
type DeleteWarehouseMutationError = AxiosError<ApiResponseOfObject>;
|
|
541
|
+
/**
|
|
542
|
+
* @summary Delete a warehouse
|
|
543
|
+
*/
|
|
544
|
+
declare const useDeleteWarehouse: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
545
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteWarehouse>>, TError, {
|
|
546
|
+
id: string;
|
|
547
|
+
}, TContext>;
|
|
548
|
+
axios?: AxiosRequestConfig;
|
|
549
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof deleteWarehouse>>, TError, {
|
|
550
|
+
id: string;
|
|
551
|
+
}, TContext>;
|
|
552
|
+
/**
|
|
553
|
+
* Activates or deactivates a warehouse.
|
|
554
|
+
* @summary Toggle warehouse status
|
|
555
|
+
*/
|
|
556
|
+
declare const toggleWarehouseStatus: (id: string, options?: AxiosRequestConfig) => Promise<AxiosResponse<void>>;
|
|
557
|
+
declare const getToggleWarehouseStatusMutationOptions: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
558
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof toggleWarehouseStatus>>, TError, {
|
|
559
|
+
id: string;
|
|
560
|
+
}, TContext>;
|
|
561
|
+
axios?: AxiosRequestConfig;
|
|
562
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof toggleWarehouseStatus>>, TError, {
|
|
563
|
+
id: string;
|
|
564
|
+
}, TContext>;
|
|
565
|
+
type ToggleWarehouseStatusMutationResult = NonNullable<Awaited<ReturnType<typeof toggleWarehouseStatus>>>;
|
|
566
|
+
type ToggleWarehouseStatusMutationError = AxiosError<ApiResponseOfObject>;
|
|
567
|
+
/**
|
|
568
|
+
* @summary Toggle warehouse status
|
|
569
|
+
*/
|
|
570
|
+
declare const useToggleWarehouseStatus: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
571
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof toggleWarehouseStatus>>, TError, {
|
|
572
|
+
id: string;
|
|
573
|
+
}, TContext>;
|
|
574
|
+
axios?: AxiosRequestConfig;
|
|
575
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof toggleWarehouseStatus>>, TError, {
|
|
576
|
+
id: string;
|
|
577
|
+
}, TContext>;
|
|
578
|
+
declare const searchAddresses: (params: SearchAddressesParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiResponseOfIReadOnlyListOfAddressSearchResultItemDto>>;
|
|
579
|
+
declare const getSearchAddressesQueryKey: (params?: SearchAddressesParams) => readonly ["/api/addresses/search", ...SearchAddressesParams[]];
|
|
580
|
+
declare const getSearchAddressesQueryOptions: <TData = Awaited<ReturnType<typeof searchAddresses>>, TError = AxiosError<unknown>>(params: SearchAddressesParams, options?: {
|
|
581
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAddresses>>, TError, TData>>;
|
|
582
|
+
axios?: AxiosRequestConfig;
|
|
583
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof searchAddresses>>, TError, TData> & {
|
|
584
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
585
|
+
};
|
|
586
|
+
type SearchAddressesQueryResult = NonNullable<Awaited<ReturnType<typeof searchAddresses>>>;
|
|
587
|
+
type SearchAddressesQueryError = AxiosError<unknown>;
|
|
588
|
+
declare function useSearchAddresses<TData = Awaited<ReturnType<typeof searchAddresses>>, TError = AxiosError<unknown>>(params: SearchAddressesParams, options: {
|
|
589
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAddresses>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof searchAddresses>>, TError, Awaited<ReturnType<typeof searchAddresses>>>, 'initialData'>;
|
|
590
|
+
axios?: AxiosRequestConfig;
|
|
591
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
592
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
593
|
+
};
|
|
594
|
+
declare function useSearchAddresses<TData = Awaited<ReturnType<typeof searchAddresses>>, TError = AxiosError<unknown>>(params: SearchAddressesParams, options?: {
|
|
595
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAddresses>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof searchAddresses>>, TError, Awaited<ReturnType<typeof searchAddresses>>>, 'initialData'>;
|
|
596
|
+
axios?: AxiosRequestConfig;
|
|
597
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
598
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
599
|
+
};
|
|
600
|
+
declare function useSearchAddresses<TData = Awaited<ReturnType<typeof searchAddresses>>, TError = AxiosError<unknown>>(params: SearchAddressesParams, options?: {
|
|
601
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAddresses>>, TError, TData>>;
|
|
602
|
+
axios?: AxiosRequestConfig;
|
|
603
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
604
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
605
|
+
};
|
|
606
|
+
/**
|
|
607
|
+
* Creates a new stock item with a unique SKU. Validation failures return 400.
|
|
608
|
+
* @summary Create a stock item
|
|
609
|
+
*/
|
|
610
|
+
declare const createStockItems: (createStockItemCommand: CreateStockItemCommand, options?: AxiosRequestConfig) => Promise<AxiosResponse<void>>;
|
|
611
|
+
declare const getCreateStockItemsMutationOptions: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
612
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createStockItems>>, TError, {
|
|
613
|
+
data: CreateStockItemCommand;
|
|
614
|
+
}, TContext>;
|
|
615
|
+
axios?: AxiosRequestConfig;
|
|
616
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof createStockItems>>, TError, {
|
|
617
|
+
data: CreateStockItemCommand;
|
|
618
|
+
}, TContext>;
|
|
619
|
+
type CreateStockItemsMutationResult = NonNullable<Awaited<ReturnType<typeof createStockItems>>>;
|
|
620
|
+
type CreateStockItemsMutationBody = CreateStockItemCommand;
|
|
621
|
+
type CreateStockItemsMutationError = AxiosError<ApiResponseOfObject>;
|
|
622
|
+
/**
|
|
623
|
+
* @summary Create a stock item
|
|
624
|
+
*/
|
|
625
|
+
declare const useCreateStockItems: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
626
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createStockItems>>, TError, {
|
|
627
|
+
data: CreateStockItemCommand;
|
|
628
|
+
}, TContext>;
|
|
629
|
+
axios?: AxiosRequestConfig;
|
|
630
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createStockItems>>, TError, {
|
|
631
|
+
data: CreateStockItemCommand;
|
|
632
|
+
}, TContext>;
|
|
633
|
+
/**
|
|
634
|
+
* Returns a paginated list of stock items, optionally filtered by search text, active status or warehouse, with current stock quantities.
|
|
635
|
+
* @summary List stock items
|
|
636
|
+
*/
|
|
637
|
+
declare const listStockItems: (params?: ListStockItemsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiResponseOfPagedListOfStockItemResponse>>;
|
|
638
|
+
declare const getListStockItemsQueryKey: (params?: ListStockItemsParams) => readonly ["/api/stock-items", ...ListStockItemsParams[]];
|
|
639
|
+
declare const getListStockItemsQueryOptions: <TData = Awaited<ReturnType<typeof listStockItems>>, TError = AxiosError<unknown>>(params?: ListStockItemsParams, options?: {
|
|
640
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listStockItems>>, TError, TData>>;
|
|
641
|
+
axios?: AxiosRequestConfig;
|
|
642
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof listStockItems>>, TError, TData> & {
|
|
643
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
644
|
+
};
|
|
645
|
+
type ListStockItemsQueryResult = NonNullable<Awaited<ReturnType<typeof listStockItems>>>;
|
|
646
|
+
type ListStockItemsQueryError = AxiosError<unknown>;
|
|
647
|
+
declare function useListStockItems<TData = Awaited<ReturnType<typeof listStockItems>>, TError = AxiosError<unknown>>(params: undefined | ListStockItemsParams, options: {
|
|
648
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listStockItems>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listStockItems>>, TError, Awaited<ReturnType<typeof listStockItems>>>, 'initialData'>;
|
|
649
|
+
axios?: AxiosRequestConfig;
|
|
650
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
651
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
652
|
+
};
|
|
653
|
+
declare function useListStockItems<TData = Awaited<ReturnType<typeof listStockItems>>, TError = AxiosError<unknown>>(params?: ListStockItemsParams, options?: {
|
|
654
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listStockItems>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listStockItems>>, TError, Awaited<ReturnType<typeof listStockItems>>>, 'initialData'>;
|
|
655
|
+
axios?: AxiosRequestConfig;
|
|
656
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
657
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
658
|
+
};
|
|
659
|
+
declare function useListStockItems<TData = Awaited<ReturnType<typeof listStockItems>>, TError = AxiosError<unknown>>(params?: ListStockItemsParams, options?: {
|
|
660
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listStockItems>>, TError, TData>>;
|
|
661
|
+
axios?: AxiosRequestConfig;
|
|
662
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
663
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* Creates a stock batch for an item in a warehouse, increasing on-hand quantity. Validation failures return 400.
|
|
667
|
+
* @summary Create a batch
|
|
668
|
+
*/
|
|
669
|
+
declare const createBatch: (createBatchRequest: CreateBatchRequest, options?: AxiosRequestConfig) => Promise<AxiosResponse<void>>;
|
|
670
|
+
declare const getCreateBatchMutationOptions: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
671
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createBatch>>, TError, {
|
|
672
|
+
data: CreateBatchRequest;
|
|
673
|
+
}, TContext>;
|
|
674
|
+
axios?: AxiosRequestConfig;
|
|
675
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof createBatch>>, TError, {
|
|
676
|
+
data: CreateBatchRequest;
|
|
677
|
+
}, TContext>;
|
|
678
|
+
type CreateBatchMutationResult = NonNullable<Awaited<ReturnType<typeof createBatch>>>;
|
|
679
|
+
type CreateBatchMutationBody = CreateBatchRequest;
|
|
680
|
+
type CreateBatchMutationError = AxiosError<ApiResponseOfObject>;
|
|
681
|
+
/**
|
|
682
|
+
* @summary Create a batch
|
|
683
|
+
*/
|
|
684
|
+
declare const useCreateBatch: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
685
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof createBatch>>, TError, {
|
|
686
|
+
data: CreateBatchRequest;
|
|
687
|
+
}, TContext>;
|
|
688
|
+
axios?: AxiosRequestConfig;
|
|
689
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createBatch>>, TError, {
|
|
690
|
+
data: CreateBatchRequest;
|
|
691
|
+
}, TContext>;
|
|
692
|
+
/**
|
|
693
|
+
* Consumes quantity from a batch and records a stock movement. Returns 400 for invalid input, 404 when the batch is missing and 409 when stock is insufficient.
|
|
694
|
+
* @summary Consume a batch
|
|
695
|
+
*/
|
|
696
|
+
declare const consumeBatch: (id: string, consumeBatchRequest: ConsumeBatchRequest, options?: AxiosRequestConfig) => Promise<AxiosResponse<void>>;
|
|
697
|
+
declare const getConsumeBatchMutationOptions: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
698
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof consumeBatch>>, TError, {
|
|
699
|
+
id: string;
|
|
700
|
+
data: ConsumeBatchRequest;
|
|
701
|
+
}, TContext>;
|
|
702
|
+
axios?: AxiosRequestConfig;
|
|
703
|
+
}) => UseMutationOptions<Awaited<ReturnType<typeof consumeBatch>>, TError, {
|
|
704
|
+
id: string;
|
|
705
|
+
data: ConsumeBatchRequest;
|
|
706
|
+
}, TContext>;
|
|
707
|
+
type ConsumeBatchMutationResult = NonNullable<Awaited<ReturnType<typeof consumeBatch>>>;
|
|
708
|
+
type ConsumeBatchMutationBody = ConsumeBatchRequest;
|
|
709
|
+
type ConsumeBatchMutationError = AxiosError<ApiResponseOfObject>;
|
|
710
|
+
/**
|
|
711
|
+
* @summary Consume a batch
|
|
712
|
+
*/
|
|
713
|
+
declare const useConsumeBatch: <TError = AxiosError<ApiResponseOfObject>, TContext = unknown>(options?: {
|
|
714
|
+
mutation?: UseMutationOptions<Awaited<ReturnType<typeof consumeBatch>>, TError, {
|
|
715
|
+
id: string;
|
|
716
|
+
data: ConsumeBatchRequest;
|
|
717
|
+
}, TContext>;
|
|
718
|
+
axios?: AxiosRequestConfig;
|
|
719
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof consumeBatch>>, TError, {
|
|
720
|
+
id: string;
|
|
721
|
+
data: ConsumeBatchRequest;
|
|
722
|
+
}, TContext>;
|
|
723
|
+
/**
|
|
724
|
+
* Returns a paginated ledger of stock movements, optionally filtered by item, batch or warehouse.
|
|
725
|
+
* @summary List stock movements
|
|
726
|
+
*/
|
|
727
|
+
declare const listStockMovements: (params?: ListStockMovementsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiResponseOfPagedListOfStockMovementResponse>>;
|
|
728
|
+
declare const getListStockMovementsQueryKey: (params?: ListStockMovementsParams) => readonly ["/api/stock-movements", ...ListStockMovementsParams[]];
|
|
729
|
+
declare const getListStockMovementsQueryOptions: <TData = Awaited<ReturnType<typeof listStockMovements>>, TError = AxiosError<unknown>>(params?: ListStockMovementsParams, options?: {
|
|
730
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listStockMovements>>, TError, TData>>;
|
|
731
|
+
axios?: AxiosRequestConfig;
|
|
732
|
+
}) => UseQueryOptions<Awaited<ReturnType<typeof listStockMovements>>, TError, TData> & {
|
|
733
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
734
|
+
};
|
|
735
|
+
type ListStockMovementsQueryResult = NonNullable<Awaited<ReturnType<typeof listStockMovements>>>;
|
|
736
|
+
type ListStockMovementsQueryError = AxiosError<unknown>;
|
|
737
|
+
declare function useListStockMovements<TData = Awaited<ReturnType<typeof listStockMovements>>, TError = AxiosError<unknown>>(params: undefined | ListStockMovementsParams, options: {
|
|
738
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listStockMovements>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listStockMovements>>, TError, Awaited<ReturnType<typeof listStockMovements>>>, 'initialData'>;
|
|
739
|
+
axios?: AxiosRequestConfig;
|
|
740
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
741
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
742
|
+
};
|
|
743
|
+
declare function useListStockMovements<TData = Awaited<ReturnType<typeof listStockMovements>>, TError = AxiosError<unknown>>(params?: ListStockMovementsParams, options?: {
|
|
744
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listStockMovements>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listStockMovements>>, TError, Awaited<ReturnType<typeof listStockMovements>>>, 'initialData'>;
|
|
745
|
+
axios?: AxiosRequestConfig;
|
|
746
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
747
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
748
|
+
};
|
|
749
|
+
declare function useListStockMovements<TData = Awaited<ReturnType<typeof listStockMovements>>, TError = AxiosError<unknown>>(params?: ListStockMovementsParams, options?: {
|
|
750
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listStockMovements>>, TError, TData>>;
|
|
751
|
+
axios?: AxiosRequestConfig;
|
|
752
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
753
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Generated by orval v7.21.0 🍺
|
|
758
|
+
* Do not edit manually.
|
|
759
|
+
* ArasERP API
|
|
760
|
+
* REST API for ArasERP inventory, warehouse and stock management.
|
|
761
|
+
* OpenAPI spec version: 1.0
|
|
762
|
+
*/
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Returns the id and name of every warehouse for use in dropdowns and selectors.
|
|
766
|
+
* @summary List warehouse options
|
|
767
|
+
*/
|
|
768
|
+
declare const getWarehouseOptionsResponse: zod.ZodObject<{
|
|
769
|
+
code: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
770
|
+
data: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
|
|
771
|
+
warehouseId: zod.ZodUUID;
|
|
772
|
+
name: zod.ZodString;
|
|
773
|
+
}, zod.z.core.$strict>>>>;
|
|
774
|
+
success: zod.ZodOptional<zod.ZodBoolean>;
|
|
775
|
+
statusCode: zod.ZodOptional<zod.ZodNumber>;
|
|
776
|
+
message: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
777
|
+
errors: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString>>>;
|
|
778
|
+
requestId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
779
|
+
timestamp: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
780
|
+
}, zod.z.core.$strict>;
|
|
781
|
+
/**
|
|
782
|
+
* Returns a paginated list of warehouses with their active status and address details.
|
|
783
|
+
* @summary List warehouses
|
|
784
|
+
*/
|
|
785
|
+
declare const listWarehousesQueryPageDefault = 1;
|
|
786
|
+
declare const listWarehousesQueryPageSizeDefault = 10;
|
|
787
|
+
declare const listWarehousesQueryParams: zod.ZodObject<{
|
|
788
|
+
page: zod.ZodDefault<zod.z.ZodCoercedNumber<unknown>>;
|
|
789
|
+
pageSize: zod.ZodDefault<zod.z.ZodCoercedNumber<unknown>>;
|
|
790
|
+
}, zod.z.core.$strict>;
|
|
791
|
+
declare const listWarehousesResponse: zod.ZodObject<{
|
|
792
|
+
code: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
793
|
+
data: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodNull, zod.ZodObject<{
|
|
794
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
795
|
+
warehouseId: zod.ZodUUID;
|
|
796
|
+
name: zod.ZodString;
|
|
797
|
+
isActive: zod.ZodBoolean;
|
|
798
|
+
personInCharge: zod.ZodObject<{
|
|
799
|
+
name: zod.ZodString;
|
|
800
|
+
phone: zod.ZodNullable<zod.ZodString>;
|
|
801
|
+
}, zod.z.core.$strict>;
|
|
802
|
+
address: zod.ZodObject<{
|
|
803
|
+
addressId: zod.ZodUUID;
|
|
804
|
+
subDistrictName: zod.ZodString;
|
|
805
|
+
districtName: zod.ZodString;
|
|
806
|
+
cityName: zod.ZodString;
|
|
807
|
+
provinceName: zod.ZodString;
|
|
808
|
+
zipCode: zod.ZodString;
|
|
809
|
+
}, zod.z.core.$strict>;
|
|
810
|
+
fullAddressText: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
811
|
+
}, zod.z.core.$strict>>;
|
|
812
|
+
page: zod.ZodNumber;
|
|
813
|
+
pageSize: zod.ZodNumber;
|
|
814
|
+
totalCount: zod.ZodNumber;
|
|
815
|
+
totalPages: zod.ZodOptional<zod.ZodNumber>;
|
|
816
|
+
hasNextPage: zod.ZodOptional<zod.ZodBoolean>;
|
|
817
|
+
hasPreviousPage: zod.ZodOptional<zod.ZodBoolean>;
|
|
818
|
+
}, zod.z.core.$strict>]>>;
|
|
819
|
+
success: zod.ZodOptional<zod.ZodBoolean>;
|
|
820
|
+
statusCode: zod.ZodOptional<zod.ZodNumber>;
|
|
821
|
+
message: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
822
|
+
errors: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString>>>;
|
|
823
|
+
requestId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
824
|
+
timestamp: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
825
|
+
}, zod.z.core.$strict>;
|
|
826
|
+
/**
|
|
827
|
+
* Creates a new warehouse that must reference an existing address. Validation failures return 400.
|
|
828
|
+
* @summary Create a warehouse
|
|
829
|
+
*/
|
|
830
|
+
declare const createWarehouseBody: zod.ZodObject<{
|
|
831
|
+
name: zod.ZodString;
|
|
832
|
+
addressId: zod.ZodUUID;
|
|
833
|
+
personInCharge: zod.ZodObject<{
|
|
834
|
+
name: zod.ZodString;
|
|
835
|
+
phone: zod.ZodNullable<zod.ZodString>;
|
|
836
|
+
}, zod.z.core.$strict>;
|
|
837
|
+
fullAddressText: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
838
|
+
}, zod.z.core.$strict>;
|
|
839
|
+
/**
|
|
840
|
+
* Returns the warehouse with the given identifier, or 404 when it does not exist.
|
|
841
|
+
* @summary Get warehouse by id
|
|
842
|
+
*/
|
|
843
|
+
declare const getWarehouseByIdParams: zod.ZodObject<{
|
|
844
|
+
id: zod.ZodUUID;
|
|
845
|
+
}, zod.z.core.$strict>;
|
|
846
|
+
declare const getWarehouseByIdResponse: zod.ZodObject<{
|
|
847
|
+
code: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
848
|
+
data: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodNull, zod.ZodObject<{
|
|
849
|
+
warehouseId: zod.ZodUUID;
|
|
850
|
+
name: zod.ZodString;
|
|
851
|
+
isActive: zod.ZodBoolean;
|
|
852
|
+
personInCharge: zod.ZodObject<{
|
|
853
|
+
name: zod.ZodString;
|
|
854
|
+
phone: zod.ZodNullable<zod.ZodString>;
|
|
855
|
+
}, zod.z.core.$strict>;
|
|
856
|
+
address: zod.ZodObject<{
|
|
857
|
+
addressId: zod.ZodUUID;
|
|
858
|
+
subDistrictName: zod.ZodString;
|
|
859
|
+
districtName: zod.ZodString;
|
|
860
|
+
cityName: zod.ZodString;
|
|
861
|
+
provinceName: zod.ZodString;
|
|
862
|
+
zipCode: zod.ZodString;
|
|
863
|
+
}, zod.z.core.$strict>;
|
|
864
|
+
fullAddressText: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
865
|
+
}, zod.z.core.$strict>]>>;
|
|
866
|
+
success: zod.ZodOptional<zod.ZodBoolean>;
|
|
867
|
+
statusCode: zod.ZodOptional<zod.ZodNumber>;
|
|
868
|
+
message: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
869
|
+
errors: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString>>>;
|
|
870
|
+
requestId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
871
|
+
timestamp: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
872
|
+
}, zod.z.core.$strict>;
|
|
873
|
+
/**
|
|
874
|
+
* Updates warehouse details such as name, address and person in charge.
|
|
875
|
+
* @summary Update a warehouse
|
|
876
|
+
*/
|
|
877
|
+
declare const updateWarehouseParams: zod.ZodObject<{
|
|
878
|
+
id: zod.ZodUUID;
|
|
879
|
+
}, zod.z.core.$strict>;
|
|
880
|
+
declare const updateWarehouseBody: zod.ZodObject<{
|
|
881
|
+
warehouseId: zod.ZodOptional<zod.ZodString>;
|
|
882
|
+
name: zod.ZodString;
|
|
883
|
+
addressId: zod.ZodUUID;
|
|
884
|
+
personInCharge: zod.ZodObject<{
|
|
885
|
+
name: zod.ZodString;
|
|
886
|
+
phone: zod.ZodNullable<zod.ZodString>;
|
|
887
|
+
}, zod.z.core.$strict>;
|
|
888
|
+
fullAddressText: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
889
|
+
}, zod.z.core.$strict>;
|
|
890
|
+
/**
|
|
891
|
+
* Deletes an inactive warehouse that has no associated stock.
|
|
892
|
+
* @summary Delete a warehouse
|
|
893
|
+
*/
|
|
894
|
+
declare const deleteWarehouseParams: zod.ZodObject<{
|
|
895
|
+
id: zod.ZodUUID;
|
|
896
|
+
}, zod.z.core.$strict>;
|
|
897
|
+
/**
|
|
898
|
+
* Activates or deactivates a warehouse.
|
|
899
|
+
* @summary Toggle warehouse status
|
|
900
|
+
*/
|
|
901
|
+
declare const toggleWarehouseStatusParams: zod.ZodObject<{
|
|
902
|
+
id: zod.ZodUUID;
|
|
903
|
+
}, zod.z.core.$strict>;
|
|
904
|
+
declare const searchAddressesQueryLimitDefault = 100;
|
|
905
|
+
declare const searchAddressesQueryParams: zod.ZodObject<{
|
|
906
|
+
keyword: zod.z.ZodCoercedString<unknown>;
|
|
907
|
+
limit: zod.ZodDefault<zod.z.ZodCoercedNumber<unknown>>;
|
|
908
|
+
}, zod.z.core.$strict>;
|
|
909
|
+
declare const searchAddressesResponse: zod.ZodObject<{
|
|
910
|
+
code: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
911
|
+
data: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
|
|
912
|
+
addressId: zod.ZodOptional<zod.ZodUUID>;
|
|
913
|
+
externalId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
914
|
+
destinationCode: zod.ZodOptional<zod.ZodString>;
|
|
915
|
+
originCode: zod.ZodOptional<zod.ZodString>;
|
|
916
|
+
provinceName: zod.ZodOptional<zod.ZodString>;
|
|
917
|
+
cityName: zod.ZodOptional<zod.ZodString>;
|
|
918
|
+
districtName: zod.ZodOptional<zod.ZodString>;
|
|
919
|
+
subDistrictName: zod.ZodOptional<zod.ZodString>;
|
|
920
|
+
zipCode: zod.ZodOptional<zod.ZodString>;
|
|
921
|
+
}, zod.z.core.$strict>>>>;
|
|
922
|
+
success: zod.ZodOptional<zod.ZodBoolean>;
|
|
923
|
+
statusCode: zod.ZodOptional<zod.ZodNumber>;
|
|
924
|
+
message: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
925
|
+
errors: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString>>>;
|
|
926
|
+
requestId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
927
|
+
timestamp: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
928
|
+
}, zod.z.core.$strict>;
|
|
929
|
+
/**
|
|
930
|
+
* Creates a new stock item with a unique SKU. Validation failures return 400.
|
|
931
|
+
* @summary Create a stock item
|
|
932
|
+
*/
|
|
933
|
+
declare const createStockItemsBody: zod.ZodObject<{
|
|
934
|
+
name: zod.ZodString;
|
|
935
|
+
sku: zod.ZodString;
|
|
936
|
+
unit: zod.ZodString;
|
|
937
|
+
}, zod.z.core.$strict>;
|
|
938
|
+
/**
|
|
939
|
+
* Returns a paginated list of stock items, optionally filtered by search text, active status or warehouse, with current stock quantities.
|
|
940
|
+
* @summary List stock items
|
|
941
|
+
*/
|
|
942
|
+
declare const listStockItemsQueryPageDefault = 1;
|
|
943
|
+
declare const listStockItemsQueryPageSizeDefault = 10;
|
|
944
|
+
declare const listStockItemsQueryDescendingDefault = false;
|
|
945
|
+
declare const listStockItemsQueryParams: zod.ZodObject<{
|
|
946
|
+
search: zod.ZodOptional<zod.z.ZodCoercedString<unknown>>;
|
|
947
|
+
isActive: zod.ZodOptional<zod.z.ZodCoercedBoolean<unknown>>;
|
|
948
|
+
page: zod.ZodDefault<zod.z.ZodCoercedNumber<unknown>>;
|
|
949
|
+
pageSize: zod.ZodDefault<zod.z.ZodCoercedNumber<unknown>>;
|
|
950
|
+
orderBy: zod.ZodOptional<zod.z.ZodCoercedString<unknown>>;
|
|
951
|
+
descending: zod.ZodOptional<zod.z.ZodCoercedBoolean<unknown>>;
|
|
952
|
+
warehouseId: zod.ZodOptional<zod.ZodUUID>;
|
|
953
|
+
}, zod.z.core.$strict>;
|
|
954
|
+
declare const listStockItemsResponse: zod.ZodObject<{
|
|
955
|
+
code: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
956
|
+
data: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodNull, zod.ZodObject<{
|
|
957
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
958
|
+
id: zod.ZodOptional<zod.ZodUUID>;
|
|
959
|
+
sku: zod.ZodOptional<zod.ZodString>;
|
|
960
|
+
name: zod.ZodOptional<zod.ZodString>;
|
|
961
|
+
unit: zod.ZodOptional<zod.ZodString>;
|
|
962
|
+
isActive: zod.ZodOptional<zod.ZodBoolean>;
|
|
963
|
+
warehouseId: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
|
|
964
|
+
warehouseName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
965
|
+
onHandQty: zod.ZodOptional<zod.ZodNumber>;
|
|
966
|
+
reservedQty: zod.ZodOptional<zod.ZodNumber>;
|
|
967
|
+
availableQty: zod.ZodOptional<zod.ZodNumber>;
|
|
968
|
+
}, zod.z.core.$strict>>;
|
|
969
|
+
page: zod.ZodNumber;
|
|
970
|
+
pageSize: zod.ZodNumber;
|
|
971
|
+
totalCount: zod.ZodNumber;
|
|
972
|
+
totalPages: zod.ZodOptional<zod.ZodNumber>;
|
|
973
|
+
hasNextPage: zod.ZodOptional<zod.ZodBoolean>;
|
|
974
|
+
hasPreviousPage: zod.ZodOptional<zod.ZodBoolean>;
|
|
975
|
+
}, zod.z.core.$strict>]>>;
|
|
976
|
+
success: zod.ZodOptional<zod.ZodBoolean>;
|
|
977
|
+
statusCode: zod.ZodOptional<zod.ZodNumber>;
|
|
978
|
+
message: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
979
|
+
errors: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString>>>;
|
|
980
|
+
requestId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
981
|
+
timestamp: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
982
|
+
}, zod.z.core.$strict>;
|
|
983
|
+
/**
|
|
984
|
+
* Creates a stock batch for an item in a warehouse, increasing on-hand quantity. Validation failures return 400.
|
|
985
|
+
* @summary Create a batch
|
|
986
|
+
*/
|
|
987
|
+
declare const createBatchBody: zod.ZodObject<{
|
|
988
|
+
itemId: zod.ZodUUID;
|
|
989
|
+
warehouseId: zod.ZodUUID;
|
|
990
|
+
receivedQty: zod.ZodNumber;
|
|
991
|
+
unitCost: zod.ZodNumber;
|
|
992
|
+
receivedAt: zod.z.ZodISODateTime;
|
|
993
|
+
expiresOn: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODate>>;
|
|
994
|
+
sourceType: zod.ZodEnum<{
|
|
995
|
+
PURCHASE: "PURCHASE";
|
|
996
|
+
CUSTOMER_RETURN: "CUSTOMER_RETURN";
|
|
997
|
+
LOAN_RETURN: "LOAN_RETURN";
|
|
998
|
+
}>;
|
|
999
|
+
externalReferenceNo: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1000
|
+
note: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1001
|
+
receivedBy: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1002
|
+
}, zod.z.core.$strict>;
|
|
1003
|
+
/**
|
|
1004
|
+
* Consumes quantity from a batch and records a stock movement. Returns 400 for invalid input, 404 when the batch is missing and 409 when stock is insufficient.
|
|
1005
|
+
* @summary Consume a batch
|
|
1006
|
+
*/
|
|
1007
|
+
declare const consumeBatchParams: zod.ZodObject<{
|
|
1008
|
+
id: zod.ZodUUID;
|
|
1009
|
+
}, zod.z.core.$strict>;
|
|
1010
|
+
declare const consumeBatchBody: zod.ZodObject<{
|
|
1011
|
+
quantity: zod.ZodNumber;
|
|
1012
|
+
sourceType: zod.ZodEnum<{
|
|
1013
|
+
LOAN_OUT: "LOAN_OUT";
|
|
1014
|
+
TRANSFER_OUT: "TRANSFER_OUT";
|
|
1015
|
+
ADJUSTMENT: "ADJUSTMENT";
|
|
1016
|
+
SAMPLE: "SAMPLE";
|
|
1017
|
+
DAMAGED: "DAMAGED";
|
|
1018
|
+
INTERNAL_USE: "INTERNAL_USE";
|
|
1019
|
+
}>;
|
|
1020
|
+
externalReferenceNo: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1021
|
+
note: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1022
|
+
}, zod.z.core.$strict>;
|
|
1023
|
+
/**
|
|
1024
|
+
* Returns a paginated ledger of stock movements, optionally filtered by item, batch or warehouse.
|
|
1025
|
+
* @summary List stock movements
|
|
1026
|
+
*/
|
|
1027
|
+
declare const listStockMovementsQueryPageDefault = 1;
|
|
1028
|
+
declare const listStockMovementsQueryPageSizeDefault = 10;
|
|
1029
|
+
declare const listStockMovementsQueryDescendingDefault = false;
|
|
1030
|
+
declare const listStockMovementsQueryParams: zod.ZodObject<{
|
|
1031
|
+
itemId: zod.ZodOptional<zod.ZodUUID>;
|
|
1032
|
+
batchId: zod.ZodOptional<zod.ZodUUID>;
|
|
1033
|
+
warehouseId: zod.ZodOptional<zod.ZodUUID>;
|
|
1034
|
+
page: zod.ZodDefault<zod.z.ZodCoercedNumber<unknown>>;
|
|
1035
|
+
pageSize: zod.ZodDefault<zod.z.ZodCoercedNumber<unknown>>;
|
|
1036
|
+
orderBy: zod.ZodOptional<zod.z.ZodCoercedString<unknown>>;
|
|
1037
|
+
descending: zod.ZodOptional<zod.z.ZodCoercedBoolean<unknown>>;
|
|
1038
|
+
}, zod.z.core.$strict>;
|
|
1039
|
+
declare const listStockMovementsResponse: zod.ZodObject<{
|
|
1040
|
+
code: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1041
|
+
data: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodNull, zod.ZodObject<{
|
|
1042
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
1043
|
+
id: zod.ZodOptional<zod.ZodUUID>;
|
|
1044
|
+
itemId: zod.ZodOptional<zod.ZodUUID>;
|
|
1045
|
+
itemName: zod.ZodOptional<zod.ZodString>;
|
|
1046
|
+
warehouseId: zod.ZodOptional<zod.ZodUUID>;
|
|
1047
|
+
warehouseName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1048
|
+
batchId: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
|
|
1049
|
+
direction: zod.ZodOptional<zod.ZodString>;
|
|
1050
|
+
quantity: zod.ZodOptional<zod.ZodNumber>;
|
|
1051
|
+
sourceType: zod.ZodOptional<zod.ZodString>;
|
|
1052
|
+
sourceReferenceId: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
|
|
1053
|
+
externalReferenceNo: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1054
|
+
note: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1055
|
+
createdAt: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
1056
|
+
recordedBy: zod.ZodOptional<zod.ZodUUID>;
|
|
1057
|
+
receivedBy: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1058
|
+
}, zod.z.core.$strict>>;
|
|
1059
|
+
page: zod.ZodNumber;
|
|
1060
|
+
pageSize: zod.ZodNumber;
|
|
1061
|
+
totalCount: zod.ZodNumber;
|
|
1062
|
+
totalPages: zod.ZodOptional<zod.ZodNumber>;
|
|
1063
|
+
hasNextPage: zod.ZodOptional<zod.ZodBoolean>;
|
|
1064
|
+
hasPreviousPage: zod.ZodOptional<zod.ZodBoolean>;
|
|
1065
|
+
}, zod.z.core.$strict>]>>;
|
|
1066
|
+
success: zod.ZodOptional<zod.ZodBoolean>;
|
|
1067
|
+
statusCode: zod.ZodOptional<zod.ZodNumber>;
|
|
1068
|
+
message: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1069
|
+
errors: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString>>>;
|
|
1070
|
+
requestId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1071
|
+
timestamp: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
1072
|
+
}, zod.z.core.$strict>;
|
|
1073
|
+
|
|
1074
|
+
export { type AddressData, type AddressSearchResultItemDto, type AddressSearchResultItemDtoExternalId, type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDto, type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoCode, type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoData, type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoErrors, type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoMessage, type ApiResponseOfIReadOnlyListOfAddressSearchResultItemDtoRequestId, type ApiResponseOfListOfWarehouseOptionResponse, type ApiResponseOfListOfWarehouseOptionResponseCode, type ApiResponseOfListOfWarehouseOptionResponseData, type ApiResponseOfListOfWarehouseOptionResponseErrors, type ApiResponseOfListOfWarehouseOptionResponseMessage, type ApiResponseOfListOfWarehouseOptionResponseRequestId, type ApiResponseOfObject, type ApiResponseOfObjectCode, type ApiResponseOfObjectErrors, type ApiResponseOfObjectMessage, type ApiResponseOfObjectRequestId, type ApiResponseOfPagedListOfStockItemResponse, type ApiResponseOfPagedListOfStockItemResponseCode, type ApiResponseOfPagedListOfStockItemResponseData, type ApiResponseOfPagedListOfStockItemResponseErrors, type ApiResponseOfPagedListOfStockItemResponseMessage, type ApiResponseOfPagedListOfStockItemResponseRequestId, type ApiResponseOfPagedListOfStockMovementResponse, type ApiResponseOfPagedListOfStockMovementResponseCode, type ApiResponseOfPagedListOfStockMovementResponseData, type ApiResponseOfPagedListOfStockMovementResponseErrors, type ApiResponseOfPagedListOfStockMovementResponseMessage, type ApiResponseOfPagedListOfStockMovementResponseRequestId, type ApiResponseOfPagedListOfWarehouseResponse, type ApiResponseOfPagedListOfWarehouseResponseCode, type ApiResponseOfPagedListOfWarehouseResponseData, type ApiResponseOfPagedListOfWarehouseResponseErrors, type ApiResponseOfPagedListOfWarehouseResponseMessage, type ApiResponseOfPagedListOfWarehouseResponseRequestId, type ApiResponseOfWarehouseResponse, type ApiResponseOfWarehouseResponseCode, type ApiResponseOfWarehouseResponseData, type ApiResponseOfWarehouseResponseErrors, type ApiResponseOfWarehouseResponseMessage, type ApiResponseOfWarehouseResponseRequestId, type ConsumeBatchMutationBody, type ConsumeBatchMutationError, type ConsumeBatchMutationResult, type ConsumeBatchRequest, type ConsumeBatchRequestExternalReferenceNo, type ConsumeBatchRequestNote, ConsumeBatchSourceType, type CreateBatchMutationBody, type CreateBatchMutationError, type CreateBatchMutationResult, type CreateBatchRequest, type CreateBatchRequestExpiresOn, type CreateBatchRequestExternalReferenceNo, type CreateBatchRequestNote, type CreateBatchRequestReceivedBy, type CreateStockItemCommand, type CreateStockItemsMutationBody, type CreateStockItemsMutationError, type CreateStockItemsMutationResult, type CreateWarehouseCommand, type CreateWarehouseCommandFullAddressText, type CreateWarehouseMutationBody, type CreateWarehouseMutationError, type CreateWarehouseMutationResult, type DeleteWarehouseMutationError, type DeleteWarehouseMutationResult, type GetHealthQueryError, type GetHealthQueryResult, type GetWarehouseByIdQueryError, type GetWarehouseByIdQueryResult, type GetWarehouseOptionsQueryError, type GetWarehouseOptionsQueryResult, type ListStockItemsParams, type ListStockItemsQueryError, type ListStockItemsQueryResult, type ListStockMovementsParams, type ListStockMovementsQueryError, type ListStockMovementsQueryResult, type ListWarehousesParams, type ListWarehousesQueryError, type ListWarehousesQueryResult, type PagedListOfStockItemResponse, type PagedListOfStockMovementResponse, type PagedListOfWarehouseResponse, type PersonInChargeData, type PersonInChargeDataPhone, type SearchAddressesParams, type SearchAddressesQueryError, type SearchAddressesQueryResult, SourceTypeEnum, type StockItemResponse, type StockItemResponseWarehouseId, type StockItemResponseWarehouseName, type StockMovementResponse, type StockMovementResponseBatchId, type StockMovementResponseExternalReferenceNo, type StockMovementResponseNote, type StockMovementResponseReceivedBy, type StockMovementResponseSourceReferenceId, type StockMovementResponseWarehouseName, type ToggleWarehouseStatusMutationError, type ToggleWarehouseStatusMutationResult, type UpdateWarehouseCommand, type UpdateWarehouseCommandFullAddressText, type UpdateWarehouseMutationBody, type UpdateWarehouseMutationError, type UpdateWarehouseMutationResult, type WarehouseOptionResponse, type WarehouseResponse, type WarehouseResponseFullAddressText, consumeBatch, consumeBatchBody, consumeBatchParams, createBatch, createBatchBody, createStockItems, createStockItemsBody, createWarehouse, createWarehouseBody, deleteWarehouse, deleteWarehouseParams, getConsumeBatchMutationOptions, getCreateBatchMutationOptions, getCreateStockItemsMutationOptions, getCreateWarehouseMutationOptions, getDeleteWarehouseMutationOptions, getGetHealthQueryKey, getGetHealthQueryOptions, getGetWarehouseByIdQueryKey, getGetWarehouseByIdQueryOptions, getGetWarehouseOptionsQueryKey, getGetWarehouseOptionsQueryOptions, getHealth, getListStockItemsQueryKey, getListStockItemsQueryOptions, getListStockMovementsQueryKey, getListStockMovementsQueryOptions, getListWarehousesQueryKey, getListWarehousesQueryOptions, getSearchAddressesQueryKey, getSearchAddressesQueryOptions, getToggleWarehouseStatusMutationOptions, getUpdateWarehouseMutationOptions, getWarehouseById, getWarehouseByIdParams, getWarehouseByIdResponse, getWarehouseOptions, getWarehouseOptionsResponse, listStockItems, listStockItemsQueryDescendingDefault, listStockItemsQueryPageDefault, listStockItemsQueryPageSizeDefault, listStockItemsQueryParams, listStockItemsResponse, listStockMovements, listStockMovementsQueryDescendingDefault, listStockMovementsQueryPageDefault, listStockMovementsQueryPageSizeDefault, listStockMovementsQueryParams, listStockMovementsResponse, listWarehouses, listWarehousesQueryPageDefault, listWarehousesQueryPageSizeDefault, listWarehousesQueryParams, listWarehousesResponse, searchAddresses, searchAddressesQueryLimitDefault, searchAddressesQueryParams, searchAddressesResponse, toggleWarehouseStatus, toggleWarehouseStatusParams, updateWarehouse, updateWarehouseBody, updateWarehouseParams, useConsumeBatch, useCreateBatch, useCreateStockItems, useCreateWarehouse, useDeleteWarehouse, useGetHealth, useGetWarehouseById, useGetWarehouseOptions, useListStockItems, useListStockMovements, useListWarehouses, useSearchAddresses, useToggleWarehouseStatus, useUpdateWarehouse };
|