@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.
- package/dist/bundle.js +1 -1
- package/dist/types/hooks/ASAEGNG/get/getCustomerHistoryQuery.hook.d.ts +2 -2
- package/dist/types/hooks/ASAEGNG/get/getCustomerVouchersQuery.hook.d.ts +2 -2
- package/dist/types/hooks/Watson/mutate/mutateNotificationRequest.hook.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/interfaces/Watson.d.ts +20 -0
- package/package.json +1 -1
- package/src/hooks/ASAEGNG/get/getCustomerHistoryQuery.hook.ts +2 -2
- package/src/hooks/ASAEGNG/get/getCustomerVouchersQuery.hook.ts +2 -2
- package/src/hooks/Watson/mutate/mutateNotificationRequest.hook.ts +18 -0
- package/src/hooks/index.ts +1 -0
- package/src/interfaces/Watson.ts +25 -1
|
@@ -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<"
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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 {};
|
|
@@ -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
|
@@ -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<"
|
|
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<"
|
|
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<"
|
|
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<"
|
|
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
|
+
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -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";
|
package/src/interfaces/Watson.ts
CHANGED
|
@@ -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
|
+
}
|