@omniumretail/shared-resources 0.2.39 → 0.2.41
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/Analytics/get/useAnalyticsQuestionsQuery.hook.d.ts +1 -1
- package/dist/types/hooks/WidgetPicaPonto/get/getAttendanceIssuesByIdQuery.hook.d.ts +3 -0
- package/dist/types/hooks/WidgetPicaPonto/get/getAttendanceIssuesQuery.hook.d.ts +11 -0
- package/dist/types/hooks/WidgetPicaPonto/others/postAttendanceIssuesQuery.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +3 -0
- package/dist/types/interfaces/AttendanceIssues.d.ts +16 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/hooks/Analytics/get/useAnalyticsQuestionsQuery.hook.ts +2 -1
- package/src/hooks/WidgetPicaPonto/get/getAttendanceIssuesByIdQuery.hook.ts +15 -0
- package/src/hooks/WidgetPicaPonto/get/getAttendanceIssuesQuery.hook.ts +30 -0
- package/src/hooks/WidgetPicaPonto/others/postAttendanceIssuesQuery.hook.ts +15 -0
- package/src/hooks/index.ts +5 -0
- package/src/interfaces/AttendanceIssues.ts +17 -0
- package/src/interfaces/index.ts +2 -1
|
@@ -6,4 +6,4 @@ export interface AnalyticsQuestionsQuery extends UseQueryOptions<ResponseList<"A
|
|
|
6
6
|
records?: number;
|
|
7
7
|
tags?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const useAnalyticsQuestionsQueryHook: ({ page, records, id, tags }: AnalyticsQuestionsQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Answers", Answer>, unknown>;
|
|
9
|
+
export declare const useAnalyticsQuestionsQueryHook: ({ page, records, id, tags, ...options }: AnalyticsQuestionsQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Answers", Answer>, unknown>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AttendanceIssues } from "../../../interfaces";
|
|
3
|
+
export declare const getAttendanceIssuesByIdQueryHook: (userId: string, options?: UseQueryOptions<AttendanceIssues, Error>) => import("@tanstack/react-query").UseQueryResult<AttendanceIssues, Error>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AttendanceIssues, ResponseList } from "../../../interfaces";
|
|
3
|
+
export interface AttendanceIssuesQueryProps extends UseQueryOptions<ResponseList<"AttendanceIssues", AttendanceIssues>> {
|
|
4
|
+
tags?: string;
|
|
5
|
+
page?: number;
|
|
6
|
+
records?: number;
|
|
7
|
+
sortBy?: string;
|
|
8
|
+
sortDirection?: string;
|
|
9
|
+
query?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getAttendanceIssuesQueryHook: ({ tags, page, records, sortBy, sortDirection, query, ...options }: AttendanceIssuesQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"AttendanceIssues", AttendanceIssues>, unknown>;
|
|
@@ -138,6 +138,9 @@ export * from "./ATIM/PicaPonto/mutate/postAttendance.hook";
|
|
|
138
138
|
export * from "./ATIM/PicaPonto/get/getEmployeesWithTimekeeping.hook";
|
|
139
139
|
export * from "./ATIM/PicaPonto/mutate/postVerifyUserQuery.hook";
|
|
140
140
|
export * from "./ATIM/PicaPonto/mutate/postAttendance.hook";
|
|
141
|
+
export * from "./WidgetPicaPonto/get/getAttendanceIssuesByIdQuery.hook";
|
|
142
|
+
export * from "./WidgetPicaPonto/get/getAttendanceIssuesQuery.hook";
|
|
143
|
+
export * from "./WidgetPicaPonto/others/postAttendanceIssuesQuery.hook";
|
|
141
144
|
export * from "./Asta/Template/get/getTemplateByIdQuery.hook";
|
|
142
145
|
export * from "./Asta/Template/get/getTemplateHeadersQuery.hook";
|
|
143
146
|
export * from "./Asta/Template/get/getTemplateQuery.hook";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AttendanceIssues {
|
|
2
|
+
Id: string;
|
|
3
|
+
EmployeeCode: string;
|
|
4
|
+
EmployeeName: string;
|
|
5
|
+
StoreId: string;
|
|
6
|
+
StoreName: string;
|
|
7
|
+
EntrySchedule: number;
|
|
8
|
+
ExitSchedule: number;
|
|
9
|
+
EntryAttendance: number;
|
|
10
|
+
ExitAttendance: number;
|
|
11
|
+
Description: string;
|
|
12
|
+
Notes: string;
|
|
13
|
+
CreatedBy: string;
|
|
14
|
+
CreateDate: number;
|
|
15
|
+
UpdateDate: number;
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ export interface AnalyticsQuestionsQuery extends UseQueryOptions<ResponseList<"A
|
|
|
9
9
|
tags?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export const useAnalyticsQuestionsQueryHook = ({ page, records, id, tags }: AnalyticsQuestionsQuery) => {
|
|
12
|
+
export const useAnalyticsQuestionsQueryHook = ({ page, records, id, tags, ...options }: AnalyticsQuestionsQuery) => {
|
|
13
13
|
return useQuery(
|
|
14
14
|
['ANALYTICS_QUESTIONS_QUERY', page, records, id, tags],
|
|
15
15
|
() => getAuth0<ResponseList<"Answers", Answer>>(`/APE/Analytics/Questions`, {
|
|
@@ -17,6 +17,7 @@ export const useAnalyticsQuestionsQueryHook = ({ page, records, id, tags }: Anal
|
|
|
17
17
|
pPage: page || 1,
|
|
18
18
|
pRecords: records || 50,
|
|
19
19
|
pTerms: tags,
|
|
20
|
+
...options
|
|
20
21
|
}),
|
|
21
22
|
);
|
|
22
23
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AttendanceIssues } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export const getAttendanceIssuesByIdQueryHook = (userId: string, options?: UseQueryOptions<AttendanceIssues, Error>) => {
|
|
6
|
+
return useQuery(
|
|
7
|
+
['ATTENDANCE_ISSUES_ID_QUERY', userId],
|
|
8
|
+
() => getAuth0<AttendanceIssues>(`/ATIM/AttendanceIssues/${userId}`),
|
|
9
|
+
{
|
|
10
|
+
enabled: !!(userId),
|
|
11
|
+
...options,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
import { AttendanceIssues, ResponseList } from "../../../interfaces";
|
|
3
|
+
import { getAuth0 } from "../../../services/ApiService";
|
|
4
|
+
|
|
5
|
+
export interface AttendanceIssuesQueryProps extends UseQueryOptions<ResponseList<"AttendanceIssues", AttendanceIssues>> {
|
|
6
|
+
tags?: string;
|
|
7
|
+
page?: number;
|
|
8
|
+
records?: number;
|
|
9
|
+
sortBy?: string;
|
|
10
|
+
sortDirection?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getAttendanceIssuesQueryHook = ({ tags, page, records, sortBy, sortDirection, query, ...options }: AttendanceIssuesQueryProps) => {
|
|
15
|
+
return useQuery(
|
|
16
|
+
['ATTENDANCE_ISSUES_QUERY', tags, page, records, sortBy, sortDirection, query],
|
|
17
|
+
() => getAuth0<ResponseList<"AttendanceIssues", AttendanceIssues>>('/ATIM/AttendanceIssues', {
|
|
18
|
+
pPage: page || 1,
|
|
19
|
+
pRecords: records || 50,
|
|
20
|
+
pSortBy: sortBy || 'CreateDate',
|
|
21
|
+
pSortDirection: sortDirection || 'asc',
|
|
22
|
+
pTerms: tags,
|
|
23
|
+
pQuery: query
|
|
24
|
+
}),
|
|
25
|
+
{
|
|
26
|
+
keepPreviousData: true,
|
|
27
|
+
...options
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { AttendanceIssues } from '../../../interfaces';
|
|
3
|
+
import { postAuth0 } from '../../../services/ApiService';
|
|
4
|
+
|
|
5
|
+
export const postAttendanceIssuesQueryHook = () => {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation<AttendanceIssues, unknown, AttendanceIssues>((data: AttendanceIssues) => {
|
|
8
|
+
return postAuth0(`/ATIM/AttendanceIssues?`, undefined, data);
|
|
9
|
+
}, {
|
|
10
|
+
onSuccess: (data: AttendanceIssues) => {
|
|
11
|
+
queryClient.setQueryData(
|
|
12
|
+
['ATTENDANCE_ISSUES_QUERY'], data);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
package/src/hooks/index.ts
CHANGED
|
@@ -164,6 +164,11 @@ export * from "./ATIM/PicaPonto/get/getEmployeesWithTimekeeping.hook";
|
|
|
164
164
|
export * from "./ATIM/PicaPonto/mutate/postVerifyUserQuery.hook";
|
|
165
165
|
export * from "./ATIM/PicaPonto/mutate/postAttendance.hook";
|
|
166
166
|
|
|
167
|
+
//WIDGET
|
|
168
|
+
export * from "./WidgetPicaPonto/get/getAttendanceIssuesByIdQuery.hook";
|
|
169
|
+
export * from "./WidgetPicaPonto/get/getAttendanceIssuesQuery.hook";
|
|
170
|
+
export * from "./WidgetPicaPonto/others/postAttendanceIssuesQuery.hook";
|
|
171
|
+
|
|
167
172
|
//ASTA
|
|
168
173
|
export * from "./Asta/Template/get/getTemplateByIdQuery.hook";
|
|
169
174
|
export * from "./Asta/Template/get/getTemplateHeadersQuery.hook";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface AttendanceIssues {
|
|
2
|
+
Id: string;
|
|
3
|
+
EmployeeCode: string;
|
|
4
|
+
EmployeeName: string;
|
|
5
|
+
StoreId: string;
|
|
6
|
+
StoreName: string;
|
|
7
|
+
EntrySchedule: number;
|
|
8
|
+
ExitSchedule: number;
|
|
9
|
+
EntryAttendance: number;
|
|
10
|
+
ExitAttendance: number;
|
|
11
|
+
Description: string;
|
|
12
|
+
Notes: string;
|
|
13
|
+
CreatedBy: string;
|
|
14
|
+
CreateDate: number;
|
|
15
|
+
UpdateDate: number
|
|
16
|
+
}
|
|
17
|
+
|
package/src/interfaces/index.ts
CHANGED