@omniumretail/shared-resources 0.2.23 → 0.2.25
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/bundle.js +1 -1
- package/dist/types/hooks/Asta/Actions/get/getActionStagesQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Asts/get/getProductInfoQuery.hook.d.ts +8 -0
- package/dist/types/hooks/Asts/get/getStockQuery.hook.d.ts +4 -12
- package/dist/types/hooks/index.d.ts +2 -1
- package/dist/types/interfaces/AstsStock.d.ts +9 -7
- package/dist/types/interfaces/AstsStockInfo.d.ts +10 -3
- package/dist/types/interfaces/Template.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Asta/Actions/get/getActionStagesQuery.hook.ts +10 -0
- package/src/hooks/Asts/get/getProductInfoQuery.hook.ts +15 -0
- package/src/hooks/Asts/get/getStockQuery.hook.ts +7 -23
- package/src/hooks/index.ts +2 -7
- package/src/interfaces/AstsStock.ts +9 -7
- package/src/interfaces/AstsStockInfo.ts +11 -3
- package/src/interfaces/Template.ts +1 -0
- package/src/hooks/Asts/get/getStockInfoQuery.hook.ts +0 -15
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AstsStock } from "../../../interfaces";
|
|
2
|
+
export declare const getProductInfoQueryHook: (barcode: string) => import("@tanstack/react-query").UseQueryResult<{
|
|
3
|
+
Product: AstsStock;
|
|
4
|
+
ProductList: AstsStock[];
|
|
5
|
+
Color: string[];
|
|
6
|
+
Size: string[];
|
|
7
|
+
Size2: string[];
|
|
8
|
+
}, unknown>;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
-
import {
|
|
3
|
-
export interface StockQueryProps extends UseQueryOptions<
|
|
4
|
-
page?: number;
|
|
5
|
-
records?: number;
|
|
6
|
-
sortBy?: string;
|
|
7
|
-
sortDirection?: string;
|
|
8
|
-
storeCode?: string;
|
|
9
|
-
size?: string;
|
|
10
|
-
color?: string;
|
|
2
|
+
import { AstsStockInfo } from "../../../interfaces";
|
|
3
|
+
export interface StockQueryProps extends UseQueryOptions<AstsStockInfo[]> {
|
|
11
4
|
reference?: string;
|
|
12
|
-
|
|
13
|
-
barcode?: string;
|
|
5
|
+
countryId?: string;
|
|
14
6
|
}
|
|
15
|
-
export declare const getStockQueryHook: ({
|
|
7
|
+
export declare const getStockQueryHook: ({ reference, countryId }: StockQueryProps) => import("@tanstack/react-query").UseQueryResult<AstsStockInfo[], unknown>;
|
|
@@ -51,7 +51,7 @@ export * from './AsvProduct/get/getProductsStockDetailsQuery.hook';
|
|
|
51
51
|
export * from './Ass/get/getAssProductsByRefQuery.hook';
|
|
52
52
|
export * from './Ass/get/getAssProductsByStoreQuery.hook';
|
|
53
53
|
export * from './Ass/get/getAssProductsStockDetailsQuery.hook';
|
|
54
|
-
export * from './Asts/get/
|
|
54
|
+
export * from './Asts/get/getProductInfoQuery.hook';
|
|
55
55
|
export * from './Asts/get/getStockQuery.hook';
|
|
56
56
|
export * from './Astt/get/getTransferDocumentsQuery.hook';
|
|
57
57
|
export * from './Astt/get/getTransferDocumentsByIdQuery.hook';
|
|
@@ -97,6 +97,7 @@ export * from './Asta/AnswerType/mutate/useAnswerTypeMutateQuery.hook';
|
|
|
97
97
|
export * from './Asta/AnswerType/others/deleteAnswerTypeQuery.hook';
|
|
98
98
|
export * from './Asta/AnswerType/others/finishAnswerTypeQuery.hook';
|
|
99
99
|
export * from './Asta/Actions/get/getActionByIdQuery.hook';
|
|
100
|
+
export * from './Asta/Actions/get/getActionStagesQuery.hook';
|
|
100
101
|
export * from './Asta/Actions/get/getActionPriorityQuery.hook';
|
|
101
102
|
export * from './Asta/Actions/get/getActionQuery.hook';
|
|
102
103
|
export * from './Asta/Actions/mutate/useActionMutateQuery.hook';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
export interface AstsStock {
|
|
2
|
-
|
|
2
|
+
Id: string;
|
|
3
|
+
ParentName: string;
|
|
4
|
+
ParentDescription: string;
|
|
3
5
|
Name: string;
|
|
4
6
|
Description: string;
|
|
7
|
+
Barcode: string;
|
|
5
8
|
Reference: string;
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
InternalReference: string;
|
|
10
|
+
Sku: string;
|
|
8
11
|
Size: string;
|
|
9
|
-
StockQty: number;
|
|
10
|
-
LegSize: string;
|
|
11
|
-
StockOnlineQty: number;
|
|
12
12
|
Color: string;
|
|
13
|
-
|
|
13
|
+
Image: string;
|
|
14
|
+
Price: number;
|
|
15
|
+
Company: string;
|
|
14
16
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export interface AstsStockInfo {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
StoreCode: string;
|
|
3
|
+
Stocks: StockInterface[];
|
|
4
|
+
}
|
|
5
|
+
export interface StockInterface {
|
|
6
|
+
SKU: string;
|
|
7
|
+
Values: {
|
|
8
|
+
ValueStore: string;
|
|
9
|
+
ValueOnline: string;
|
|
10
|
+
ValueWarehouse: string;
|
|
11
|
+
};
|
|
5
12
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
import { HeadersInterface } from "../../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export const getActionStageQueryHook = () => {
|
|
6
|
+
return useQuery(
|
|
7
|
+
['ACTION_STAGES_QUERY'],
|
|
8
|
+
() => getAuth0<HeadersInterface[]>(`/ASTA/Actions/ActionsStatus`),
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
import { AstsStock } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export const getProductInfoQueryHook = (barcode: string) => {
|
|
6
|
+
return useQuery(
|
|
7
|
+
['ASTS_PRODUCT_INFO_QUERY', barcode],
|
|
8
|
+
() => getAuth0<{ Product: AstsStock, ProductList: AstsStock[], Color: string[], Size: string[], Size2: string[] }>(`/ASTS/Product`, {
|
|
9
|
+
pBarcode: barcode
|
|
10
|
+
}),
|
|
11
|
+
{
|
|
12
|
+
enabled: !!(barcode),
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
-
import {
|
|
2
|
+
import { AstsStockInfo } from "../../../interfaces";
|
|
3
3
|
import { getAuth0 } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
|
-
export interface StockQueryProps extends UseQueryOptions<
|
|
6
|
-
page?: number;
|
|
7
|
-
records?: number;
|
|
8
|
-
sortBy?: string;
|
|
9
|
-
sortDirection?: string;
|
|
10
|
-
storeCode?: string;
|
|
11
|
-
size?: string;
|
|
12
|
-
color?: string;
|
|
5
|
+
export interface StockQueryProps extends UseQueryOptions<AstsStockInfo[]> {
|
|
13
6
|
reference?: string;
|
|
14
|
-
|
|
15
|
-
barcode?: string;
|
|
7
|
+
countryId?: string;
|
|
16
8
|
}
|
|
17
9
|
|
|
18
|
-
export const getStockQueryHook = ({
|
|
10
|
+
export const getStockQueryHook = ({ reference, countryId }: StockQueryProps) => {
|
|
19
11
|
return useQuery(
|
|
20
|
-
['ASTS_STOCK_QUERY',
|
|
21
|
-
() => getAuth0<
|
|
22
|
-
pPage: page || 1,
|
|
23
|
-
pRecords: records || 50,
|
|
24
|
-
pSortBy: sortBy || 'Reference',
|
|
25
|
-
pSortDirection: sortDirection || 'asc',
|
|
26
|
-
pStoreCode: storeCode,
|
|
27
|
-
pSize: size,
|
|
28
|
-
pColor: color,
|
|
12
|
+
['ASTS_STOCK_QUERY', reference, countryId],
|
|
13
|
+
() => getAuth0<AstsStockInfo[]>('/ASTS/Stock', {
|
|
29
14
|
pReference: reference,
|
|
30
|
-
|
|
31
|
-
pBarcode: barcode
|
|
15
|
+
pCountryId: countryId || "PT"
|
|
32
16
|
})
|
|
33
17
|
);
|
|
34
18
|
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -72,7 +72,7 @@ export * from './Ass/get/getAssProductsByStoreQuery.hook';
|
|
|
72
72
|
export * from './Ass/get/getAssProductsStockDetailsQuery.hook';
|
|
73
73
|
|
|
74
74
|
//ASTS
|
|
75
|
-
export * from './Asts/get/
|
|
75
|
+
export * from './Asts/get/getProductInfoQuery.hook';
|
|
76
76
|
export * from './Asts/get/getStockQuery.hook';
|
|
77
77
|
|
|
78
78
|
//Astt
|
|
@@ -128,6 +128,7 @@ export * from './Asta/AnswerType/others/deleteAnswerTypeQuery.hook';
|
|
|
128
128
|
export * from './Asta/AnswerType/others/finishAnswerTypeQuery.hook';
|
|
129
129
|
|
|
130
130
|
export * from './Asta/Actions/get/getActionByIdQuery.hook';
|
|
131
|
+
export * from './Asta/Actions/get/getActionStagesQuery.hook';
|
|
131
132
|
export * from './Asta/Actions/get/getActionPriorityQuery.hook';
|
|
132
133
|
export * from './Asta/Actions/get/getActionQuery.hook';
|
|
133
134
|
export * from './Asta/Actions/mutate/useActionMutateQuery.hook';
|
|
@@ -153,23 +154,17 @@ export * from './OSUA/get/documentos/getSitooDocumentos.hook';
|
|
|
153
154
|
export * from './OSUA/get/vouchers/getGngVoucher.hook';
|
|
154
155
|
export * from './OSUA/get/vouchers/getSitooVouchers.hook';
|
|
155
156
|
export * from './OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook';
|
|
156
|
-
|
|
157
157
|
export * from './OSUA/mutate/postCreateIntegrationRequest.hook';
|
|
158
158
|
|
|
159
159
|
//ACB
|
|
160
160
|
export * from './ACB/get/getClientBalance.hook';
|
|
161
161
|
export * from './ACB/mutate/postClientBalance.hook';
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
163
|
//BackofficeAtim
|
|
166
|
-
|
|
167
164
|
export * from './ATIM/BackOffice/get/useEmployeeTimekeepingDetails.hook';
|
|
168
|
-
|
|
169
165
|
export * from './ATIM/BackOffice/get/useStoresQueryHook.hook';
|
|
170
166
|
export * from './ATIM/BackOffice/mutate/postAttendanceRange.hook';
|
|
171
167
|
|
|
172
|
-
|
|
173
168
|
//Others
|
|
174
169
|
export * from './Others/useJobTitlesQuery.hook';
|
|
175
170
|
export * from './Others/useContractStatesQuery.hook';
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
export interface AstsStock {
|
|
3
|
-
|
|
3
|
+
Id: string;
|
|
4
|
+
ParentName: string;
|
|
5
|
+
ParentDescription: string;
|
|
4
6
|
Name: string;
|
|
5
7
|
Description: string;
|
|
8
|
+
Barcode: string;
|
|
6
9
|
Reference: string;
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
InternalReference: string;
|
|
11
|
+
Sku: string;
|
|
9
12
|
Size: string;
|
|
10
|
-
StockQty: number;
|
|
11
|
-
LegSize: string;
|
|
12
|
-
StockOnlineQty: number;
|
|
13
13
|
Color: string;
|
|
14
|
-
|
|
14
|
+
Image: string;
|
|
15
|
+
Price: number;
|
|
16
|
+
Company: string;
|
|
15
17
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
export interface AstsStockInfo {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
StoreCode: string;
|
|
4
|
+
Stocks: StockInterface[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface StockInterface {
|
|
8
|
+
SKU: string;
|
|
9
|
+
Values: {
|
|
10
|
+
ValueStore: string;
|
|
11
|
+
ValueOnline: string;
|
|
12
|
+
ValueWarehouse: string;
|
|
13
|
+
}
|
|
6
14
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useQuery } from "@tanstack/react-query";
|
|
2
|
-
import { AstsStockInfo } from "../../../interfaces";
|
|
3
|
-
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
-
|
|
5
|
-
export const getStockInfoQueryHook = (barcode: string) => {
|
|
6
|
-
return useQuery(
|
|
7
|
-
['STOCK_INFO_QUERY', barcode],
|
|
8
|
-
() => getAuth0<AstsStockInfo>(`/ASTS/Stock/Information`, {
|
|
9
|
-
pBarcode: barcode
|
|
10
|
-
}),
|
|
11
|
-
{
|
|
12
|
-
enabled: !!(barcode),
|
|
13
|
-
},
|
|
14
|
-
);
|
|
15
|
-
}
|