@omniumretail/shared-resources 0.1.83 → 0.1.85
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/Asta/Answer/get/getAstaAnswerByIdQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +4 -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/Asta/Answer/get/getAstaAnswerByIdQuery.hook.ts +15 -0
- package/src/hooks/Asta/Answer/get/getAstaAnswerQuery.hook.ts +1 -1
- package/src/hooks/Asta/Answer/others/finishAstaAnswersQuery.hook.ts +1 -1
- package/src/hooks/index.ts +6 -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>;
|
|
@@ -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';
|
|
@@ -76,6 +79,7 @@ export * from './Asta/Inspection/others/finishInspectionQuery.hook';
|
|
|
76
79
|
export * from './Asta/Inspection/others/archiveTemplateQuery.hook';
|
|
77
80
|
export * from './Asta/Inspection/others/extractTemplateQuery.hook';
|
|
78
81
|
export * from './Asta/Answer/get/getAstaAnswerQuery.hook';
|
|
82
|
+
export * from './Asta/Answer/get/getAstaAnswerByIdQuery.hook';
|
|
79
83
|
export * from './Asta/Answer/mutate/useAstaAnswersMutateQuery.hook';
|
|
80
84
|
export * from './Asta/Answer/others/finishAstaAnswersQuery.hook';
|
|
81
85
|
export * from './Asta/Answer/others/putAnswerImageQuery.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.85",
|
|
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,15 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
import { Answer } from "../../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export const getAnswerByIdQueryHook = (answerId: string) => {
|
|
6
|
+
return useQuery(
|
|
7
|
+
['ANSWER_ID_QUERY', answerId],
|
|
8
|
+
() => getAuth0<Answer>(`/ASTA/Answers/GetAnswerById`, {
|
|
9
|
+
pId: answerId
|
|
10
|
+
}),
|
|
11
|
+
{
|
|
12
|
+
enabled: !!(answerId),
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -14,7 +14,7 @@ export interface AstaAnswersQueryProps extends UseQueryOptions<ResponseList<"Ans
|
|
|
14
14
|
export const getAstaAnswersQueryHook = ({ tags, page, records, sortBy, sortDirection, query }: AstaAnswersQueryProps) => {
|
|
15
15
|
return useQuery(
|
|
16
16
|
['ASTA_ANSWERS_QUERY', tags, page, records, sortBy, sortDirection, query],
|
|
17
|
-
() => getAuth0<ResponseList<"Answers", Answer>>('/ASTA/Answers/
|
|
17
|
+
() => getAuth0<ResponseList<"Answers", Answer>>('/ASTA/Answers/GetAnswers', {
|
|
18
18
|
pPage: page || 1,
|
|
19
19
|
pRecords: records || 50,
|
|
20
20
|
pSortBy: sortBy || 'Type',
|
|
@@ -5,7 +5,7 @@ import { putAuth0 } from '../../../../services/ApiService';
|
|
|
5
5
|
export const finishAstaAnswersQueryHook = () => {
|
|
6
6
|
const queryClient = useQueryClient();
|
|
7
7
|
return useMutation<Answer, unknown, Answer>((data: Answer) => {
|
|
8
|
-
return putAuth0(`/ASTA/Answers/
|
|
8
|
+
return putAuth0(`/ASTA/Answers/FinishInspectionAnswer/${data.Id}`, undefined, data)
|
|
9
9
|
}, {
|
|
10
10
|
onSuccess: (data: Answer) => {
|
|
11
11
|
queryClient.setQueryData(
|
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';
|
|
@@ -101,6 +106,7 @@ export * from './Asta/Inspection/others/archiveTemplateQuery.hook';
|
|
|
101
106
|
export * from './Asta/Inspection/others/extractTemplateQuery.hook';
|
|
102
107
|
|
|
103
108
|
export * from './Asta/Answer/get/getAstaAnswerQuery.hook';
|
|
109
|
+
export * from './Asta/Answer/get/getAstaAnswerByIdQuery.hook';
|
|
104
110
|
export * from './Asta/Answer/mutate/useAstaAnswersMutateQuery.hook';
|
|
105
111
|
export * from './Asta/Answer/others/finishAstaAnswersQuery.hook';
|
|
106
112
|
export * from './Asta/Answer/others/putAnswerImageQuery.hook';
|