@omniumretail/shared-resources 0.3.52 → 0.3.54

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.
@@ -1,10 +1,10 @@
1
1
  import { UseQueryOptions } from "@tanstack/react-query";
2
2
  import { CustomerHistory, ResponseList } from "../../../interfaces";
3
- interface CustomerHistoryProps extends Omit<UseQueryOptions<ResponseList<"Histories", CustomerHistory>>, "queryKey"> {
3
+ interface CustomerHistoryProps extends Omit<UseQueryOptions<ResponseList<"CustomerHistories", CustomerHistory>>, "queryKey"> {
4
4
  page: number;
5
5
  records: number;
6
6
  sortBy: string;
7
7
  sortDirection: string;
8
8
  }
9
- export declare const getCustomerHistoryQueryHook: (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerHistoryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Histories", CustomerHistory>, unknown>;
9
+ export declare const getCustomerHistoryQueryHook: (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerHistoryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"CustomerHistories", CustomerHistory>, unknown>;
10
10
  export {};
@@ -1,10 +1,10 @@
1
1
  import { UseQueryOptions } from "@tanstack/react-query";
2
2
  import { CustomerVoucher, ResponseList } from "../../../interfaces";
3
- interface CustomerVoucherProps extends Omit<UseQueryOptions<ResponseList<"Vouchers", CustomerVoucher>>, "queryKey"> {
3
+ interface CustomerVoucherProps extends Omit<UseQueryOptions<ResponseList<"CustomerVouchers", CustomerVoucher>>, "queryKey"> {
4
4
  page: number;
5
5
  records: number;
6
6
  sortBy: string;
7
7
  sortDirection: string;
8
8
  }
9
- export declare const getCustomerVouchersQueryHook: (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerVoucherProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Vouchers", CustomerVoucher>, unknown>;
9
+ export declare const getCustomerVouchersQueryHook: (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerVoucherProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"CustomerVouchers", CustomerVoucher>, unknown>;
10
10
  export {};
@@ -0,0 +1,2 @@
1
+ import { NotificationRequestPayload, NotificationRequestResponse } from '../../../interfaces';
2
+ export declare const mutateNotificationRequest: () => import("@tanstack/react-query").UseMutationResult<NotificationRequestResponse, unknown, NotificationRequestPayload, unknown>;
@@ -349,6 +349,7 @@ export * from './Orch/get/getMonitoringComponents.hook';
349
349
  export * from './Orch/others/stopInstanceQuery.hook';
350
350
  export * from "./Watson/get/getCloseSession.hook";
351
351
  export * from "./Watson/mutate/mutateCloseSession.hook";
352
+ export * from "./Watson/mutate/mutateNotificationRequest.hook";
352
353
  export * from "./ATIM/BackOffice/get/useEmployeeWorklogDetails.hook";
353
354
  export * from "./ATIM/BackOffice/get/useEmployeeQueryHook.hook";
354
355
  export * from "./ATIM/BackOffice/get/useStoresQueryHook.hook";
@@ -47,3 +47,23 @@ export interface Recommendation {
47
47
  images_url: string[];
48
48
  product_name: string;
49
49
  }
50
+ export interface NotificationItem {
51
+ index: number;
52
+ type: 'text' | 'audio';
53
+ message: string;
54
+ }
55
+ export interface NotificationRequestPayload {
56
+ client_email: string;
57
+ limit_date: string;
58
+ origin_store: string;
59
+ reception_store?: string;
60
+ notifications: NotificationItem[];
61
+ }
62
+ export interface NotificationRequestStatus {
63
+ index: number;
64
+ status: 'success' | 'error';
65
+ message: string;
66
+ }
67
+ export interface NotificationRequestResponse {
68
+ notification_requests_status: NotificationRequestStatus[];
69
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.52",
3
+ "version": "0.3.54",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
2
  import { CustomerHistory, ResponseList } from "../../../interfaces";
3
3
  import { get } from "../../../services/ApiService";
4
4
 
5
- interface CustomerHistoryProps extends Omit<UseQueryOptions<ResponseList<"Histories", CustomerHistory>>, "queryKey"> {
5
+ interface CustomerHistoryProps extends Omit<UseQueryOptions<ResponseList<"CustomerHistories", CustomerHistory>>, "queryKey"> {
6
6
  page: number;
7
7
  records: number;
8
8
  sortBy: string;
@@ -12,7 +12,7 @@ interface CustomerHistoryProps extends Omit<UseQueryOptions<ResponseList<"Histor
12
12
  export const getCustomerHistoryQueryHook = (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerHistoryProps) => {
13
13
  return useQuery(
14
14
  ['CUSTOMER_HISTORY_QUERY', customerId, page, records, sortBy, sortDirection, options],
15
- () => get<ResponseList<"Histories", CustomerHistory>>(`/GNG/Salesforce/CustomerHistories/${customerId}`, {
15
+ () => get<ResponseList<"CustomerHistories", CustomerHistory>>(`/GNG/Salesforce/CustomerHistories/${customerId}`, {
16
16
  pPage: page,
17
17
  pRecords: records,
18
18
  pSortBy: sortBy,
@@ -2,7 +2,7 @@ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
2
  import { CustomerVoucher, ResponseList } from "../../../interfaces";
3
3
  import { get } from "../../../services/ApiService";
4
4
 
5
- interface CustomerVoucherProps extends Omit<UseQueryOptions<ResponseList<"Vouchers", CustomerVoucher>>, "queryKey"> {
5
+ interface CustomerVoucherProps extends Omit<UseQueryOptions<ResponseList<"CustomerVouchers", CustomerVoucher>>, "queryKey"> {
6
6
  page: number;
7
7
  records: number;
8
8
  sortBy: string;
@@ -12,7 +12,7 @@ interface CustomerVoucherProps extends Omit<UseQueryOptions<ResponseList<"Vouche
12
12
  export const getCustomerVouchersQueryHook = (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerVoucherProps) => {
13
13
  return useQuery(
14
14
  ['CUSTOMER_VOUCHERS_QUERY', page, records, sortBy, sortDirection, customerId, options],
15
- () => get<ResponseList<"Vouchers", CustomerVoucher>>(`/GNG/Salesforce/CustomerVouchers/${customerId}`, {
15
+ () => get<ResponseList<"CustomerVouchers", CustomerVoucher>>(`/GNG/Salesforce/CustomerVouchers/${customerId}`, {
16
16
  pPage: page,
17
17
  pRecords: records,
18
18
  pSortBy: sortBy,
@@ -0,0 +1,18 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { NotificationRequestPayload, NotificationRequestResponse } from '../../../interfaces';
3
+ import { post } from '../../../services/ApiService';
4
+
5
+ export const mutateNotificationRequest = () => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<NotificationRequestResponse, unknown, NotificationRequestPayload>(
8
+ (data: NotificationRequestPayload) => {
9
+ return post('/notification_requests', data);
10
+ },
11
+ {
12
+ onSuccess: (data: NotificationRequestResponse) => {
13
+ queryClient.setQueryData(['NOTIFICATION_REQUESTS'], data);
14
+
15
+ },
16
+ }
17
+ );
18
+ };
@@ -408,6 +408,7 @@ export * from './Orch/others/stopInstanceQuery.hook';
408
408
  //Watson
409
409
  export * from "./Watson/get/getCloseSession.hook";
410
410
  export * from "./Watson/mutate/mutateCloseSession.hook";
411
+ export * from "./Watson/mutate/mutateNotificationRequest.hook";
411
412
 
412
413
  //BackofficeAtim
413
414
  export * from "./ATIM/BackOffice/get/useEmployeeWorklogDetails.hook";
@@ -49,4 +49,28 @@ export interface Recommendation {
49
49
  liked_recommendation: boolean;
50
50
  images_url: string[];
51
51
  product_name: string;
52
- }
52
+ }
53
+
54
+ export interface NotificationItem {
55
+ index: number;
56
+ type: 'text' | 'audio';
57
+ message: string;
58
+ }
59
+
60
+ export interface NotificationRequestPayload {
61
+ client_email: string;
62
+ limit_date: string;
63
+ origin_store: string;
64
+ reception_store?: string;
65
+ notifications: NotificationItem[];
66
+ }
67
+
68
+ export interface NotificationRequestStatus {
69
+ index: number;
70
+ status: 'success' | 'error';
71
+ message: string;
72
+ }
73
+
74
+ export interface NotificationRequestResponse {
75
+ notification_requests_status: NotificationRequestStatus[];
76
+ }