@omniumretail/shared-resources 0.1.32 → 0.1.34
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/AsvProduct/get/getProductsStockDetailsQuery.hook.d.ts +7 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/interfaces/AsvProductsStockDetails.d.ts +17 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/AsvProduct/get/getProductsStockDetailsQuery.hook.ts +21 -0
- package/src/hooks/index.ts +1 -0
- package/src/interfaces/AsvProductsStockDetails.ts +20 -0
- package/src/interfaces/index.ts +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AsvProductsStockDetails } from "../../../interfaces";
|
|
3
|
+
export interface ProductsStockDetailsProps extends UseQueryOptions<AsvProductsStockDetails> {
|
|
4
|
+
reference: string;
|
|
5
|
+
storeCode: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const getProductsStockDetailsQueryHook: ({ reference, storeCode }: ProductsStockDetailsProps) => import("@tanstack/react-query").UseQueryResult<AsvProductsStockDetails, unknown>;
|
|
@@ -42,6 +42,7 @@ export * from './Roles/get/useAllStoreQuery.hook';
|
|
|
42
42
|
export * from './Roles/get/useAllRolesQuery.hook';
|
|
43
43
|
export * from './AsvProduct/get/getProductsByRefQuery.hook';
|
|
44
44
|
export * from './AsvProduct/get/getProductsByStoreQuery.hook';
|
|
45
|
+
export * from './AsvProduct/get/getProductsStockDetailsQuery.hook';
|
|
45
46
|
export * from './Others/useJobTitlesQuery.hook';
|
|
46
47
|
export * from './Others/useContractStatesQuery.hook';
|
|
47
48
|
export * from './Others/useApplicationDataQuery.hook';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface AsvProductsStockDetails {
|
|
2
|
+
Id: string;
|
|
3
|
+
Reference: string;
|
|
4
|
+
Name: string;
|
|
5
|
+
Variantes: AsvProductsVariantes[];
|
|
6
|
+
}
|
|
7
|
+
export interface AsvProductsVariantes {
|
|
8
|
+
Color: string;
|
|
9
|
+
Image: string;
|
|
10
|
+
ColorVariants: AsvProductsColorVariantes[];
|
|
11
|
+
}
|
|
12
|
+
export interface AsvProductsColorVariantes {
|
|
13
|
+
SKU: string;
|
|
14
|
+
Size: string;
|
|
15
|
+
Stock: number;
|
|
16
|
+
StockOnline: number;
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AsvProductsStockDetails, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { get } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface ProductsStockDetailsProps extends UseQueryOptions<AsvProductsStockDetails> {
|
|
6
|
+
reference: string;
|
|
7
|
+
storeCode: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const getProductsStockDetailsQueryHook = ({ reference, storeCode }: ProductsStockDetailsProps) => {
|
|
11
|
+
return useQuery(
|
|
12
|
+
['ASV_PRODUCT_STOCK_DETAILS', reference, storeCode],
|
|
13
|
+
() => get<AsvProductsStockDetails>('/ASV/Products/StockDetails', {
|
|
14
|
+
pReference: reference,
|
|
15
|
+
pStoreCode: storeCode
|
|
16
|
+
}),
|
|
17
|
+
{
|
|
18
|
+
keepPreviousData: true,
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -59,6 +59,7 @@ export * from './Roles/get/useAllRolesQuery.hook';
|
|
|
59
59
|
//AsvProduct
|
|
60
60
|
export * from './AsvProduct/get/getProductsByRefQuery.hook';
|
|
61
61
|
export * from './AsvProduct/get/getProductsByStoreQuery.hook';
|
|
62
|
+
export * from './AsvProduct/get/getProductsStockDetailsQuery.hook';
|
|
62
63
|
|
|
63
64
|
//Others
|
|
64
65
|
export * from './Others/useJobTitlesQuery.hook';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
export interface AsvProductsStockDetails {
|
|
3
|
+
Id: string;
|
|
4
|
+
Reference: string;
|
|
5
|
+
Name: string;
|
|
6
|
+
Variantes: AsvProductsVariantes[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AsvProductsVariantes {
|
|
10
|
+
Color: string;
|
|
11
|
+
Image: string;
|
|
12
|
+
ColorVariants: AsvProductsColorVariantes[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AsvProductsColorVariantes {
|
|
16
|
+
SKU: string;
|
|
17
|
+
Size: string;
|
|
18
|
+
Stock: number;
|
|
19
|
+
StockOnline: number;
|
|
20
|
+
}
|
package/src/interfaces/index.ts
CHANGED