@omniumretail/shared-resources 0.1.95 → 0.1.96

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.
@@ -0,0 +1,2 @@
1
+ import { GetMonths } from "../../../interfaces";
2
+ export declare const getMonthsListQueryHook: () => import("@tanstack/react-query").UseQueryResult<GetMonths[], unknown>;
@@ -0,0 +1,2 @@
1
+ import { GetMonths } from '../../../interfaces';
2
+ export declare const publishMonthsEmployeeHook: () => import("@tanstack/react-query").UseMutationResult<number, unknown, GetMonths, unknown>;
@@ -0,0 +1,2 @@
1
+ import { GetMonths } from '../../../interfaces';
2
+ export declare const publishMonthsManagerHook: () => import("@tanstack/react-query").UseMutationResult<number, unknown, GetMonths, unknown>;
@@ -103,6 +103,9 @@ export * from './Asta/Actions/others/finishActionQuery.hook';
103
103
  export * from './Aprc/get/getPriceChangePinQuery.hook';
104
104
  export * from './Aprc/others/postPriceChangePinQuery.hook';
105
105
  export * from './Aprc/others/sendEmailWithPinQuery.hook';
106
+ export * from './BigWin/get/getMonthsListQuery.hook';
107
+ export * from './BigWin/others/publishMonthsEmployeeQuery.hook';
108
+ export * from './BigWin/others/publishMonthsManagerQuery.hook';
106
109
  export * from './Others/useJobTitlesQuery.hook';
107
110
  export * from './Others/useContractStatesQuery.hook';
108
111
  export * from './Others/useApplicationDataQuery.hook';
@@ -0,0 +1,6 @@
1
+ export interface GetMonths {
2
+ Year: string;
3
+ MonthCode: number;
4
+ PublicationDate: string;
5
+ UserName: string;
6
+ }
@@ -47,3 +47,4 @@ export * from './TimeKeeping';
47
47
  export * from './Employee';
48
48
  export * from './AnswerType';
49
49
  export * from './Actions';
50
+ export * from './GetMonths';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.95",
3
+ "version": "0.1.96",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -0,0 +1,10 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ import { GetMonths } from "../../../interfaces";
3
+ import { getAuth0 } from "../../../services/ApiService";
4
+
5
+ export const getMonthsListQueryHook = () => {
6
+ return useQuery(
7
+ ['MONTHS_LIST_QUERY'],
8
+ () => getAuth0<GetMonths[]>(`/ABWG/BWGEmployees/BackOffice`),
9
+ );
10
+ }
@@ -0,0 +1,17 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { GetMonths } from '../../../interfaces';
3
+ import { postAuth0 } from '../../../services/ApiService';
4
+
5
+ export const publishMonthsEmployeeHook = () => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<number, unknown, GetMonths>((data: GetMonths) => {
8
+ return postAuth0(`/ABWG/BWGEmployees?`, {
9
+ pMonth: data.MonthCode
10
+ }, data);
11
+ }, {
12
+ onSuccess: (data: number) => {
13
+ queryClient.setQueryData(
14
+ ['PUBLISH_MONTH_EMPLOYEE_QUERY'], data);
15
+ },
16
+ });
17
+ }
@@ -0,0 +1,17 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { GetMonths } from '../../../interfaces';
3
+ import { postAuth0 } from '../../../services/ApiService';
4
+
5
+ export const publishMonthsManagerHook = () => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<number, unknown, GetMonths>((data: GetMonths) => {
8
+ return postAuth0(`/ABWG/BWGManager?`, {
9
+ pMonth: data.MonthCode
10
+ }, data);
11
+ }, {
12
+ onSuccess: (data: number) => {
13
+ queryClient.setQueryData(
14
+ ['PUBLISH_MONTH_MANAGER_QUERY'], data);
15
+ },
16
+ });
17
+ }
@@ -135,6 +135,11 @@ export * from './Aprc/get/getPriceChangePinQuery.hook';
135
135
  export * from './Aprc/others/postPriceChangePinQuery.hook';
136
136
  export * from './Aprc/others/sendEmailWithPinQuery.hook';
137
137
 
138
+ //BigWin
139
+ export * from './BigWin/get/getMonthsListQuery.hook';
140
+ export * from './BigWin/others/publishMonthsEmployeeQuery.hook';
141
+ export * from './BigWin/others/publishMonthsManagerQuery.hook';
142
+
138
143
  //Others
139
144
  export * from './Others/useJobTitlesQuery.hook';
140
145
  export * from './Others/useContractStatesQuery.hook';
@@ -0,0 +1,7 @@
1
+
2
+ export interface GetMonths {
3
+ Year: string;
4
+ MonthCode: number;
5
+ PublicationDate: string;
6
+ UserName: string;
7
+ }
@@ -47,3 +47,4 @@ export * from './TimeKeeping';
47
47
  export * from './Employee';
48
48
  export * from './AnswerType';
49
49
  export * from './Actions';
50
+ export * from './GetMonths';