@omniumretail/shared-resources 0.3.49 → 0.3.51

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
- import { CustomerHistory } from "../../../interfaces";
3
- interface CustomerHistoryProps extends Omit<UseQueryOptions<CustomerHistory>, "queryKey"> {
2
+ import { CustomerHistory, ResponseList } from "../../../interfaces";
3
+ interface CustomerHistoryProps extends Omit<UseQueryOptions<ResponseList<"Histories", 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<CustomerHistory, unknown>;
9
+ export declare const getCustomerHistoryQueryHook: (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerHistoryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Histories", CustomerHistory>, unknown>;
10
10
  export {};
@@ -1,10 +1,10 @@
1
1
  import { UseQueryOptions } from "@tanstack/react-query";
2
- import { CustomerVoucher } from "../../../interfaces";
3
- interface CustomerVoucherProps extends Omit<UseQueryOptions<CustomerVoucher>, "queryKey"> {
2
+ import { CustomerVoucher, ResponseList } from "../../../interfaces";
3
+ interface CustomerVoucherProps extends Omit<UseQueryOptions<ResponseList<"Histories", 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<CustomerVoucher, unknown>;
9
+ export declare const getCustomerVouchersQueryHook: (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerVoucherProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Histories", CustomerVoucher>, unknown>;
10
10
  export {};
@@ -0,0 +1,2 @@
1
+ import { TransferDocumentManual, TransferDocumentsDetails } from '../../../interfaces/TransferDocuments';
2
+ export declare const postManualTransferQueryHook: (bodyType?: string) => import("@tanstack/react-query").UseMutationResult<TransferDocumentsDetails, unknown, TransferDocumentManual, unknown>;
@@ -136,6 +136,7 @@ export * from "./Astt/get/getBarcodesPrintQuery.hook";
136
136
  export * from "./Astt/get/getBarcodesListingQuery.hook";
137
137
  export * from "./Astt/get/getBarcodesListingByPackageQuery.hook";
138
138
  export * from "./Astt/mutate/postMatchingPackageQuery.hook";
139
+ export * from "./Astt/mutate/postManualTransferQuery.hook";
139
140
  export * from "./Astt/Asgt/get/getTransferDocumentsASTTQuery.hook";
140
141
  export * from "./Astt/Asgt/get/getTransferDocumentsByIdASTTQuery.hook";
141
142
  export * from "./Astt/Asgt/get/getTransferDocumentsByPackageASTTQuery.hook";
@@ -46,3 +46,10 @@ export interface ProductMovement {
46
46
  Movement: number;
47
47
  VendusId: string;
48
48
  }
49
+ export interface TransferDocumentManual {
50
+ TransferDocumentId: string;
51
+ DocumentNumber: string;
52
+ LocationCode: string;
53
+ Image: any;
54
+ UserId: string;
55
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.49",
3
+ "version": "0.3.51",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -1,8 +1,8 @@
1
1
  import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
- import { CustomerHistory } from "../../../interfaces";
2
+ import { CustomerHistory, ResponseList } from "../../../interfaces";
3
3
  import { get } from "../../../services/ApiService";
4
4
 
5
- interface CustomerHistoryProps extends Omit<UseQueryOptions<CustomerHistory>, "queryKey"> {
5
+ interface CustomerHistoryProps extends Omit<UseQueryOptions<ResponseList<"Histories", CustomerHistory>>, "queryKey"> {
6
6
  page: number;
7
7
  records: number;
8
8
  sortBy: string;
@@ -12,7 +12,7 @@ interface CustomerHistoryProps extends Omit<UseQueryOptions<CustomerHistory>, "q
12
12
  export const getCustomerHistoryQueryHook = (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerHistoryProps) => {
13
13
  return useQuery(
14
14
  ['CUSTOMER_HISTORY_QUERY', customerId, options],
15
- () => get<CustomerHistory>(`/GNG/Salesforce/CustomerHistories/${customerId}`,
15
+ () => get<ResponseList<"Histories", CustomerHistory>>(`/GNG/Salesforce/CustomerHistories/${customerId}`,
16
16
  options
17
17
  ));
18
18
  }
@@ -1,8 +1,8 @@
1
1
  import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
- import { CustomerVoucher } from "../../../interfaces";
2
+ import { CustomerVoucher, ResponseList } from "../../../interfaces";
3
3
  import { get } from "../../../services/ApiService";
4
4
 
5
- interface CustomerVoucherProps extends Omit<UseQueryOptions<CustomerVoucher>, "queryKey"> {
5
+ interface CustomerVoucherProps extends Omit<UseQueryOptions<ResponseList<"Histories", CustomerVoucher>>, "queryKey"> {
6
6
  page: number;
7
7
  records: number;
8
8
  sortBy: string;
@@ -12,7 +12,7 @@ interface CustomerVoucherProps extends Omit<UseQueryOptions<CustomerVoucher>, "q
12
12
  export const getCustomerVouchersQueryHook = (customerId: string, { page, records, sortBy, sortDirection, ...options }: CustomerVoucherProps) => {
13
13
  return useQuery(
14
14
  ['CUSTOMER_VOUCHERS_QUERY', customerId, options],
15
- () => get<CustomerVoucher>(`/GNG/Salesforce/CustomerVouchers/${customerId}`,
15
+ () => get<ResponseList<"Histories", CustomerVoucher>>(`/GNG/Salesforce/CustomerVouchers/${customerId}`,
16
16
  options
17
17
  ));
18
18
  }
@@ -0,0 +1,16 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { TransferDocumentManual, TransferDocumentsDetails } from '../../../interfaces/TransferDocuments';
3
+ import { postAuth0 } from '../../../services/ApiService';
4
+
5
+ export const postManualTransferQueryHook = (bodyType?: string) => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<TransferDocumentsDetails, unknown, TransferDocumentManual>((data: any) => {
8
+ return postAuth0(`/ASTT/TransferDocuments/Manual`, undefined, data, bodyType);
9
+ }, {
10
+ onSuccess: (data: TransferDocumentsDetails) => {
11
+ queryClient.setQueryData(
12
+ ['MANUAL_TRANSFER_QUERY'], data);
13
+ },
14
+ });
15
+ }
16
+
@@ -159,6 +159,7 @@ export * from "./Astt/get/getBarcodesPrintQuery.hook";
159
159
  export * from "./Astt/get/getBarcodesListingQuery.hook";
160
160
  export * from "./Astt/get/getBarcodesListingByPackageQuery.hook";
161
161
  export * from "./Astt/mutate/postMatchingPackageQuery.hook";
162
+ export * from "./Astt/mutate/postManualTransferQuery.hook";
162
163
 
163
164
  //Astt Asgt
164
165
  export * from "./Astt/Asgt/get/getTransferDocumentsASTTQuery.hook";
@@ -42,7 +42,7 @@ export interface TransferDocument {
42
42
  export interface ProductMovement {
43
43
  DocNr: string;
44
44
  TypeOfDocument: string;
45
- Date: string;
45
+ Date: string;
46
46
  Store: string;
47
47
  StoreFrom: string;
48
48
  ProductTitle: string;
@@ -50,6 +50,13 @@ export interface ProductMovement {
50
50
  Movement: number;
51
51
  VendusId: string;
52
52
  }
53
-
54
-
55
-
53
+
54
+ export interface TransferDocumentManual {
55
+ TransferDocumentId: string;
56
+ DocumentNumber: string;
57
+ LocationCode: string;
58
+ Image: any;
59
+ UserId: string;
60
+ }
61
+
62
+