@omniumretail/shared-resources 0.3.25 → 0.3.26

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,6 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { TransferDocumentState } from '../../../../interfaces/TransferDocumentState';
3
+ export interface FinishPackageASTTQueryProps extends UseQueryOptions<TransferDocumentState> {
4
+ transferDocumentId: string;
5
+ }
6
+ export declare const finishPackageASTTQuery: ({ transferDocumentId }: FinishPackageASTTQueryProps) => import("@tanstack/react-query").UseMutationResult<TransferDocumentState, unknown, TransferDocumentState, unknown>;
@@ -0,0 +1,6 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { TransferPackage } from '../../../../interfaces/TransferPackage';
3
+ export interface MissingProductsProps extends UseQueryOptions<TransferPackage> {
4
+ transferDocumentId: string;
5
+ }
6
+ export declare const postMissingProductsQuery: ({ transferDocumentId }: MissingProductsProps) => import("@tanstack/react-query").UseMutationResult<TransferPackage, unknown, void, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.25",
3
+ "version": "0.3.26",
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,21 @@
1
+ import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { TransferDocumentState } from '../../../../interfaces/TransferDocumentState';
3
+ import { putAuth0 } from '../../../../services/ApiService';
4
+
5
+ export interface FinishPackageASTTQueryProps extends UseQueryOptions<TransferDocumentState> {
6
+ transferDocumentId: string;
7
+ }
8
+
9
+ export const finishPackageASTTQuery= ({ transferDocumentId }: FinishPackageASTTQueryProps) => {
10
+ const queryClient = useQueryClient();
11
+ return useMutation<TransferDocumentState, unknown, TransferDocumentState>((data: TransferDocumentState) => {
12
+ return putAuth0(`/ASTT/TransferDocuments/StockTaking/Finish?`, {
13
+ pTransferDocumentId: transferDocumentId
14
+ }, data);
15
+ }, {
16
+ onSuccess: (data: TransferDocumentState) => {
17
+ queryClient.setQueryData(
18
+ ['FINISH_PACKAGE_ASTT_QUERY'], data);
19
+ },
20
+ });
21
+ }
@@ -0,0 +1,21 @@
1
+ import { useMutation, useQueryClient, UseQueryOptions } from '@tanstack/react-query';
2
+ import { postAuth0 } from '../../../../services/ApiService';
3
+ import { TransferPackage } from '../../../../interfaces/TransferPackage';
4
+
5
+ export interface MissingProductsProps extends UseQueryOptions<TransferPackage> {
6
+ transferDocumentId: string;
7
+ }
8
+
9
+ export const postMissingProductsQuery = ({ transferDocumentId }: MissingProductsProps) => {
10
+ const queryClient = useQueryClient();
11
+ return useMutation<TransferPackage, unknown>((data) => {
12
+ return postAuth0(`/ASTT/TransferDocuments/Packages/MissingProducts?`, {
13
+ pTransferDocumentId: transferDocumentId,
14
+ }, data);
15
+ }, {
16
+ onSuccess: (data: TransferPackage) => {
17
+ queryClient.setQueryData(
18
+ ['ASTT_MISSING_PRODUCTS_QUERY'], data);
19
+ },
20
+ });
21
+ }