@omniumretail/shared-resources 0.2.23 → 0.2.25

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,2 @@
1
+ import { HeadersInterface } from "../../../../interfaces";
2
+ export declare const getActionStageQueryHook: () => import("@tanstack/react-query").UseQueryResult<HeadersInterface[], unknown>;
@@ -0,0 +1,8 @@
1
+ import { AstsStock } from "../../../interfaces";
2
+ export declare const getProductInfoQueryHook: (barcode: string) => import("@tanstack/react-query").UseQueryResult<{
3
+ Product: AstsStock;
4
+ ProductList: AstsStock[];
5
+ Color: string[];
6
+ Size: string[];
7
+ Size2: string[];
8
+ }, unknown>;
@@ -1,15 +1,7 @@
1
1
  import { UseQueryOptions } from "@tanstack/react-query";
2
- import { AstsStock, ResponseList } from "../../../interfaces";
3
- export interface StockQueryProps extends UseQueryOptions<ResponseList<"", AstsStock>> {
4
- page?: number;
5
- records?: number;
6
- sortBy?: string;
7
- sortDirection?: string;
8
- storeCode?: string;
9
- size?: string;
10
- color?: string;
2
+ import { AstsStockInfo } from "../../../interfaces";
3
+ export interface StockQueryProps extends UseQueryOptions<AstsStockInfo[]> {
11
4
  reference?: string;
12
- userId?: string;
13
- barcode?: string;
5
+ countryId?: string;
14
6
  }
15
- export declare const getStockQueryHook: ({ page, records, sortBy, sortDirection, storeCode, size, color, reference, userId, barcode }: StockQueryProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"", AstsStock>, unknown>;
7
+ export declare const getStockQueryHook: ({ reference, countryId }: StockQueryProps) => import("@tanstack/react-query").UseQueryResult<AstsStockInfo[], unknown>;
@@ -51,7 +51,7 @@ export * from './AsvProduct/get/getProductsStockDetailsQuery.hook';
51
51
  export * from './Ass/get/getAssProductsByRefQuery.hook';
52
52
  export * from './Ass/get/getAssProductsByStoreQuery.hook';
53
53
  export * from './Ass/get/getAssProductsStockDetailsQuery.hook';
54
- export * from './Asts/get/getStockInfoQuery.hook';
54
+ export * from './Asts/get/getProductInfoQuery.hook';
55
55
  export * from './Asts/get/getStockQuery.hook';
56
56
  export * from './Astt/get/getTransferDocumentsQuery.hook';
57
57
  export * from './Astt/get/getTransferDocumentsByIdQuery.hook';
@@ -97,6 +97,7 @@ export * from './Asta/AnswerType/mutate/useAnswerTypeMutateQuery.hook';
97
97
  export * from './Asta/AnswerType/others/deleteAnswerTypeQuery.hook';
98
98
  export * from './Asta/AnswerType/others/finishAnswerTypeQuery.hook';
99
99
  export * from './Asta/Actions/get/getActionByIdQuery.hook';
100
+ export * from './Asta/Actions/get/getActionStagesQuery.hook';
100
101
  export * from './Asta/Actions/get/getActionPriorityQuery.hook';
101
102
  export * from './Asta/Actions/get/getActionQuery.hook';
102
103
  export * from './Asta/Actions/mutate/useActionMutateQuery.hook';
@@ -1,14 +1,16 @@
1
1
  export interface AstsStock {
2
- StoreCode: number;
2
+ Id: string;
3
+ ParentName: string;
4
+ ParentDescription: string;
3
5
  Name: string;
4
6
  Description: string;
7
+ Barcode: string;
5
8
  Reference: string;
6
- Ean: string;
7
- Image: string;
9
+ InternalReference: string;
10
+ Sku: string;
8
11
  Size: string;
9
- StockQty: number;
10
- LegSize: string;
11
- StockOnlineQty: number;
12
12
  Color: string;
13
- StoreName: string;
13
+ Image: string;
14
+ Price: number;
15
+ Company: string;
14
16
  }
@@ -1,5 +1,12 @@
1
1
  export interface AstsStockInfo {
2
- Stores: string[];
3
- Sizes: string[];
4
- Colors: string[];
2
+ StoreCode: string;
3
+ Stocks: StockInterface[];
4
+ }
5
+ export interface StockInterface {
6
+ SKU: string;
7
+ Values: {
8
+ ValueStore: string;
9
+ ValueOnline: string;
10
+ ValueWarehouse: string;
11
+ };
5
12
  }
@@ -26,4 +26,5 @@ export interface HeadersInterface {
26
26
  Id: string;
27
27
  Name: string;
28
28
  Value: string;
29
+ Color: string;
29
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
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,10 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ import { HeadersInterface } from "../../../../interfaces";
3
+ import { getAuth0 } from "../../../../services/ApiService";
4
+
5
+ export const getActionStageQueryHook = () => {
6
+ return useQuery(
7
+ ['ACTION_STAGES_QUERY'],
8
+ () => getAuth0<HeadersInterface[]>(`/ASTA/Actions/ActionsStatus`),
9
+ );
10
+ }
@@ -0,0 +1,15 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ import { AstsStock } from "../../../interfaces";
3
+ import { getAuth0 } from "../../../services/ApiService";
4
+
5
+ export const getProductInfoQueryHook = (barcode: string) => {
6
+ return useQuery(
7
+ ['ASTS_PRODUCT_INFO_QUERY', barcode],
8
+ () => getAuth0<{ Product: AstsStock, ProductList: AstsStock[], Color: string[], Size: string[], Size2: string[] }>(`/ASTS/Product`, {
9
+ pBarcode: barcode
10
+ }),
11
+ {
12
+ enabled: !!(barcode),
13
+ },
14
+ );
15
+ }
@@ -1,34 +1,18 @@
1
1
  import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
- import { AstsStock, ResponseList } from "../../../interfaces";
2
+ import { AstsStockInfo } from "../../../interfaces";
3
3
  import { getAuth0 } from "../../../services/ApiService";
4
4
 
5
- export interface StockQueryProps extends UseQueryOptions<ResponseList<"", AstsStock>> {
6
- page?: number;
7
- records?: number;
8
- sortBy?: string;
9
- sortDirection?: string;
10
- storeCode?: string;
11
- size?: string;
12
- color?: string;
5
+ export interface StockQueryProps extends UseQueryOptions<AstsStockInfo[]> {
13
6
  reference?: string;
14
- userId?: string;
15
- barcode?: string;
7
+ countryId?: string;
16
8
  }
17
9
 
18
- export const getStockQueryHook = ({ page, records, sortBy, sortDirection, storeCode, size, color, reference, userId, barcode }: StockQueryProps) => {
10
+ export const getStockQueryHook = ({ reference, countryId }: StockQueryProps) => {
19
11
  return useQuery(
20
- ['ASTS_STOCK_QUERY', page, records, sortBy, sortDirection, storeCode, size, color, reference, userId, barcode],
21
- () => getAuth0<ResponseList<"", AstsStock>>('/ASTS/Stock', {
22
- pPage: page || 1,
23
- pRecords: records || 50,
24
- pSortBy: sortBy || 'Reference',
25
- pSortDirection: sortDirection || 'asc',
26
- pStoreCode: storeCode,
27
- pSize: size,
28
- pColor: color,
12
+ ['ASTS_STOCK_QUERY', reference, countryId],
13
+ () => getAuth0<AstsStockInfo[]>('/ASTS/Stock', {
29
14
  pReference: reference,
30
- pUserId: userId,
31
- pBarcode: barcode
15
+ pCountryId: countryId || "PT"
32
16
  })
33
17
  );
34
18
  }
@@ -72,7 +72,7 @@ export * from './Ass/get/getAssProductsByStoreQuery.hook';
72
72
  export * from './Ass/get/getAssProductsStockDetailsQuery.hook';
73
73
 
74
74
  //ASTS
75
- export * from './Asts/get/getStockInfoQuery.hook';
75
+ export * from './Asts/get/getProductInfoQuery.hook';
76
76
  export * from './Asts/get/getStockQuery.hook';
77
77
 
78
78
  //Astt
@@ -128,6 +128,7 @@ export * from './Asta/AnswerType/others/deleteAnswerTypeQuery.hook';
128
128
  export * from './Asta/AnswerType/others/finishAnswerTypeQuery.hook';
129
129
 
130
130
  export * from './Asta/Actions/get/getActionByIdQuery.hook';
131
+ export * from './Asta/Actions/get/getActionStagesQuery.hook';
131
132
  export * from './Asta/Actions/get/getActionPriorityQuery.hook';
132
133
  export * from './Asta/Actions/get/getActionQuery.hook';
133
134
  export * from './Asta/Actions/mutate/useActionMutateQuery.hook';
@@ -153,23 +154,17 @@ export * from './OSUA/get/documentos/getSitooDocumentos.hook';
153
154
  export * from './OSUA/get/vouchers/getGngVoucher.hook';
154
155
  export * from './OSUA/get/vouchers/getSitooVouchers.hook';
155
156
  export * from './OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook';
156
-
157
157
  export * from './OSUA/mutate/postCreateIntegrationRequest.hook';
158
158
 
159
159
  //ACB
160
160
  export * from './ACB/get/getClientBalance.hook';
161
161
  export * from './ACB/mutate/postClientBalance.hook';
162
162
 
163
-
164
-
165
163
  //BackofficeAtim
166
-
167
164
  export * from './ATIM/BackOffice/get/useEmployeeTimekeepingDetails.hook';
168
-
169
165
  export * from './ATIM/BackOffice/get/useStoresQueryHook.hook';
170
166
  export * from './ATIM/BackOffice/mutate/postAttendanceRange.hook';
171
167
 
172
-
173
168
  //Others
174
169
  export * from './Others/useJobTitlesQuery.hook';
175
170
  export * from './Others/useContractStatesQuery.hook';
@@ -1,15 +1,17 @@
1
1
 
2
2
  export interface AstsStock {
3
- StoreCode: number;
3
+ Id: string;
4
+ ParentName: string;
5
+ ParentDescription: string;
4
6
  Name: string;
5
7
  Description: string;
8
+ Barcode: string;
6
9
  Reference: string;
7
- Ean: string;
8
- Image: string;
10
+ InternalReference: string;
11
+ Sku: string;
9
12
  Size: string;
10
- StockQty: number;
11
- LegSize: string;
12
- StockOnlineQty: number;
13
13
  Color: string;
14
- StoreName: string;
14
+ Image: string;
15
+ Price: number;
16
+ Company: string;
15
17
  }
@@ -1,6 +1,14 @@
1
1
 
2
2
  export interface AstsStockInfo {
3
- Stores: string[];
4
- Sizes: string[];
5
- Colors: string[];
3
+ StoreCode: string;
4
+ Stocks: StockInterface[];
5
+ }
6
+
7
+ export interface StockInterface {
8
+ SKU: string;
9
+ Values: {
10
+ ValueStore: string;
11
+ ValueOnline: string;
12
+ ValueWarehouse: string;
13
+ }
6
14
  }
@@ -29,4 +29,5 @@ export interface HeadersInterface {
29
29
  Id: string;
30
30
  Name: string;
31
31
  Value: string;
32
+ Color: string;
32
33
  }
@@ -1,15 +0,0 @@
1
- import { useQuery } from "@tanstack/react-query";
2
- import { AstsStockInfo } from "../../../interfaces";
3
- import { getAuth0 } from "../../../services/ApiService";
4
-
5
- export const getStockInfoQueryHook = (barcode: string) => {
6
- return useQuery(
7
- ['STOCK_INFO_QUERY', barcode],
8
- () => getAuth0<AstsStockInfo>(`/ASTS/Stock/Information`, {
9
- pBarcode: barcode
10
- }),
11
- {
12
- enabled: !!(barcode),
13
- },
14
- );
15
- }