@omniumretail/shared-resources 0.3.46 → 0.3.47

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,10 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { CustomerHistory } from "../../../interfaces";
3
+ interface CustomerHistoryProps extends Omit<UseQueryOptions<CustomerHistory>, "queryKey"> {
4
+ page: number;
5
+ records: number;
6
+ sortBy: string;
7
+ sortDirection: string;
8
+ }
9
+ export declare const getCustomerHistoryQueryHook: (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerHistoryProps) => import("@tanstack/react-query").UseQueryResult<CustomerHistory, unknown>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { CustomerVoucher } from "../../../interfaces";
3
+ interface CustomerVoucherProps extends Omit<UseQueryOptions<CustomerVoucher>, "queryKey"> {
4
+ page: number;
5
+ records: number;
6
+ sortBy: string;
7
+ sortDirection: string;
8
+ }
9
+ export declare const getCustomerVouchersQueryHook: (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerVoucherProps) => import("@tanstack/react-query").UseQueryResult<CustomerVoucher, unknown>;
10
+ export {};
@@ -407,3 +407,5 @@ export * from "./Others/Vacation/get/getVacationTemplateQuery.hook";
407
407
  export * from "./Others/changePasswordQuery.hook";
408
408
  export * from "./Others/unblockUserQuery.hook";
409
409
  export * from "./Others/oneSignalUserQuery.hook";
410
+ export * from "./ASAEGNG/get/getCustomerHistoryQuery.hook";
411
+ export * from "./ASAEGNG/get/getCustomerVouchersQuery.hook";
@@ -0,0 +1,9 @@
1
+ export interface CustomerHistory {
2
+ CustomerId: number;
3
+ Coins: number;
4
+ Type: string;
5
+ ActivityDescription: string;
6
+ ActivityDate: number;
7
+ CreateDate: number;
8
+ UpdateDate: number;
9
+ }
@@ -0,0 +1,11 @@
1
+ export interface CustomerVoucher {
2
+ CustomerId: number;
3
+ VoucherId: string;
4
+ BeginDate: number;
5
+ EndDate: number;
6
+ Value: number;
7
+ DiscountType: string;
8
+ Status: string;
9
+ CreateDate: number;
10
+ UpdateDate: number;
11
+ }
@@ -74,3 +74,5 @@ export * from './FlowList';
74
74
  export * from './FlowExecution';
75
75
  export * from './Watson';
76
76
  export * from './TagsFlow';
77
+ export * from './CustomerHistory';
78
+ export * from './CustomerVoucher';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.46",
3
+ "version": "0.3.47",
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,19 @@
1
+ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
+ import { CustomerHistory } from "../../../interfaces";
3
+ import { get } from "../../../services/ApiService";
4
+
5
+ interface CustomerHistoryProps extends Omit<UseQueryOptions<CustomerHistory>, "queryKey"> {
6
+ page: number;
7
+ records: number;
8
+ sortBy: string;
9
+ sortDirection: string;
10
+ }
11
+
12
+ export const getCustomerHistoryQueryHook = (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerHistoryProps) => {
13
+ return useQuery(
14
+ ['CUSTOMER_HISTORY_QUERY', customerId, options],
15
+ () => get<CustomerHistory>(`/GNG/Salesforce/CustomerHistories/${customerId}`,
16
+ options
17
+ ));
18
+ }
19
+
@@ -0,0 +1,19 @@
1
+ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
+ import { CustomerVoucher } from "../../../interfaces";
3
+ import { get } from "../../../services/ApiService";
4
+
5
+ interface CustomerVoucherProps extends Omit<UseQueryOptions<CustomerVoucher>, "queryKey"> {
6
+ page: number;
7
+ records: number;
8
+ sortBy: string;
9
+ sortDirection: string;
10
+ }
11
+
12
+ export const getCustomerVouchersQueryHook = (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerVoucherProps) => {
13
+ return useQuery(
14
+ ['CUSTOMER_VOUCHERS_QUERY', customerId, options],
15
+ () => get<CustomerVoucher>(`/GNG/Salesforce/CustomerVouchers/${customerId}`,
16
+ options
17
+ ));
18
+ }
19
+
@@ -474,3 +474,8 @@ export * from "./Others/Vacation/get/getVacationTemplateQuery.hook";
474
474
  export * from "./Others/changePasswordQuery.hook";
475
475
  export * from "./Others/unblockUserQuery.hook";
476
476
  export * from "./Others/oneSignalUserQuery.hook";
477
+
478
+
479
+ //ASAEGNG
480
+ export * from "./ASAEGNG/get/getCustomerHistoryQuery.hook";
481
+ export * from "./ASAEGNG/get/getCustomerVouchersQuery.hook";
@@ -0,0 +1,9 @@
1
+ export interface CustomerHistory {
2
+ CustomerId: number;
3
+ Coins: number;
4
+ Type: string;
5
+ ActivityDescription: string;
6
+ ActivityDate: number;
7
+ CreateDate: number;
8
+ UpdateDate: number;
9
+ }
@@ -0,0 +1,11 @@
1
+ export interface CustomerVoucher{
2
+ CustomerId: number;
3
+ VoucherId: string;
4
+ BeginDate: number;
5
+ EndDate: number;
6
+ Value: number;
7
+ DiscountType: string;
8
+ Status: string;
9
+ CreateDate: number;
10
+ UpdateDate: number;
11
+ }
@@ -73,4 +73,6 @@ export * from './MonitoringComponent';
73
73
  export * from './FlowList';
74
74
  export * from './FlowExecution';
75
75
  export * from './Watson';
76
- export * from './TagsFlow';
76
+ export * from './TagsFlow';
77
+ export * from './CustomerHistory';
78
+ export * from './CustomerVoucher';