@omniumretail/shared-resources 0.2.25 → 0.2.27
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/ATIM/BackOffice/get/useEmployeeQueryHook.hook.d.ts +11 -0
- package/dist/types/hooks/ATIM/BackOffice/get/useEmployeeWorklogDetails.hook.d.ts +14 -0
- package/dist/types/hooks/Asta/Actions/others/selectActionStatusQuery.hook.d.ts +2 -0
- package/dist/types/hooks/Asta/AnswerType/others/selectAnswerNameQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +4 -1
- package/dist/types/interfaces/Actions.d.ts +1 -0
- package/dist/types/interfaces/AnswerType.d.ts +1 -0
- package/dist/types/interfaces/BackofficeAtim.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/ATIM/BackOffice/get/useEmployeeQueryHook.hook.ts +30 -0
- package/src/hooks/ATIM/BackOffice/get/{useEmployeeTimekeepingDetails.hook.ts → useEmployeeWorklogDetails.hook.ts} +12 -9
- package/src/hooks/Asta/Actions/others/selectActionStatusQuery.hook.ts +18 -0
- package/src/hooks/Asta/AnswerType/others/selectAnswerNameQuery.hook.ts +18 -0
- package/src/hooks/index.ts +4 -1
- package/src/interfaces/Actions.ts +1 -0
- package/src/interfaces/AnswerType.ts +1 -0
- package/src/interfaces/BackofficeAtim.ts +2 -5
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { ResponseList, UserBackoffice } from '../../../../interfaces';
|
|
3
|
+
interface EmployeeQueryOptions extends UseQueryOptions<ResponseList<'Users', UserBackoffice>> {
|
|
4
|
+
query?: string;
|
|
5
|
+
page?: number;
|
|
6
|
+
records?: number;
|
|
7
|
+
sortBy?: string;
|
|
8
|
+
sortDirection?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const useEmployeeQueryHook: ({ query, page, records, sortBy, sortDirection, ...options }: EmployeeQueryOptions) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Users", UserBackoffice>, unknown>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { ResponseList, EmployeesWorklog } from '../../../../interfaces';
|
|
3
|
+
interface EmployeesWithTimekeepingProps extends UseQueryOptions<ResponseList<"EmployeesWorkLog", EmployeesWorklog>> {
|
|
4
|
+
storeId?: string;
|
|
5
|
+
startDate?: number;
|
|
6
|
+
endDate?: number;
|
|
7
|
+
search?: string;
|
|
8
|
+
page?: number;
|
|
9
|
+
records?: number;
|
|
10
|
+
sortBy?: string;
|
|
11
|
+
sortDirection?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const useEmployeeWorklogDetails: ({ storeId, startDate, endDate, search, page, records, sortBy, sortDirection, ...options }: EmployeesWithTimekeepingProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"EmployeesWorklog", EmployeesWorklog>, unknown>;
|
|
14
|
+
export {};
|
|
@@ -96,6 +96,7 @@ export * from './Asta/AnswerType/mutate/useAnswerTypeMutateQuery.hook';
|
|
|
96
96
|
export * from './Asta/AnswerType/mutate/useAnswerTypeMutateQuery.hook';
|
|
97
97
|
export * from './Asta/AnswerType/others/deleteAnswerTypeQuery.hook';
|
|
98
98
|
export * from './Asta/AnswerType/others/finishAnswerTypeQuery.hook';
|
|
99
|
+
export * from './Asta/AnswerType/others/selectAnswerNameQuery.hook';
|
|
99
100
|
export * from './Asta/Actions/get/getActionByIdQuery.hook';
|
|
100
101
|
export * from './Asta/Actions/get/getActionStagesQuery.hook';
|
|
101
102
|
export * from './Asta/Actions/get/getActionPriorityQuery.hook';
|
|
@@ -106,6 +107,7 @@ export * from './Asta/Actions/others/extractActionQuery.hook';
|
|
|
106
107
|
export * from './Asta/Actions/others/archiveActionQuery.hook';
|
|
107
108
|
export * from './Asta/Actions/others/finishActionQuery.hook';
|
|
108
109
|
export * from './Asta/Actions/others/startActionQuery.hook';
|
|
110
|
+
export * from './Asta/Actions/others/selectActionStatusQuery.hook';
|
|
109
111
|
export * from './Aprc/get/getPriceChangePinQuery.hook';
|
|
110
112
|
export * from './Aprc/others/postPriceChangePinQuery.hook';
|
|
111
113
|
export * from './Aprc/others/sendEmailWithPinQuery.hook';
|
|
@@ -120,7 +122,8 @@ export * from './OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook';
|
|
|
120
122
|
export * from './OSUA/mutate/postCreateIntegrationRequest.hook';
|
|
121
123
|
export * from './ACB/get/getClientBalance.hook';
|
|
122
124
|
export * from './ACB/mutate/postClientBalance.hook';
|
|
123
|
-
export * from './ATIM/BackOffice/get/
|
|
125
|
+
export * from './ATIM/BackOffice/get/useEmployeeWorklogDetails.hook';
|
|
126
|
+
export * from './ATIM/BackOffice/get/useEmployeeQueryHook.hook';
|
|
124
127
|
export * from './ATIM/BackOffice/get/useStoresQueryHook.hook';
|
|
125
128
|
export * from './ATIM/BackOffice/mutate/postAttendanceRange.hook';
|
|
126
129
|
export * from './Others/useJobTitlesQuery.hook';
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { getAuth0 } from '../../../../services/ApiService';
|
|
3
|
+
import { Store, ResponseList, UserBackoffice } from '../../../../interfaces';
|
|
4
|
+
|
|
5
|
+
interface EmployeeQueryOptions extends UseQueryOptions<ResponseList<'Users', UserBackoffice >> {
|
|
6
|
+
query?: string;
|
|
7
|
+
page?: number;
|
|
8
|
+
records?: number;
|
|
9
|
+
sortBy?: string;
|
|
10
|
+
sortDirection?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const useEmployeeQueryHook = ({ query, page, records, sortBy, sortDirection, ...options }: EmployeeQueryOptions) => {
|
|
14
|
+
return useQuery<ResponseList<'Users', UserBackoffice >>(
|
|
15
|
+
['EMPLOYEES_QUERY', query, page, records, sortBy, sortDirection],
|
|
16
|
+
() =>
|
|
17
|
+
getAuth0('/AACP/Users', {
|
|
18
|
+
pPage: page,
|
|
19
|
+
pRecords: records,
|
|
20
|
+
pSortBy: sortBy,
|
|
21
|
+
pSortDirection: sortDirection,
|
|
22
|
+
pQuery: query ,
|
|
23
|
+
}),
|
|
24
|
+
{
|
|
25
|
+
|
|
26
|
+
...options
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery , UseQueryOptions} from '@tanstack/react-query';
|
|
2
2
|
import { getDateToUnix } from "../../../../helpers/date-unix.helper";
|
|
3
|
-
import { getAuth0
|
|
3
|
+
import { get, getAuth0} from "../../../../services/ApiService";
|
|
4
4
|
import { ResponseList, EmployeesWorklog } from '../../../../interfaces';
|
|
5
5
|
|
|
6
6
|
|
|
@@ -13,26 +13,29 @@ interface EmployeesWithTimekeepingProps extends UseQueryOptions<ResponseList<"Em
|
|
|
13
13
|
records?: number;
|
|
14
14
|
sortBy?: string;
|
|
15
15
|
sortDirection?: string;
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
|
|
17
18
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
export const
|
|
21
|
-
return useQuery(
|
|
21
|
+
export const useEmployeeWorklogDetails = ({storeId, startDate, endDate, search, page, records, sortBy, sortDirection, ...options}: EmployeesWithTimekeepingProps) => {
|
|
22
|
+
return useQuery<ResponseList<"EmployeesWorklog", EmployeesWorklog>>(
|
|
22
23
|
['EMPLOYEES_WITH_TIMEKEEPING', storeId, startDate, endDate, search, page, records, sortBy, sortDirection],
|
|
23
24
|
() => getAuth0<ResponseList<"EmployeesWorklog", EmployeesWorklog>>('/ATIM/EmployeesWorklogDetails', {
|
|
24
25
|
pStoreId: storeId,
|
|
25
|
-
pStartDate: startDate || getDateToUnix(new Date()),
|
|
26
|
-
pEndDate: endDate || getDateToUnix(new Date()),
|
|
27
|
-
pEmployeeId: employeeId,
|
|
28
26
|
pPage: page || 1,
|
|
29
27
|
pRecords: records,
|
|
28
|
+
pStartDate: startDate || getDateToUnix(new Date()),
|
|
29
|
+
pEndDate: endDate || getDateToUnix(new Date()),
|
|
30
30
|
pSortBy: sortBy,
|
|
31
31
|
pSortDirection: sortDirection,
|
|
32
|
-
|
|
32
|
+
pDisplayName: search,
|
|
33
|
+
|
|
33
34
|
}),
|
|
34
35
|
{
|
|
35
|
-
|
|
36
|
+
suspense: false,
|
|
37
|
+
enabled: (!!storeId && !!startDate && !!endDate),
|
|
38
|
+
|
|
36
39
|
}
|
|
37
40
|
);
|
|
38
41
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { Actions } from '../../../../interfaces';
|
|
3
|
+
import { putAuth0 } from '../../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const selectActionStatusQueryHook = () => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<Actions, unknown, Actions>((data: Actions) => {
|
|
8
|
+
return putAuth0(`/ASTA/Actions/SelectStatus?`, {
|
|
9
|
+
pActionId: data.Id,
|
|
10
|
+
pStatus: data.Stage
|
|
11
|
+
}, data);
|
|
12
|
+
}, {
|
|
13
|
+
onSuccess: (data: Actions) => {
|
|
14
|
+
queryClient.setQueryData(
|
|
15
|
+
['ACTION_STATUS_ID_QUERY'], data);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { AnswerType } from '../../../../interfaces';
|
|
3
|
+
import { putAuth0 } from '../../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const selectAnswerNameQueryHook = () => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<AnswerType, unknown, AnswerType>((data: AnswerType) => {
|
|
8
|
+
return putAuth0(`/ASTA/AnswerType/SelectName?`, {
|
|
9
|
+
pAnswerTypeId: data.Id,
|
|
10
|
+
pUseName: data.UseName
|
|
11
|
+
}, data);
|
|
12
|
+
}, {
|
|
13
|
+
onSuccess: (data: AnswerType) => {
|
|
14
|
+
queryClient.setQueryData(
|
|
15
|
+
['ANSWER_NAME_ID_QUERY'], data);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -126,6 +126,7 @@ export * from './Asta/AnswerType/mutate/useAnswerTypeMutateQuery.hook';
|
|
|
126
126
|
export * from './Asta/AnswerType/mutate/useAnswerTypeMutateQuery.hook';
|
|
127
127
|
export * from './Asta/AnswerType/others/deleteAnswerTypeQuery.hook';
|
|
128
128
|
export * from './Asta/AnswerType/others/finishAnswerTypeQuery.hook';
|
|
129
|
+
export * from './Asta/AnswerType/others/selectAnswerNameQuery.hook';
|
|
129
130
|
|
|
130
131
|
export * from './Asta/Actions/get/getActionByIdQuery.hook';
|
|
131
132
|
export * from './Asta/Actions/get/getActionStagesQuery.hook';
|
|
@@ -137,6 +138,7 @@ export * from './Asta/Actions/others/extractActionQuery.hook';
|
|
|
137
138
|
export * from './Asta/Actions/others/archiveActionQuery.hook';
|
|
138
139
|
export * from './Asta/Actions/others/finishActionQuery.hook';
|
|
139
140
|
export * from './Asta/Actions/others/startActionQuery.hook';
|
|
141
|
+
export * from './Asta/Actions/others/selectActionStatusQuery.hook';
|
|
140
142
|
|
|
141
143
|
//APRC
|
|
142
144
|
export * from './Aprc/get/getPriceChangePinQuery.hook';
|
|
@@ -161,7 +163,8 @@ export * from './ACB/get/getClientBalance.hook';
|
|
|
161
163
|
export * from './ACB/mutate/postClientBalance.hook';
|
|
162
164
|
|
|
163
165
|
//BackofficeAtim
|
|
164
|
-
export * from './ATIM/BackOffice/get/
|
|
166
|
+
export * from './ATIM/BackOffice/get/useEmployeeWorklogDetails.hook';
|
|
167
|
+
export * from './ATIM/BackOffice/get/useEmployeeQueryHook.hook';
|
|
165
168
|
export * from './ATIM/BackOffice/get/useStoresQueryHook.hook';
|
|
166
169
|
export * from './ATIM/BackOffice/mutate/postAttendanceRange.hook';
|
|
167
170
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { Store } from './Store';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
1
|
export interface WorkLogDetail {
|
|
6
2
|
Id: string;
|
|
7
3
|
Type: number;
|
|
@@ -29,6 +25,7 @@ export interface EmployeesWorklog {
|
|
|
29
25
|
TimeWorked: number;
|
|
30
26
|
Breaks: Breaks;
|
|
31
27
|
WorkDayLogs: WorkDayLog[];
|
|
28
|
+
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
|
|
@@ -43,6 +40,6 @@ export interface Location {
|
|
|
43
40
|
export interface UserBackoffice {
|
|
44
41
|
UserId: string;
|
|
45
42
|
FullName: string;
|
|
43
|
+
DisplayName: string;
|
|
46
44
|
|
|
47
|
-
|
|
48
45
|
}
|