@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.
@@ -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
+ }
@@ -27,3 +27,4 @@ export * from './Checkout';
27
27
  export * from './VerifyUser';
28
28
  export * from './VerifyImage';
29
29
  export * from './Workload';
30
+ export * from './AsvProductsStockDetails';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -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
+ }
@@ -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
+ }
@@ -27,3 +27,4 @@ export * from './Checkout';
27
27
  export * from './VerifyUser';
28
28
  export * from './VerifyImage';
29
29
  export * from './Workload';
30
+ export * from './AsvProductsStockDetails';