@omniumretail/shared-resources 0.1.84 → 0.1.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 +1 -1
- package/dist/types/helpers/codeMutation.d.ts +1 -1
- package/dist/types/hooks/Ass/get/getAssProductsByRefQuery.hook.d.ts +8 -0
- package/dist/types/hooks/Ass/get/getAssProductsByStoreQuery.hook.d.ts +11 -0
- package/dist/types/hooks/Ass/get/getAssProductsStockDetailsQuery.hook.d.ts +7 -0
- package/dist/types/hooks/Others/getRegulationQuery.hook.d.ts +6 -0
- package/dist/types/hooks/Others/useRegulationQuery.hook.d.ts +6 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/interfaces/User.d.ts +1 -0
- package/package.json +2 -1
- package/src/helpers/codeMutation.tsx +1 -0
- package/src/hooks/ATIM/PicaPonto/get/getEmployeesWithTimekeeping.hook.ts +1 -1
- package/src/hooks/Ass/get/getAssProductsByRefQuery.hook.ts +23 -0
- package/src/hooks/Ass/get/getAssProductsByStoreQuery.hook.ts +29 -0
- package/src/hooks/Ass/get/getAssProductsStockDetailsQuery.hook.ts +21 -0
- package/src/hooks/Others/getRegulationQuery.hook.ts +14 -0
- package/src/hooks/Others/useRegulationQuery.hook.ts +14 -0
- package/src/hooks/index.ts +7 -0
- package/src/interfaces/User.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { MenuProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
export type MenuItem = Required<MenuProps>['items'][number];
|
|
4
4
|
export declare function getItem(label: React.ReactNode, key: React.Key, icon?: React.ReactNode, children?: MenuItem[], type?: 'group'): MenuItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AsvProductsByReference, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface AssProductsByRefProps extends UseQueryOptions<ResponseList<"StockList", AsvProductsByReference>> {
|
|
4
|
+
reference: string;
|
|
5
|
+
sortBy?: string;
|
|
6
|
+
sortDirection?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const getAssProductsByRef: ({ reference, sortBy, sortDirection }: AssProductsByRefProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"StockList", AsvProductsByReference>, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AsvProductsByStore, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface AssProductsByStoreProps extends UseQueryOptions<ResponseList<"StockList", AsvProductsByStore>> {
|
|
4
|
+
reference: string;
|
|
5
|
+
storeCode: string;
|
|
6
|
+
hasStock?: boolean;
|
|
7
|
+
filterColor?: boolean;
|
|
8
|
+
sortBy?: string;
|
|
9
|
+
sortDirection?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getAssProductsByStore: ({ reference, storeCode, hasStock, filterColor, sortBy, sortDirection }: AssProductsByStoreProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"StockList", AsvProductsByStore>, unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AsvProductsStockDetails } from "../../../interfaces";
|
|
3
|
+
export interface AssProductsStockDetailsProps extends UseQueryOptions<AsvProductsStockDetails> {
|
|
4
|
+
reference: string;
|
|
5
|
+
storeCode: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const getAssProductsStockDetailsQueryHook: ({ reference, storeCode }: AssProductsStockDetailsProps) => import("@tanstack/react-query").UseQueryResult<AsvProductsStockDetails, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
interface RegulationQueryProps {
|
|
3
|
+
TermsAndConditionsURL: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const getRegulationQueryHook: ({ ...options }: UseQueryOptions<RegulationQueryProps>) => import("@tanstack/react-query").UseQueryResult<RegulationQueryProps, unknown>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
interface RegulationQueryProps {
|
|
3
|
+
TermsAndConditionsURL: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const useRegulationQueryHook: (userId: string, { ...options }: UseQueryOptions<RegulationQueryProps>) => import("@tanstack/react-query").UseQueryResult<RegulationQueryProps, unknown>;
|
|
6
|
+
export {};
|
|
@@ -45,6 +45,9 @@ export * from './Roles/get/useAllRolesQuery.hook';
|
|
|
45
45
|
export * from './AsvProduct/get/getProductsByRefQuery.hook';
|
|
46
46
|
export * from './AsvProduct/get/getProductsByStoreQuery.hook';
|
|
47
47
|
export * from './AsvProduct/get/getProductsStockDetailsQuery.hook';
|
|
48
|
+
export * from './Ass/get/getAssProductsByRefQuery.hook';
|
|
49
|
+
export * from './Ass/get/getAssProductsByStoreQuery.hook';
|
|
50
|
+
export * from './Ass/get/getAssProductsStockDetailsQuery.hook';
|
|
48
51
|
export * from './Astt/get/getTransferDocumentsQuery.hook';
|
|
49
52
|
export * from './Astt/get/getTransferDocumentsByIdQuery.hook';
|
|
50
53
|
export * from './Astt/get/getTransferDocumentsByPackageQuery.hook';
|
|
@@ -109,3 +112,5 @@ export * from './Others/getWeeklyWorkloadQuery.hook';
|
|
|
109
112
|
export * from './Others/getNotificationTitleQuery.hook';
|
|
110
113
|
export * from './Others/getUserEmailStatusQuery.hook';
|
|
111
114
|
export * from './Others/getPriceChangePinQuery.hook';
|
|
115
|
+
export * from './Others/getRegulationQuery.hook';
|
|
116
|
+
export * from './Others/useRegulationQuery.hook';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omniumretail/shared-resources",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.86",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared Components and services or utils to the frontend versions",
|
|
6
6
|
"main": "dist/bundle.js",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
36
36
|
"@tanstack/react-query": "^4.29.19",
|
|
37
37
|
"antd": "^4.23.4",
|
|
38
|
+
"moment": "^2.29.4",
|
|
38
39
|
"classnames": "^2.3.2",
|
|
39
40
|
"date-fns": "^2.29.3",
|
|
40
41
|
"react": "^18.0.0",
|
|
@@ -24,7 +24,7 @@ export const getEmployeesWithTimekeeping = ({storeId, date, search, page, record
|
|
|
24
24
|
pDate: date || getDateToUnix(new Date()),
|
|
25
25
|
pPage: page || 1,
|
|
26
26
|
pRecords: records || 50,
|
|
27
|
-
pSortBy: sortBy || "
|
|
27
|
+
pSortBy: sortBy || "DisplayName" ,
|
|
28
28
|
pSortDirection: sortDirection || "asc",
|
|
29
29
|
pSearch: search
|
|
30
30
|
}),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AsvProductsByReference, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { get } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface AssProductsByRefProps extends UseQueryOptions<ResponseList<"StockList", AsvProductsByReference>> {
|
|
6
|
+
reference: string;
|
|
7
|
+
sortBy?: string;
|
|
8
|
+
sortDirection?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getAssProductsByRef = ({ reference, sortBy, sortDirection }: AssProductsByRefProps) => {
|
|
12
|
+
return useQuery(
|
|
13
|
+
['ASS_PRODUCT_BY_REF', reference, sortBy, sortDirection],
|
|
14
|
+
() => get<ResponseList<"StockList", AsvProductsByReference>>('/ASS/Products/AllStores', {
|
|
15
|
+
pReference: reference,
|
|
16
|
+
pSortBy: sortBy,
|
|
17
|
+
pSortDirection: sortDirection
|
|
18
|
+
}),
|
|
19
|
+
{
|
|
20
|
+
keepPreviousData: true,
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AsvProductsByStore, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { get } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface AssProductsByStoreProps extends UseQueryOptions<ResponseList<"StockList", AsvProductsByStore>> {
|
|
6
|
+
reference: string;
|
|
7
|
+
storeCode: string;
|
|
8
|
+
hasStock?: boolean;
|
|
9
|
+
filterColor?: boolean;
|
|
10
|
+
sortBy?: string;
|
|
11
|
+
sortDirection?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getAssProductsByStore = ({ reference, storeCode, hasStock, filterColor, sortBy, sortDirection }: AssProductsByStoreProps) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['ASS_PRODUCT_BY_STORE', reference, storeCode, hasStock, filterColor, sortBy, sortDirection],
|
|
17
|
+
() => get<ResponseList<"StockList", AsvProductsByStore>>('/ASS/Products', {
|
|
18
|
+
pReference: reference,
|
|
19
|
+
pStoreCode: storeCode,
|
|
20
|
+
pHasStock: hasStock,
|
|
21
|
+
pRefColor: filterColor,
|
|
22
|
+
pSortBy: sortBy,
|
|
23
|
+
pSortDirection: sortDirection
|
|
24
|
+
}),
|
|
25
|
+
{
|
|
26
|
+
keepPreviousData: true,
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AsvProductsStockDetails } from "../../../interfaces";
|
|
3
|
+
import { get } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface AssProductsStockDetailsProps extends UseQueryOptions<AsvProductsStockDetails> {
|
|
6
|
+
reference: string;
|
|
7
|
+
storeCode: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const getAssProductsStockDetailsQueryHook = ({ reference, storeCode }: AssProductsStockDetailsProps) => {
|
|
11
|
+
return useQuery(
|
|
12
|
+
['ASS_PRODUCT_STOCK_DETAILS', reference, storeCode],
|
|
13
|
+
() => get<AsvProductsStockDetails>('/ASS/Products/StockDetails', {
|
|
14
|
+
pReference: reference,
|
|
15
|
+
pStoreCode: storeCode
|
|
16
|
+
}),
|
|
17
|
+
{
|
|
18
|
+
keepPreviousData: true,
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getAuth0 } from '../../..';
|
|
2
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
interface RegulationQueryProps {
|
|
5
|
+
TermsAndConditionsURL: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const getRegulationQueryHook = ({...options} : UseQueryOptions<RegulationQueryProps>) => {
|
|
9
|
+
return useQuery(
|
|
10
|
+
['REGULATION_QUERY'],
|
|
11
|
+
() => getAuth0<RegulationQueryProps>(`/AACP/Users/termsAndConditions`),
|
|
12
|
+
options
|
|
13
|
+
);
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { putAuth0 } from '../../..';
|
|
2
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
3
|
+
|
|
4
|
+
interface RegulationQueryProps {
|
|
5
|
+
TermsAndConditionsURL: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const useRegulationQueryHook = (userId: string, {...options} : UseQueryOptions<RegulationQueryProps>) => {
|
|
9
|
+
return useQuery(
|
|
10
|
+
['USE_REGULATION_QUERY', userId],
|
|
11
|
+
() => putAuth0<RegulationQueryProps>(`/AACP/Users/${userId}/termsAndConditions`),
|
|
12
|
+
options
|
|
13
|
+
);
|
|
14
|
+
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -63,6 +63,11 @@ export * from './AsvProduct/get/getProductsByRefQuery.hook';
|
|
|
63
63
|
export * from './AsvProduct/get/getProductsByStoreQuery.hook';
|
|
64
64
|
export * from './AsvProduct/get/getProductsStockDetailsQuery.hook';
|
|
65
65
|
|
|
66
|
+
//Ass
|
|
67
|
+
export * from './Ass/get/getAssProductsByRefQuery.hook';
|
|
68
|
+
export * from './Ass/get/getAssProductsByStoreQuery.hook';
|
|
69
|
+
export * from './Ass/get/getAssProductsStockDetailsQuery.hook';
|
|
70
|
+
|
|
66
71
|
//Astt
|
|
67
72
|
export * from './Astt/get/getTransferDocumentsQuery.hook';
|
|
68
73
|
export * from './Astt/get/getTransferDocumentsByIdQuery.hook';
|
|
@@ -138,3 +143,5 @@ export * from './Others/getWeeklyWorkloadQuery.hook';
|
|
|
138
143
|
export * from './Others/getNotificationTitleQuery.hook';
|
|
139
144
|
export * from './Others/getUserEmailStatusQuery.hook';
|
|
140
145
|
export * from './Others/getPriceChangePinQuery.hook';
|
|
146
|
+
export * from './Others/getRegulationQuery.hook';
|
|
147
|
+
export * from './Others/useRegulationQuery.hook';
|