@omniumretail/shared-resources 0.0.85 → 0.0.86
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 +48 -37
- package/dist/types/hooks/AsvProduct/get/getProductsByRefQuery.hook.d.ts +4 -2
- package/dist/types/hooks/AsvProduct/get/getProductsByStoreQuery.hook.d.ts +5 -2
- package/dist/types/hooks/Store/useStoreByCodeQuery.hook.d.ts +8 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/interfaces/AsvProductsByReference.d.ts +4 -4
- package/dist/types/interfaces/AsvProductsByStore.d.ts +4 -3
- package/package.json +1 -1
- package/src/hooks/AsvProduct/get/getProductsByRefQuery.hook.ts +8 -4
- package/src/hooks/AsvProduct/get/getProductsByStoreQuery.hook.ts +11 -5
- package/src/hooks/Store/useStoreByCodeQuery.hook.ts +21 -0
- package/src/hooks/index.ts +1 -0
- package/src/interfaces/AsvProductsByReference.ts +4 -4
- package/src/interfaces/AsvProductsByStore.ts +4 -3
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { AsvProductsByReference, ResponseList } from "../../../interfaces";
|
|
3
|
-
export interface ProductsByRefProps extends UseQueryOptions<ResponseList<"", AsvProductsByReference>> {
|
|
3
|
+
export interface ProductsByRefProps extends UseQueryOptions<ResponseList<"StockList", AsvProductsByReference>> {
|
|
4
4
|
reference: string;
|
|
5
|
+
sortBy?: string;
|
|
6
|
+
sortDirection?: string;
|
|
5
7
|
}
|
|
6
|
-
export declare const getProductsByRef: ({ reference }: ProductsByRefProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"", AsvProductsByReference>, unknown>;
|
|
8
|
+
export declare const getProductsByRef: ({ reference, sortBy, sortDirection }: ProductsByRefProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"StockList", AsvProductsByReference>, unknown>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
2
|
import { AsvProductsByStore, ResponseList } from "../../../interfaces";
|
|
3
|
-
export interface ProductsByStoreProps extends UseQueryOptions<ResponseList<"", AsvProductsByStore>> {
|
|
3
|
+
export interface ProductsByStoreProps extends UseQueryOptions<ResponseList<"StockList", AsvProductsByStore>> {
|
|
4
4
|
reference: string;
|
|
5
5
|
storeCode: string;
|
|
6
|
+
hasStock?: boolean;
|
|
7
|
+
sortBy?: string;
|
|
8
|
+
sortDirection?: string;
|
|
6
9
|
}
|
|
7
|
-
export declare const getProductsByStore: ({ reference, storeCode }: ProductsByStoreProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"", AsvProductsByStore>, unknown>;
|
|
10
|
+
export declare const getProductsByStore: ({ reference, storeCode, hasStock, sortBy, sortDirection }: ProductsByStoreProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"StockList", AsvProductsByStore>, unknown>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Store } from "../../interfaces/Store";
|
|
3
|
+
interface StoreQueryProps extends UseQueryOptions<Store> {
|
|
4
|
+
code: string;
|
|
5
|
+
shouldFetch?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const useStoreByCodeQuery: ({ code, shouldFetch }: StoreQueryProps) => import("@tanstack/react-query").UseQueryResult<Store, unknown>;
|
|
8
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './Store/useStoreQuery';
|
|
2
|
+
export * from './Store/useStoreByCodeQuery.hook';
|
|
2
3
|
export * from './EvaluationCycle/get/useEvaluationCycleIdQuery.hook';
|
|
3
4
|
export * from './EvaluationCycle/mutate/useEvaluationCycleMutateQuery.hook';
|
|
4
5
|
export * from './EvaluationCycle/others/activateEvaluationCycleQuery.hook';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export interface AsvProductsByReference {
|
|
2
|
-
|
|
2
|
+
StoreName: string;
|
|
3
3
|
Reference: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
ColorCode: string;
|
|
5
|
+
SKU: string;
|
|
6
|
+
size: AsvProductsSize[];
|
|
7
7
|
}
|
|
8
8
|
export interface AsvProductsSize {
|
|
9
9
|
Size: string;
|
|
@@ -2,10 +2,11 @@ export interface AsvProductsByStore {
|
|
|
2
2
|
Size: string;
|
|
3
3
|
LegSize: string;
|
|
4
4
|
Reference: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
ColorCode: string;
|
|
6
|
+
SKU: string;
|
|
7
7
|
Description: string;
|
|
8
8
|
StoreQuantity: number;
|
|
9
9
|
OnlineQuantity: number;
|
|
10
|
-
|
|
10
|
+
WarehouseQuantityInt: number;
|
|
11
|
+
WarehouseQuantityExt: number;
|
|
11
12
|
}
|
package/package.json
CHANGED
|
@@ -2,15 +2,19 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
|
2
2
|
import { AsvProductsByReference, ResponseList } from "../../../interfaces";
|
|
3
3
|
import { get } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
|
-
export interface ProductsByRefProps extends UseQueryOptions<ResponseList<"", AsvProductsByReference>> {
|
|
5
|
+
export interface ProductsByRefProps extends UseQueryOptions<ResponseList<"StockList", AsvProductsByReference>> {
|
|
6
6
|
reference: string;
|
|
7
|
+
sortBy?: string;
|
|
8
|
+
sortDirection?: string;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
|
-
export const getProductsByRef = ({ reference }: ProductsByRefProps) => {
|
|
11
|
+
export const getProductsByRef = ({ reference, sortBy, sortDirection }: ProductsByRefProps) => {
|
|
10
12
|
return useQuery(
|
|
11
|
-
['ASV_PRODUCT_BY_REF', reference],
|
|
12
|
-
() => get<ResponseList<"", AsvProductsByReference>>('/ASV/Products', {
|
|
13
|
+
['ASV_PRODUCT_BY_REF', reference, sortBy, sortDirection],
|
|
14
|
+
() => get<ResponseList<"StockList", AsvProductsByReference>>('/ASV/Products/AllStores', {
|
|
13
15
|
pReference: reference,
|
|
16
|
+
pSortBy: sortBy,
|
|
17
|
+
pSortDirection: sortDirection
|
|
14
18
|
}),
|
|
15
19
|
{
|
|
16
20
|
keepPreviousData: true,
|
|
@@ -2,17 +2,23 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
|
2
2
|
import { AsvProductsByStore, ResponseList } from "../../../interfaces";
|
|
3
3
|
import { get } from "../../../services/ApiService";
|
|
4
4
|
|
|
5
|
-
export interface ProductsByStoreProps extends UseQueryOptions<ResponseList<"", AsvProductsByStore>> {
|
|
5
|
+
export interface ProductsByStoreProps extends UseQueryOptions<ResponseList<"StockList", AsvProductsByStore>> {
|
|
6
6
|
reference: string;
|
|
7
7
|
storeCode: string;
|
|
8
|
+
hasStock?: boolean;
|
|
9
|
+
sortBy?: string;
|
|
10
|
+
sortDirection?: string;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
|
-
export const getProductsByStore = ({ reference, storeCode }: ProductsByStoreProps) => {
|
|
13
|
+
export const getProductsByStore = ({ reference, storeCode, hasStock, sortBy, sortDirection }: ProductsByStoreProps) => {
|
|
11
14
|
return useQuery(
|
|
12
|
-
['ASV_PRODUCT_BY_STORE', reference, storeCode],
|
|
13
|
-
() => get<ResponseList<"", AsvProductsByStore>>('/ASV/Products', {
|
|
15
|
+
['ASV_PRODUCT_BY_STORE', reference, storeCode, hasStock, sortBy, sortDirection],
|
|
16
|
+
() => get<ResponseList<"StockList", AsvProductsByStore>>('/ASV/Products', {
|
|
14
17
|
pReference: reference,
|
|
15
|
-
pStoreCode: storeCode
|
|
18
|
+
pStoreCode: storeCode,
|
|
19
|
+
pHasStock: hasStock,
|
|
20
|
+
pSortBy: sortBy,
|
|
21
|
+
pSortDirection: sortDirection
|
|
16
22
|
}),
|
|
17
23
|
{
|
|
18
24
|
keepPreviousData: true,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { Store } from "../../interfaces/Store";
|
|
3
|
+
import { get } from "../../services";
|
|
4
|
+
|
|
5
|
+
interface StoreQueryProps extends UseQueryOptions<Store> {
|
|
6
|
+
code: string;
|
|
7
|
+
shouldFetch?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const useStoreByCodeQuery = ({ code, shouldFetch }: StoreQueryProps) => {
|
|
11
|
+
return useQuery(
|
|
12
|
+
['STORE_CODE_QUERY', code, shouldFetch],
|
|
13
|
+
() => get<Store>('/Franchise/Locations/findByCode', {
|
|
14
|
+
pCode: code,
|
|
15
|
+
|
|
16
|
+
}),
|
|
17
|
+
{
|
|
18
|
+
enabled: shouldFetch,
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
export interface AsvProductsByReference {
|
|
3
|
-
|
|
3
|
+
StoreName: string;
|
|
4
4
|
Reference: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
ColorCode: string;
|
|
6
|
+
SKU: string;
|
|
7
|
+
size: AsvProductsSize[];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface AsvProductsSize {
|
|
@@ -3,10 +3,11 @@ export interface AsvProductsByStore {
|
|
|
3
3
|
Size: string;
|
|
4
4
|
LegSize: string;
|
|
5
5
|
Reference: string;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
ColorCode: string;
|
|
7
|
+
SKU: string;
|
|
8
8
|
Description: string;
|
|
9
9
|
StoreQuantity: number;
|
|
10
10
|
OnlineQuantity: number;
|
|
11
|
-
|
|
11
|
+
WarehouseQuantityInt: number;
|
|
12
|
+
WarehouseQuantityExt: number;
|
|
12
13
|
}
|