@omniumretail/shared-resources 0.2.78 → 0.2.79

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,8 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { VacationPlan } from "../../../../interfaces";
3
+ interface RejectVacationPlanProps extends UseQueryOptions<VacationPlan> {
4
+ userId: string;
5
+ vacationPlan: string;
6
+ }
7
+ export declare const rejectVacationPlanQueryHook: ({ vacationPlan, userId }: RejectVacationPlanProps) => import("@tanstack/react-query").UseMutationResult<VacationPlan, unknown, VacationPlan, unknown>;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface ChangePasswordProps {
2
+ userId: string;
3
+ password: string;
4
+ }
5
+ export declare const changePasswordQueryHook: ({ userId, password }: ChangePasswordProps) => import("@tanstack/react-query").UseMutationResult<boolean, unknown, void, unknown>;
@@ -0,0 +1 @@
1
+ export declare const unblockUserQueryHook: (userId: string) => import("@tanstack/react-query").UseMutationResult<boolean, unknown, void, unknown>;
@@ -328,3 +328,6 @@ export * from "./Others/editBellNotificationsStatusQuery.hook";
328
328
  export * from "./Others/Vacation/get/getVacationPlanQuery.hook";
329
329
  export * from "./Others/Vacation/others/aproveVacationPlanQuery.hook";
330
330
  export * from "./Others/Vacation/others/postVacationPlanQuery.hook";
331
+ export * from "./Others/Vacation/others/rejectVacationPlanQuery.hook";
332
+ export * from "./Others/changePasswordQuery.hook";
333
+ export * from "./Others/unblockUserQuery.hook";
@@ -1,3 +1,4 @@
1
+ import { VacationPlan } from "./VacationPlan";
1
2
  export interface User {
2
3
  UserId: string;
3
4
  DisplayName: string;
@@ -19,6 +20,7 @@ export interface User {
19
20
  ImageURL: string;
20
21
  Image: string;
21
22
  AcceptsTermsAndConditions: boolean;
23
+ VacationPlans: VacationPlan[];
22
24
  }
23
25
  interface JobTitle {
24
26
  Id: string;
@@ -5,6 +5,7 @@ export interface VacationPlan {
5
5
  State: string;
6
6
  Year: string;
7
7
  ApprovedBy: string;
8
+ ReviewedBy: string;
8
9
  CreateDate: number;
9
10
  UpdateDate: boolean;
10
11
  VacationPlan: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.78",
3
+ "version": "0.2.79",
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,23 @@
1
+ import { useMutation, useQueryClient, UseQueryOptions } from "@tanstack/react-query";
2
+ import { VacationPlan } from "../../../../interfaces";
3
+ import { putAuth0 } from "../../../../services/ApiService";
4
+
5
+ interface RejectVacationPlanProps extends UseQueryOptions<VacationPlan> {
6
+ userId: string;
7
+ vacationPlan: string;
8
+ }
9
+
10
+ export const rejectVacationPlanQueryHook = ({ vacationPlan, userId }: RejectVacationPlanProps) => {
11
+ const queryClient = useQueryClient();
12
+ return useMutation<VacationPlan, unknown, VacationPlan>((data: VacationPlan) => {
13
+ return putAuth0(`/AACP/UserVacationPlans/${vacationPlan}/Reject?`, {
14
+ pUserId: userId
15
+ }, data);
16
+ }, {
17
+ onSuccess: (data: VacationPlan) => {
18
+ queryClient.setQueryData(
19
+ ['REJECT_VACATION_PLAN_QUERY'], data);
20
+ },
21
+ });
22
+ }
23
+
@@ -0,0 +1,21 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { putAuth0 } from "../../services/ApiService";
3
+
4
+ export interface ChangePasswordProps {
5
+ userId: string;
6
+ password: string;
7
+ }
8
+
9
+ export const changePasswordQueryHook = ({ userId, password }: ChangePasswordProps) => {
10
+ const queryClient = useQueryClient();
11
+ return useMutation<boolean, unknown>(() => {
12
+ return putAuth0(`/AACP/Users/${userId}/changePassword?`, {
13
+ pPassword: password
14
+ });
15
+ }, {
16
+ onSuccess: (data) => {
17
+ queryClient.setQueryData(
18
+ ['CHANGE_PASSWORD_QUERY'], data);
19
+ },
20
+ });
21
+ }
@@ -0,0 +1,14 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { postAuth0 } from "../../services/ApiService";
3
+
4
+ export const unblockUserQueryHook = (userId: string) => {
5
+ const queryClient = useQueryClient();
6
+ return useMutation<boolean, unknown>(() => {
7
+ return postAuth0(`/AACP/Users/${userId}/unblock`, undefined);
8
+ }, {
9
+ onSuccess: (data) => {
10
+ queryClient.setQueryData(
11
+ ['UNBLOCK_USER_QUERY'], data);
12
+ },
13
+ });
14
+ }
@@ -393,3 +393,6 @@ export * from "./Others/editBellNotificationsStatusQuery.hook";
393
393
  export * from "./Others/Vacation/get/getVacationPlanQuery.hook";
394
394
  export * from "./Others/Vacation/others/aproveVacationPlanQuery.hook";
395
395
  export * from "./Others/Vacation/others/postVacationPlanQuery.hook";
396
+ export * from "./Others/Vacation/others/rejectVacationPlanQuery.hook";
397
+ export * from "./Others/changePasswordQuery.hook";
398
+ export * from "./Others/unblockUserQuery.hook";
@@ -1,3 +1,4 @@
1
+ import { VacationPlan } from "./VacationPlan";
1
2
 
2
3
  export interface User {
3
4
  UserId: string;
@@ -20,6 +21,7 @@ export interface User {
20
21
  ImageURL: string;
21
22
  Image: string;
22
23
  AcceptsTermsAndConditions: boolean;
24
+ VacationPlans: VacationPlan[];
23
25
  }
24
26
 
25
27
  interface JobTitle {
@@ -5,6 +5,7 @@ export interface VacationPlan {
5
5
  State: string;
6
6
  Year: string;
7
7
  ApprovedBy: string;
8
+ ReviewedBy: string;
8
9
  CreateDate: number;
9
10
  UpdateDate: boolean;
10
11
  VacationPlan: any;