@omniumretail/shared-resources 0.1.48 → 0.1.49

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.
Files changed (30) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/hooks/Astt/get/getTransferAllProductsQuery.hook.d.ts +10 -0
  3. package/dist/types/hooks/Astt/get/getTransferDocumentsByIdQuery.hook.d.ts +3 -0
  4. package/dist/types/hooks/Astt/get/getTransferDocumentsByPackageQuery.hook.d.ts +3 -0
  5. package/dist/types/hooks/Astt/get/getTransferDocumentsPackagesQuery.hook.d.ts +9 -0
  6. package/dist/types/hooks/Astt/get/getTransferDocumentsQuery.hook.d.ts +11 -0
  7. package/dist/types/hooks/Astt/get/getTransferReportDiff.hook.d.ts +9 -0
  8. package/dist/types/hooks/Astt/get/getTransferStatesQuery.hook.d.ts +2 -0
  9. package/dist/types/hooks/Astt/mutate/postTransferDocumentsMutateQuery.hook.d.ts +7 -0
  10. package/dist/types/hooks/Astt/mutate/putTransferDocumentsStateMutateQuery.hook.d.ts +6 -0
  11. package/dist/types/hooks/index.d.ts +9 -6
  12. package/dist/types/interfaces/TransferAllProducts.d.ts +36 -0
  13. package/dist/types/interfaces/TransferDocumentState.d.ts +4 -0
  14. package/dist/types/interfaces/TransferPickProducts.d.ts +18 -0
  15. package/dist/types/interfaces/index.d.ts +2 -0
  16. package/package.json +1 -1
  17. package/src/hooks/Astt/get/getTransferAllProductsQuery.hook.ts +27 -0
  18. package/src/hooks/Astt/{getTransferDocumentsByIdQuery.hook.ts → get/getTransferDocumentsByIdQuery.hook.ts} +1 -1
  19. package/src/hooks/Astt/{getTransferDocumentsByPackageQuery.hook.ts → get/getTransferDocumentsByPackageQuery.hook.ts} +1 -1
  20. package/src/hooks/Astt/{getTransferDocumentsPackagesQuery.hook.ts → get/getTransferDocumentsPackagesQuery.hook.ts} +2 -2
  21. package/src/hooks/Astt/{getTransferDocumentsQuery.hook.ts → get/getTransferDocumentsQuery.hook.ts} +2 -2
  22. package/src/hooks/Astt/{getTransferReportDiff.hook.ts → get/getTransferReportDiff.hook.ts} +2 -2
  23. package/src/hooks/Astt/{getTransferStatesQuery.hook.ts → get/getTransferStatesQuery.hook.ts} +2 -2
  24. package/src/hooks/Astt/mutate/postTransferDocumentsMutateQuery.hook.ts +20 -0
  25. package/src/hooks/Astt/mutate/putTransferDocumentsStateMutateQuery.hook.ts +19 -0
  26. package/src/hooks/index.ts +9 -6
  27. package/src/interfaces/TransferAllProducts.ts +39 -0
  28. package/src/interfaces/TransferDocumentState.ts +5 -0
  29. package/src/interfaces/TransferPickProducts.ts +21 -0
  30. package/src/interfaces/index.ts +2 -0
@@ -0,0 +1,10 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { TransferAllProducts, ResponseList } from "../../../interfaces";
3
+ export interface TransferAllProductsProps extends UseQueryOptions<ResponseList<"Products", TransferAllProducts>> {
4
+ page: number;
5
+ records: number;
6
+ sortBy: string;
7
+ sortDirection: string;
8
+ query?: string;
9
+ }
10
+ export declare const getTransferAllProductsQueryHook: ({ page, records, sortBy, sortDirection, query }: TransferAllProductsProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Products", TransferAllProducts>, unknown>;
@@ -0,0 +1,3 @@
1
+ import { TransferDocuments } from '../../..';
2
+ import { UseQueryOptions } from '@tanstack/react-query';
3
+ export declare const getTransferDocumentsByIdQueryHook: (transferId: string, { ...options }: UseQueryOptions<TransferDocuments>) => import("@tanstack/react-query").UseQueryResult<TransferDocuments, unknown>;
@@ -0,0 +1,3 @@
1
+ import { TransferPackage } from '../../..';
2
+ import { UseQueryOptions } from '@tanstack/react-query';
3
+ export declare const getTransferDocumentsByPackageQueryHook: (transferId: string, transferPackageId: string, { ...options }: UseQueryOptions<TransferPackage>) => import("@tanstack/react-query").UseQueryResult<TransferPackage, unknown>;
@@ -0,0 +1,9 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { TransferDocumentsDetails, ResponseList } from "../../../interfaces";
3
+ export interface TransferDocumentsPackagesProps extends UseQueryOptions<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>> {
4
+ sortBy?: string;
5
+ sortDirection?: string;
6
+ terms?: string;
7
+ transferDocumentId?: string;
8
+ }
9
+ export declare const getTransferDocumentsPackagesQueryHook: ({ sortBy, sortDirection, terms, transferDocumentId }: TransferDocumentsPackagesProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>, unknown>;
@@ -0,0 +1,11 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { TransferDocuments, ResponseList } from "../../../interfaces";
3
+ export interface TransferDocumentsProps extends UseQueryOptions<ResponseList<"TransferDocuments", TransferDocuments>> {
4
+ page: number;
5
+ records: number;
6
+ sortBy: string;
7
+ sortDirection: string;
8
+ terms?: string;
9
+ query?: string;
10
+ }
11
+ export declare const getTransferDocumentsQueryHook: ({ page, records, sortBy, sortDirection, terms, query }: TransferDocumentsProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"TransferDocuments", TransferDocuments>, unknown>;
@@ -0,0 +1,9 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { TransferReportDiff, ResponseList } from "../../../interfaces";
3
+ export interface TransferReportDiffProps extends UseQueryOptions<ResponseList<"ProductsToBePicked", TransferReportDiff>> {
4
+ transferDocumentId?: string;
5
+ }
6
+ export declare const getTransferReportDiffQueryHook: ({ transferDocumentId }: TransferReportDiffProps) => import("@tanstack/react-query").UseQueryResult<{
7
+ ProductsToBePicked: TransferReportDiff[];
8
+ FalsePositiveProducts?: TransferReportDiff[];
9
+ }, unknown>;
@@ -0,0 +1,2 @@
1
+ import { TransferStates } from "../../../interfaces";
2
+ export declare const getTransfeStatesQueryHook: () => import("@tanstack/react-query").UseQueryResult<TransferStates[], unknown>;
@@ -0,0 +1,7 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { TransferPickProducts } from '../../../interfaces/TransferPickProducts';
3
+ export interface TransferDocumentsMutateProps extends UseQueryOptions<TransferPickProducts> {
4
+ transferDocumentId: string;
5
+ packageId: string;
6
+ }
7
+ export declare const postTransferDocumentsMutateQueryHook: ({ transferDocumentId, packageId }: TransferDocumentsMutateProps) => import("@tanstack/react-query").UseMutationResult<TransferPickProducts, unknown, TransferPickProducts, unknown>;
@@ -0,0 +1,6 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { TransferDocumentState } from '../../../interfaces/TransferDocumentState';
3
+ export interface TransferDocumentsStateMutateProps extends UseQueryOptions<TransferDocumentState> {
4
+ transferDocumentId: string;
5
+ }
6
+ export declare const putTransferDocumentsStateMutateQueryHook: ({ transferDocumentId }: TransferDocumentsStateMutateProps) => import("@tanstack/react-query").UseMutationResult<TransferDocumentState, unknown, TransferDocumentState, unknown>;
@@ -43,12 +43,15 @@ export * from './Roles/get/useAllRolesQuery.hook';
43
43
  export * from './AsvProduct/get/getProductsByRefQuery.hook';
44
44
  export * from './AsvProduct/get/getProductsByStoreQuery.hook';
45
45
  export * from './AsvProduct/get/getProductsStockDetailsQuery.hook';
46
- export * from './Astt/getTransferDocumentsQuery.hook';
47
- export * from './Astt/getTransferDocumentsByIdQuery.hook';
48
- export * from './Astt/getTransferDocumentsByPackageQuery.hook';
49
- export * from './Astt/getTransferStatesQuery.hook';
50
- export * from './Astt/getTransferDocumentsPackagesQuery.hook';
51
- export * from './Astt/getTransferReportDiff.hook';
46
+ export * from './Astt/get/getTransferDocumentsQuery.hook';
47
+ export * from './Astt/get/getTransferDocumentsByIdQuery.hook';
48
+ export * from './Astt/get/getTransferDocumentsByPackageQuery.hook';
49
+ export * from './Astt/get/getTransferStatesQuery.hook';
50
+ export * from './Astt/get/getTransferDocumentsPackagesQuery.hook';
51
+ export * from './Astt/get/getTransferReportDiff.hook';
52
+ export * from './Astt/get/getTransferAllProductsQuery.hook';
53
+ export * from './Astt/mutate/postTransferDocumentsMutateQuery.hook';
54
+ export * from './Astt/mutate/putTransferDocumentsStateMutateQuery.hook';
52
55
  export * from './Others/useJobTitlesQuery.hook';
53
56
  export * from './Others/useContractStatesQuery.hook';
54
57
  export * from './Others/useApplicationDataQuery.hook';
@@ -0,0 +1,36 @@
1
+ export interface TransferAllProducts {
2
+ Id: string;
3
+ Reference: string;
4
+ CompanyId: string;
5
+ Name: string;
6
+ Price: number;
7
+ PriceSRP: number;
8
+ PriceCost: number;
9
+ VATId: string;
10
+ HierarchyId: string;
11
+ SupplierId: string;
12
+ IsStockCountEnabled: boolean;
13
+ IsNewArrival: boolean;
14
+ Status: string;
15
+ CreateDate: number;
16
+ UpdateDate: number;
17
+ Recommendations: [];
18
+ SimilarProducts: [];
19
+ Images: [];
20
+ Attributes: TransferAllProductsAtribues[];
21
+ Items: TransferAllProductsItems[];
22
+ }
23
+ export interface TransferAllProductsAtribues {
24
+ Name: string;
25
+ Value: string;
26
+ }
27
+ export interface TransferAllProductsItems {
28
+ SKU: string;
29
+ Barcodes: string[];
30
+ Rank: number;
31
+ Price: number;
32
+ PriceSRP: number;
33
+ PriceCost: number;
34
+ Attributes: TransferAllProductsAtribues[];
35
+ Options: TransferAllProductsAtribues[];
36
+ }
@@ -0,0 +1,4 @@
1
+ export interface TransferDocumentState {
2
+ TransferStateId: string;
3
+ Notes: string;
4
+ }
@@ -0,0 +1,18 @@
1
+ export interface TransferPickProducts {
2
+ PickedProducts: TransferPickProductsList[];
3
+ ProductsNotListed: TransferPickProductsNotListed[];
4
+ }
5
+ export interface TransferPickProductsList {
6
+ Barcode: string;
7
+ PickedQuantity: number;
8
+ PickedMethod: string;
9
+ }
10
+ export interface TransferPickProductsNotListed {
11
+ ProductName: string;
12
+ Reference: string;
13
+ SKU: string;
14
+ Barcode: string;
15
+ Custom1: string;
16
+ Notes: string;
17
+ PickedMethod: string;
18
+ }
@@ -35,3 +35,5 @@ export * from './TransferStates';
35
35
  export * from './UserEmailStatus';
36
36
  export * from './PriceChange';
37
37
  export * from './TransferReportDiff';
38
+ export * from './TransferAllProducts';
39
+ export * from './TransferDocumentState';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
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,27 @@
1
+ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
+ import { TransferAllProducts, ResponseList } from "../../../interfaces";
3
+ import { get } from "../../../services/ApiService";
4
+
5
+ export interface TransferAllProductsProps extends UseQueryOptions<ResponseList<"Products", TransferAllProducts>> {
6
+ page: number;
7
+ records: number;
8
+ sortBy: string;
9
+ sortDirection: string;
10
+ query?: string;
11
+ }
12
+
13
+ export const getTransferAllProductsQueryHook = ({ page, records, sortBy, sortDirection, query }: TransferAllProductsProps) => {
14
+ return useQuery(
15
+ ['ASTT_TRANSFER_ALL_PRODUCTS', page, records, sortBy, sortDirection, query],
16
+ () => get<ResponseList<"Products", TransferAllProducts>>('/Product/Products', {
17
+ pPage: page|| 1,
18
+ pRecords: records || 50,
19
+ pSortBy: sortBy || "Name",
20
+ pSortDirection: sortDirection || "asc",
21
+ pQuery: query
22
+ }),
23
+ {
24
+ keepPreviousData: true,
25
+ }
26
+ );
27
+ }
@@ -1,4 +1,4 @@
1
- import { get, TransferDocuments } from '../../';
1
+ import { get, TransferDocuments } from '../../..';
2
2
  import { useQuery, UseQueryOptions } from '@tanstack/react-query';
3
3
 
4
4
  export const getTransferDocumentsByIdQueryHook = (transferId: string, {...options} : UseQueryOptions<TransferDocuments>) => {
@@ -1,4 +1,4 @@
1
- import { get, TransferPackage } from '../../';
1
+ import { get, TransferPackage } from '../../..';
2
2
  import { useQuery, UseQueryOptions } from '@tanstack/react-query';
3
3
 
4
4
  export const getTransferDocumentsByPackageQueryHook = (transferId: string, transferPackageId: string, {...options} : UseQueryOptions<TransferPackage>) => {
@@ -1,6 +1,6 @@
1
1
  import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
- import { TransferDocumentsDetails, ResponseList } from "../../interfaces";
3
- import { get } from "../../services/ApiService";
2
+ import { TransferDocumentsDetails, ResponseList } from "../../../interfaces";
3
+ import { get } from "../../../services/ApiService";
4
4
 
5
5
  export interface TransferDocumentsPackagesProps extends UseQueryOptions<ResponseList<"TransferDocumentDetails", TransferDocumentsDetails>> {
6
6
  sortBy?: string;
@@ -1,6 +1,6 @@
1
1
  import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
- import { TransferDocuments, ResponseList } from "../../interfaces";
3
- import { get } from "../../services/ApiService";
2
+ import { TransferDocuments, ResponseList } from "../../../interfaces";
3
+ import { get } from "../../../services/ApiService";
4
4
 
5
5
  export interface TransferDocumentsProps extends UseQueryOptions<ResponseList<"TransferDocuments", TransferDocuments>> {
6
6
  page: number;
@@ -1,6 +1,6 @@
1
1
  import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
- import { TransferReportDiff, ResponseList } from "../../interfaces";
3
- import { get } from "../../services/ApiService";
2
+ import { TransferReportDiff, ResponseList } from "../../../interfaces";
3
+ import { get } from "../../../services/ApiService";
4
4
 
5
5
  export interface TransferReportDiffProps extends UseQueryOptions<ResponseList<"ProductsToBePicked", TransferReportDiff>> {
6
6
  transferDocumentId?: string;
@@ -1,6 +1,6 @@
1
1
  import { useQuery } from "@tanstack/react-query";
2
- import { TransferStates } from "../../interfaces";
3
- import { get } from "../../services/ApiService";
2
+ import { TransferStates } from "../../../interfaces";
3
+ import { get } from "../../../services/ApiService";
4
4
 
5
5
  export const getTransfeStatesQueryHook = () => {
6
6
  return useQuery(
@@ -0,0 +1,20 @@
1
+ import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { TransferPickProducts } from '../../../interfaces/TransferPickProducts';
3
+ import { post } from '../../../services/ApiService';
4
+
5
+ export interface TransferDocumentsMutateProps extends UseQueryOptions<TransferPickProducts> {
6
+ transferDocumentId: string;
7
+ packageId: string;
8
+ }
9
+
10
+ export const postTransferDocumentsMutateQueryHook = ({ transferDocumentId, packageId }: TransferDocumentsMutateProps) => {
11
+ const queryClient = useQueryClient();
12
+ return useMutation<TransferPickProducts, unknown, TransferPickProducts>((data: TransferPickProducts) => {
13
+ return post(`/ASTT/TransferDocuments/${transferDocumentId}/${packageId}/Products/Picking`, data);
14
+ }, {
15
+ onSuccess: (data: TransferPickProducts) => {
16
+ queryClient.setQueryData(
17
+ ['TRANSFER_PICKED_PRODUCTS_QUERY'], data);
18
+ },
19
+ });
20
+ }
@@ -0,0 +1,19 @@
1
+ import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { TransferDocumentState } from '../../../interfaces/TransferDocumentState';
3
+ import { put } from '../../../services/ApiService';
4
+
5
+ export interface TransferDocumentsStateMutateProps extends UseQueryOptions<TransferDocumentState> {
6
+ transferDocumentId: string;
7
+ }
8
+
9
+ export const putTransferDocumentsStateMutateQueryHook = ({ transferDocumentId }: TransferDocumentsStateMutateProps) => {
10
+ const queryClient = useQueryClient();
11
+ return useMutation<TransferDocumentState, unknown, TransferDocumentState>((data: TransferDocumentState) => {
12
+ return put(`/ASTT/TransferDocuments/${transferDocumentId}`, data);
13
+ }, {
14
+ onSuccess: (data: TransferDocumentState) => {
15
+ queryClient.setQueryData(
16
+ ['TRANSFER_PACKAGE_STATE_QUERY'], data);
17
+ },
18
+ });
19
+ }
@@ -62,12 +62,15 @@ export * from './AsvProduct/get/getProductsByStoreQuery.hook';
62
62
  export * from './AsvProduct/get/getProductsStockDetailsQuery.hook';
63
63
 
64
64
  //Astt
65
- export * from './Astt/getTransferDocumentsQuery.hook';
66
- export * from './Astt/getTransferDocumentsByIdQuery.hook';
67
- export * from './Astt/getTransferDocumentsByPackageQuery.hook';
68
- export * from './Astt/getTransferStatesQuery.hook';
69
- export * from './Astt/getTransferDocumentsPackagesQuery.hook';
70
- export * from './Astt/getTransferReportDiff.hook';
65
+ export * from './Astt/get/getTransferDocumentsQuery.hook';
66
+ export * from './Astt/get/getTransferDocumentsByIdQuery.hook';
67
+ export * from './Astt/get/getTransferDocumentsByPackageQuery.hook';
68
+ export * from './Astt/get/getTransferStatesQuery.hook';
69
+ export * from './Astt/get/getTransferDocumentsPackagesQuery.hook';
70
+ export * from './Astt/get/getTransferReportDiff.hook';
71
+ export * from './Astt/get/getTransferAllProductsQuery.hook';
72
+ export * from './Astt/mutate/postTransferDocumentsMutateQuery.hook';
73
+ export * from './Astt/mutate/putTransferDocumentsStateMutateQuery.hook';
71
74
 
72
75
  //Others
73
76
  export * from './Others/useJobTitlesQuery.hook';
@@ -0,0 +1,39 @@
1
+
2
+ export interface TransferAllProducts {
3
+ Id: string;
4
+ Reference: string;
5
+ CompanyId: string;
6
+ Name: string;
7
+ Price: number;
8
+ PriceSRP: number;
9
+ PriceCost: number;
10
+ VATId: string;
11
+ HierarchyId: string;
12
+ SupplierId: string;
13
+ IsStockCountEnabled: boolean;
14
+ IsNewArrival: boolean;
15
+ Status: string;
16
+ CreateDate: number;
17
+ UpdateDate: number;
18
+ Recommendations: [];
19
+ SimilarProducts: [];
20
+ Images: [];
21
+ Attributes: TransferAllProductsAtribues[];
22
+ Items: TransferAllProductsItems[];
23
+ }
24
+
25
+ export interface TransferAllProductsAtribues {
26
+ Name: string;
27
+ Value: string;
28
+ }
29
+
30
+ export interface TransferAllProductsItems {
31
+ SKU: string;
32
+ Barcodes: string[];
33
+ Rank: number;
34
+ Price: number;
35
+ PriceSRP: number;
36
+ PriceCost: number;
37
+ Attributes: TransferAllProductsAtribues[];
38
+ Options: TransferAllProductsAtribues[];
39
+ }
@@ -0,0 +1,5 @@
1
+
2
+ export interface TransferDocumentState {
3
+ TransferStateId: string;
4
+ Notes: string;
5
+ }
@@ -0,0 +1,21 @@
1
+
2
+ export interface TransferPickProducts {
3
+ PickedProducts: TransferPickProductsList[];
4
+ ProductsNotListed: TransferPickProductsNotListed[];
5
+ }
6
+
7
+ export interface TransferPickProductsList {
8
+ Barcode: string;
9
+ PickedQuantity: number;
10
+ PickedMethod: string;
11
+ }
12
+
13
+ export interface TransferPickProductsNotListed {
14
+ ProductName: string;
15
+ Reference: string;
16
+ SKU: string;
17
+ Barcode: string;
18
+ Custom1: string;
19
+ Notes: string;
20
+ PickedMethod: string;
21
+ }
@@ -35,3 +35,5 @@ export * from './TransferStates';
35
35
  export * from './UserEmailStatus';
36
36
  export * from './PriceChange';
37
37
  export * from './TransferReportDiff';
38
+ export * from './TransferAllProducts';
39
+ export * from './TransferDocumentState';