@omniumretail/shared-resources 0.2.19 → 0.2.21

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 (34) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/types/hooks/ATIM/BackOffice/get/useEmployeeTimekeepingDetails.hook.d.ts +15 -0
  3. package/dist/types/hooks/ATIM/BackOffice/get/useStoresQueryHook.hook.d.ts +11 -0
  4. package/dist/types/hooks/ATIM/BackOffice/mutate/postAttendanceRange.hook.d.ts +2 -0
  5. package/dist/types/hooks/Asta/Actions/others/startActionQuery.hook.d.ts +2 -0
  6. package/dist/types/hooks/Asta/Inspection/mutate/useInspectionMutateQuery.hook.d.ts +1 -1
  7. package/dist/types/hooks/OSUA/get/documentos/getGngDocumentos.hook.d.ts +3 -3
  8. package/dist/types/hooks/OSUA/get/documentos/getSitooDocumentos.hook.d.ts +3 -4
  9. package/dist/types/hooks/OSUA/get/vouchers/getSitooVouchers.hook.d.ts +3 -3
  10. package/dist/types/hooks/index.d.ts +4 -0
  11. package/dist/types/interfaces/BackofficeAtim.d.ts +35 -0
  12. package/dist/types/interfaces/Configuration.d.ts +1 -0
  13. package/dist/types/interfaces/OUSA.d.ts +196 -8
  14. package/dist/types/interfaces/Responses.d.ts +6 -0
  15. package/dist/types/interfaces/index.d.ts +1 -0
  16. package/dist/types/services/ApiService/index.d.ts +1 -0
  17. package/package.json +1 -1
  18. package/src/hooks/ATIM/BackOffice/get/useEmployeeTimekeepingDetails.hook.ts +38 -0
  19. package/src/hooks/ATIM/BackOffice/get/useStoresQueryHook.hook.ts +27 -0
  20. package/src/hooks/ATIM/BackOffice/mutate/postAttendanceRange.hook.ts +16 -0
  21. package/src/hooks/Asta/Actions/others/startActionQuery.hook.ts +17 -0
  22. package/src/hooks/Asta/Inspection/mutate/useInspectionMutateQuery.hook.ts +4 -2
  23. package/src/hooks/OSUA/get/documentos/getGngDocumentos.hook.ts +4 -5
  24. package/src/hooks/OSUA/get/documentos/getSitooDocumentos.hook.ts +7 -7
  25. package/src/hooks/OSUA/get/vouchers/getSitooVouchers.hook.ts +14 -16
  26. package/src/hooks/OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook.ts +5 -1
  27. package/src/hooks/OSUA/mutate/postCreateIntegrationRequest.hook.ts +1 -1
  28. package/src/hooks/index.ts +8 -0
  29. package/src/interfaces/BackofficeAtim.ts +48 -0
  30. package/src/interfaces/Configuration.ts +1 -0
  31. package/src/interfaces/OUSA.ts +211 -10
  32. package/src/interfaces/Responses.ts +7 -0
  33. package/src/interfaces/index.ts +2 -1
  34. package/src/services/ApiService/index.ts +42 -0
@@ -0,0 +1,15 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { ResponseList, EmployeesWorklog } from '../../../../interfaces';
3
+ interface EmployeesWithTimekeepingProps extends UseQueryOptions<ResponseList<"EmployeesWorkLog", EmployeesWorklog>> {
4
+ storeId?: string;
5
+ startDate?: number;
6
+ endDate?: number;
7
+ search?: string;
8
+ page?: number;
9
+ records?: number;
10
+ sortBy?: string;
11
+ sortDirection?: string;
12
+ employeeId?: string;
13
+ }
14
+ export declare const useEmployeeTimekeepingDetails: ({ storeId, startDate, endDate, search, employeeId, page, records, sortBy, sortDirection, ...options }: EmployeesWithTimekeepingProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"EmployeesWorklog", EmployeesWorklog>, unknown>;
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { ResponseList, Store } from "../../../../interfaces";
3
+ interface StoreQueryOptions extends UseQueryOptions<ResponseList<'Locations', Store>> {
4
+ page: number;
5
+ records: number;
6
+ sortBy: string;
7
+ sortDirection: string;
8
+ query: string;
9
+ }
10
+ export declare const useStoresQueryHook: ({ page, records, sortBy, sortDirection, query, ...options }: StoreQueryOptions) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Locations", Store>, unknown>;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import { AttendanceRange } from "../../../../interfaces";
2
+ export declare const postAttendanceRange: () => import("@tanstack/react-query").UseMutationResult<AttendanceRange, unknown, AttendanceRange, unknown>;
@@ -0,0 +1,2 @@
1
+ import { Actions } from '../../../../interfaces';
2
+ export declare const startActionQueryHook: () => import("@tanstack/react-query").UseMutationResult<Actions, unknown, Actions, unknown>;
@@ -1,2 +1,2 @@
1
1
  import { Inspection } from '../../../../interfaces';
2
- export declare const useInspectionMutateHook: (templateId: string) => import("@tanstack/react-query").UseMutationResult<Inspection, unknown, Inspection, unknown>;
2
+ export declare const useInspectionMutateHook: (templateId: string, userId: string, userName: string) => import("@tanstack/react-query").UseMutationResult<Inspection, unknown, Inspection, unknown>;
@@ -1,9 +1,9 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
- import { GNGDocumentosResponse, ResponseList } from '../../../../interfaces';
3
- interface GetGNGDocumentosProps extends UseQueryOptions<ResponseList<"Documents", GNGDocumentosResponse>> {
2
+ import { DocumentGng, ResponseList } from '../../../../interfaces';
3
+ interface GetGNGDocumentosProps extends UseQueryOptions<ResponseList<"Documents", DocumentGng>> {
4
4
  page?: number;
5
5
  records?: number;
6
6
  query?: string;
7
7
  }
8
- export declare const getGngDocumentos: ({ page, records, query, ...options }: GetGNGDocumentosProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Documents", GNGDocumentosResponse>, unknown>;
8
+ export declare const getGngDocumentos: ({ page, records, query, ...options }: GetGNGDocumentosProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Documents", DocumentGng>, unknown>;
9
9
  export {};
@@ -1,9 +1,8 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
- import { ResponseList, SitooDocumentoResponse } from '../../../../interfaces';
3
- interface GetSitooDocumentosProps extends UseQueryOptions<ResponseList<"Items", SitooDocumentoResponse>> {
2
+ import { ResponseList, DocumentSitoo } from '../../../../interfaces';
3
+ interface GetSitooDocumentosProps extends UseQueryOptions<ResponseList<"Items", DocumentSitoo>> {
4
4
  fields?: string;
5
5
  externalid?: string;
6
- num?: number;
7
6
  }
8
- export declare const getSitooDocumentos: ({ fields, externalid, num, ...options }: GetSitooDocumentosProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Items", SitooDocumentoResponse>, unknown>;
7
+ export declare const getSitooDocumentos: ({ fields, externalid, ...options }: GetSitooDocumentosProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Items", DocumentSitoo>, unknown>;
9
8
  export {};
@@ -1,7 +1,7 @@
1
- import { UseMutationOptions } from '@tanstack/react-query';
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import { SitooVoucher } from '../../../../interfaces';
3
- interface GetSitooVouchersProps extends UseMutationOptions<any, unknown, SitooVoucher, unknown> {
3
+ interface GetSitooVouchersProps extends UseQueryOptions<SitooVoucher> {
4
4
  id?: string;
5
5
  }
6
- export declare const getSitooVouchers: ({ id, ...options }: GetSitooVouchersProps) => import("@tanstack/react-query").UseMutationResult<any, unknown, SitooVoucher, unknown>;
6
+ export declare const getSitooVouchers: ({ id, ...options }: GetSitooVouchersProps) => import("@tanstack/react-query").UseQueryResult<SitooVoucher, unknown>;
7
7
  export {};
@@ -104,6 +104,7 @@ export * from './Asta/Actions/others/deleteActionQuery.hook';
104
104
  export * from './Asta/Actions/others/extractActionQuery.hook';
105
105
  export * from './Asta/Actions/others/archiveActionQuery.hook';
106
106
  export * from './Asta/Actions/others/finishActionQuery.hook';
107
+ export * from './Asta/Actions/others/startActionQuery.hook';
107
108
  export * from './Aprc/get/getPriceChangePinQuery.hook';
108
109
  export * from './Aprc/others/postPriceChangePinQuery.hook';
109
110
  export * from './Aprc/others/sendEmailWithPinQuery.hook';
@@ -116,6 +117,9 @@ export * from './OSUA/get/vouchers/getGngVoucher.hook';
116
117
  export * from './OSUA/get/vouchers/getSitooVouchers.hook';
117
118
  export * from './OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook';
118
119
  export * from './OSUA/mutate/postCreateIntegrationRequest.hook';
120
+ export * from './ATIM/BackOffice/get/useEmployeeTimekeepingDetails.hook';
121
+ export * from './ATIM/BackOffice/get/useStoresQueryHook.hook';
122
+ export * from './ATIM/BackOffice/mutate/postAttendanceRange.hook';
119
123
  export * from './Others/useJobTitlesQuery.hook';
120
124
  export * from './Others/useContractStatesQuery.hook';
121
125
  export * from './Others/useApplicationDataQuery.hook';
@@ -0,0 +1,35 @@
1
+ export interface WorkLogDetail {
2
+ Id: string;
3
+ Type: number;
4
+ Date: number;
5
+ }
6
+ export interface Breaks {
7
+ Number: number;
8
+ Time: number;
9
+ }
10
+ export interface WorkDayLog {
11
+ WorkDay: number;
12
+ TimeWorked: number;
13
+ Breaks: Breaks;
14
+ Details: WorkLogDetail[];
15
+ }
16
+ export interface EmployeesWorklog {
17
+ Id: string;
18
+ Code: string;
19
+ Name: string;
20
+ JobTitle: string;
21
+ IsWorking: boolean;
22
+ TimeWorked: number;
23
+ Breaks: Breaks;
24
+ WorkDayLogs: WorkDayLog[];
25
+ }
26
+ export interface Location {
27
+ Id: string;
28
+ Name: string;
29
+ Code: string;
30
+ Status: string;
31
+ }
32
+ export interface UserBackoffice {
33
+ UserId: string;
34
+ FullName: string;
35
+ }
@@ -3,4 +3,5 @@ export interface Configuration {
3
3
  ApiPath: string;
4
4
  token?: string;
5
5
  tokenAuth0?: string;
6
+ basic?: string;
6
7
  }
@@ -61,14 +61,202 @@ export interface IntegrationRequestStatus {
61
61
  CreateDate: number;
62
62
  UpdatedDate: number;
63
63
  }
64
- export interface GNGDocumentosResponse {
65
- Documents: [];
64
+ export interface BillingAddress {
65
+ Street: string | null;
66
+ City: string | null;
67
+ ZipCode: string | null;
68
+ CountryISO2: string | null;
66
69
  }
67
- export interface SitooDocumento {
68
- orderid: number;
69
- externalid: string;
70
+ export interface DeliveryAddress {
71
+ Street: string | null;
72
+ City: string | null;
73
+ ZipCode: string | null;
74
+ CountryISO2: string | null;
70
75
  }
71
- export interface SitooDocumentoResponse {
72
- totalcount: number;
73
- items: SitooDocumento;
76
+ export interface FiscalInformation {
77
+ TaxName: string | null;
78
+ TaxNumber: string | null;
79
+ }
80
+ export interface Lines {
81
+ LineNumber: number;
82
+ Description: string;
83
+ Reference: string;
84
+ SKU: string;
85
+ Quantity: number;
86
+ VAT: string;
87
+ Taxes: number;
88
+ UnitPrice: number;
89
+ Discount: number;
90
+ PriceNet: number;
91
+ PriceGross: number;
92
+ CostPrice: number;
93
+ CampaignId: string | null;
94
+ ReasonCode: string;
95
+ UnitLabel: string;
96
+ }
97
+ export interface Payments {
98
+ LineNumber: number;
99
+ Amount: number;
100
+ PaymentTypeId: string;
101
+ GiftCardNumber: string | null;
102
+ Name: string;
103
+ }
104
+ export interface AdditionalFields {
105
+ Name: string;
106
+ Value: string;
107
+ }
108
+ export interface DocumentGng {
109
+ Id: string;
110
+ DocumentNumber: string;
111
+ CompanyCode: string;
112
+ DocumentTypeCode: string;
113
+ LocationCode: string;
114
+ Date: number;
115
+ AssociatedDocumentNumber: string | null;
116
+ SourceLocationCode: string | null;
117
+ DestinationLocationCode: string | null;
118
+ UserCode: string;
119
+ CustomerId: string | null;
120
+ SalesAssociateUserCode: string;
121
+ BillingAddress: BillingAddress | null;
122
+ DeliveryAddress: DeliveryAddress | null;
123
+ SubTotalNet: number;
124
+ SubTotalGross: number;
125
+ PostageNet: number;
126
+ PostageGross: number;
127
+ Taxes: number;
128
+ Discount: number;
129
+ TotalGross: number;
130
+ InternalStaffComments: string | null;
131
+ FiscalInformation: FiscalInformation | null;
132
+ POSReceiptId: string | null;
133
+ CreateDate: number;
134
+ UpdateDate: number;
135
+ Status: string;
136
+ Lines: Lines;
137
+ Payments: Payments;
138
+ ExternalPlatforms: any | null;
139
+ AdditionalFields: AdditionalFields;
140
+ }
141
+ export interface OrderItemAdditionalData {
142
+ ReasonCodeReturn: string | null;
143
+ InventTransId: string | null;
144
+ ReasonCodeManualPrice: string | null;
145
+ ReasonCodeManualDiscount: string | null;
146
+ POSStaffSalesExternalId: string | null;
147
+ OrderItemMoneyRowDiscount: string | null;
148
+ }
149
+ export interface OrderItems {
150
+ OrderItemId: number;
151
+ OrderItemType: number;
152
+ ProductId: number;
153
+ ProductName: string;
154
+ SKU: string;
155
+ ProductAttributes: string;
156
+ ExternalInput: string;
157
+ ExternalInputTitle: string;
158
+ Quantity: number;
159
+ DecimalUnitQuantity: number | null;
160
+ MoneyNetPricePerUnit: string;
161
+ MoneyPriceOrg: string;
162
+ VatValue: number;
163
+ DeliveryInfo: string;
164
+ MoneyItemTotalNet: string;
165
+ MoneyItemTotalVat: string;
166
+ VoucherId: number;
167
+ VoucherCode: string;
168
+ VoucherName: string;
169
+ MoneyOriginalPrice: string;
170
+ MoneyDiscountedPrice: string;
171
+ MoneyDiscount: string;
172
+ SalesTaxes: any;
173
+ DecimalQuantityTotal: string;
174
+ MoneyNetPricePerQuantity: string;
175
+ AdditionalData: OrderItemAdditionalData;
176
+ }
177
+ export interface PaymentAdditionalData {
178
+ GiftCardNumber: string | null;
179
+ }
180
+ export interface Payment {
181
+ Name: string;
182
+ MoneyAmount: string;
183
+ ExternalId: string;
184
+ AdditionalData: PaymentAdditionalData;
185
+ }
186
+ export interface AdditionalData {
187
+ POSTimezone: string;
188
+ StoreExternalId: string | null;
189
+ POSStaffSalesUserId: string | null;
190
+ POSStaffUserId: string | null;
191
+ CrmMemberNumber: string;
192
+ POSStaffExternalId: string;
193
+ POSStaffSalesExternalId: string;
194
+ CustomerTaxId: string | null;
195
+ POSReceiptId: string | null;
196
+ ATCUD: string | null;
197
+ CTUInvoiceNumber: string | null;
198
+ POSOriginalSalesOrderId: string | null;
199
+ OmniumIdentification: string | null;
200
+ FiscalInvoiceNumber: string | null;
201
+ InvoiceNumberCorrected: string | null;
202
+ FiscalInvoiceType: string | null;
203
+ }
204
+ export interface DocumentSitoo {
205
+ OrderId: number;
206
+ EshopId: number;
207
+ ExternalId: string;
208
+ CreditOrderId: number | null;
209
+ CheckoutTypeId: number;
210
+ DeliveryTypeId: number;
211
+ Email: string | null;
212
+ NameFirst: string | null;
213
+ NameLast: string | null;
214
+ PersonalId: string;
215
+ Company: string;
216
+ Phone: string | null;
217
+ InvoiceAddress: string;
218
+ InvoiceAddress2: string;
219
+ InvoiceZip: string;
220
+ InvoiceCity: string;
221
+ InvoiceState: string | null;
222
+ InvoiceCountryid: string;
223
+ DeliveryAddress: string;
224
+ DeliveryAddress2: string;
225
+ DeliveryZip: string;
226
+ DeliveryCity: string;
227
+ DeliveryState: string;
228
+ DeliveryCountryid: string;
229
+ Comment: string | null;
230
+ CommentInternal: string;
231
+ CustomerRef: string | null;
232
+ CheckoutRef: string | null;
233
+ MoneyTotalNet: string | null;
234
+ MoneyTotalVat: string | null;
235
+ MoneyCheckoutNet: string | null;
236
+ MoneyCheckoutVat: string | null;
237
+ MoneyTotalGrossCheckout: string | null;
238
+ MoneyDeliveryNet: string;
239
+ MoneyDeliveryVat: string | null;
240
+ MoneyTotalGrossDelivery: string;
241
+ MoneyFinalNet: string | null;
242
+ MoneyFinalVat: string | null;
243
+ MoneyFinalSalestax: string | null;
244
+ MoneyTotalGrossRoundoff: string | null;
245
+ MoneyTotalGrossAll: string | null;
246
+ CheckoutTypeName: string | null;
247
+ CheckoutMethodId: number;
248
+ CheckoutMethodSubId: number;
249
+ DeliveryTypeName: string | null;
250
+ OrderDate: number;
251
+ OrderStateId: number;
252
+ PaymentStateId: number;
253
+ OrderTypeId: number;
254
+ UserIdStaff: string | null;
255
+ RegisterId: string | null;
256
+ WarehouseId: number;
257
+ DateReserved: string | null;
258
+ CurrencyCode: string;
259
+ AdditionalData: AdditionalData;
260
+ OrderItems: OrderItems;
261
+ Payments: Payment;
74
262
  }
@@ -21,3 +21,9 @@ export interface Attendance {
21
21
  CreateDate: string;
22
22
  UpdateDate: string;
23
23
  }
24
+ export interface AttendanceRange {
25
+ StoreID: string;
26
+ EmployeeID: string;
27
+ EntryDate: number;
28
+ ExitDate: number;
29
+ }
@@ -52,3 +52,4 @@ export * from './AstsStockInfo';
52
52
  export * from './AstsStock';
53
53
  export * from './UserAuthentication';
54
54
  export * from './OUSA';
55
+ export * from './BackofficeAtim';
@@ -1,6 +1,7 @@
1
1
  import 'whatwg-fetch';
2
2
  export declare const get: <T>(path: string, params?: Record<string, unknown>) => Promise<T>;
3
3
  export declare const getAuth0: <T>(path: string, params?: Record<string, unknown>) => Promise<T>;
4
+ export declare const getBasic: <T>(path: string, params?: Record<string, unknown>) => Promise<T>;
4
5
  export declare const putAuth0: <T>(path: string, params?: Record<string, unknown>, body?: unknown, bodyType?: string) => Promise<T>;
5
6
  export declare const patchAuth0: <T>(path: string, params?: Record<string, unknown>, body?: unknown, bodyType?: string) => Promise<T>;
6
7
  export declare const postAuth0: <T>(path: string, params?: Record<string, unknown>, body?: unknown, bodyType?: string) => Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
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,38 @@
1
+ import { useQuery , UseQueryOptions} from '@tanstack/react-query';
2
+ import { getDateToUnix } from "../../../../helpers/date-unix.helper";
3
+ import { getAuth0 } from "../../../../services/ApiService";
4
+ import { ResponseList, EmployeesWorklog } from '../../../../interfaces';
5
+
6
+
7
+ interface EmployeesWithTimekeepingProps extends UseQueryOptions<ResponseList<"EmployeesWorkLog", EmployeesWorklog>> {
8
+ storeId?: string;
9
+ startDate?: number;
10
+ endDate?: number;
11
+ search?: string;
12
+ page?: number;
13
+ records?: number;
14
+ sortBy?: string;
15
+ sortDirection?: string;
16
+ employeeId?: string;
17
+
18
+ }
19
+
20
+ export const useEmployeeTimekeepingDetails = ({storeId, startDate, endDate, search, employeeId, page, records, sortBy, sortDirection, ...options}: EmployeesWithTimekeepingProps) => {
21
+ return useQuery(
22
+ ['EMPLOYEES_WITH_TIMEKEEPING', storeId, startDate, endDate, search, page, records, sortBy, sortDirection],
23
+ () => getAuth0<ResponseList<"EmployeesWorklog", EmployeesWorklog>>('/ATIM/EmployeesWorklogDetails', {
24
+ pStoreId: storeId,
25
+ pStartDate: startDate || getDateToUnix(new Date()),
26
+ pEndDate: endDate || getDateToUnix(new Date()),
27
+ pEmployeeId: employeeId,
28
+ pPage: page || 1,
29
+ pRecords: records,
30
+ pSortBy: sortBy,
31
+ pSortDirection: sortDirection,
32
+ pSearch: search
33
+ }),
34
+ {
35
+ keepPreviousData: true,
36
+ }
37
+ );
38
+ }
@@ -0,0 +1,27 @@
1
+ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
+ import { get } from "../../../../services";
3
+ import { ResponseList, Store } from "../../../../interfaces";
4
+
5
+ interface StoreQueryOptions extends UseQueryOptions<ResponseList<'Locations', Store>> {
6
+ page: number;
7
+ records: number;
8
+ sortBy: string;
9
+ sortDirection: string;
10
+ query: string;
11
+ }
12
+
13
+ export const useStoresQueryHook = ({page, records, sortBy, sortDirection, query, ...options }:StoreQueryOptions) => {
14
+ return useQuery<ResponseList<'Locations', Store>>(
15
+ ['STORE_QUERY'],
16
+ () => get('/Franchise/Locations', {
17
+ pPage: page,
18
+ pRecords: records,
19
+ pSortBy: sortBy,
20
+ pSortDirection: sortDirection,
21
+ pQuery: query,
22
+ }),
23
+ {
24
+ ...options
25
+ }
26
+ );
27
+ }
@@ -0,0 +1,16 @@
1
+ import { useQueryClient, useMutation } from '@tanstack/react-query';
2
+ import { AttendanceRange } from "../../../../interfaces";
3
+ import { postAuth0} from "../../../../services/ApiService";
4
+
5
+
6
+ export const postAttendanceRange = () => {
7
+ const queryClient = useQueryClient();
8
+ return useMutation<AttendanceRange, unknown, AttendanceRange>((data: AttendanceRange) => {
9
+ return postAuth0('/ATIM/Attendances/Range', undefined, data);
10
+ }, {
11
+ onSuccess: (data: AttendanceRange) => {
12
+ queryClient.setQueryData(
13
+ ['POST_ATTENDANCE'], data);
14
+ },
15
+ });
16
+ }
@@ -0,0 +1,17 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { Actions } from '../../../../interfaces';
3
+ import { putAuth0 } from '../../../../services/ApiService';
4
+
5
+ export const startActionQueryHook = () => {
6
+ const queryClient = useQueryClient();
7
+ return useMutation<Actions, unknown, Actions>((data: Actions) => {
8
+ return putAuth0(`/ASTA/Actions/StartAction?`, {
9
+ pId: data.Id
10
+ }, data);
11
+ }, {
12
+ onSuccess: (data: Actions) => {
13
+ queryClient.setQueryData(
14
+ ['ACTION_ID_QUERY'], data);
15
+ },
16
+ });
17
+ }
@@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
2
  import { Inspection } from '../../../../interfaces';
3
3
  import { putAuth0, postAuth0 } from '../../../../services/ApiService';
4
4
 
5
- export const useInspectionMutateHook = (templateId: string) => {
5
+ export const useInspectionMutateHook = (templateId: string, userId: string, userName: string) => {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation<Inspection, unknown, Inspection>((data: Inspection) => {
8
8
  return data.Id ?
@@ -11,7 +11,9 @@ export const useInspectionMutateHook = (templateId: string) => {
11
11
  }, data) :
12
12
 
13
13
  postAuth0(`/ASTA/Inspection?`, {
14
- pId: templateId
14
+ pId: templateId,
15
+ pUserId: userId,
16
+ pUserName: userName
15
17
  } , data);
16
18
  }, {
17
19
  onSuccess: (data: Inspection) => {
@@ -1,17 +1,17 @@
1
1
  import { useQuery, UseQueryOptions } from '@tanstack/react-query';
2
2
  import { get } from '../../../../services/ApiService';
3
- import { GNGDocumentosResponse , ResponseList} from '../../../../interfaces';
3
+ import { DocumentGng , ResponseList} from '../../../../interfaces';
4
4
 
5
- interface GetGNGDocumentosProps extends UseQueryOptions<ResponseList<"Documents", GNGDocumentosResponse>> {
5
+ interface GetGNGDocumentosProps extends UseQueryOptions<ResponseList<"Documents", DocumentGng>> {
6
6
  page?: number;
7
7
  records?: number;
8
8
  query?: string;
9
9
  }
10
10
 
11
- export const getGngDocumentos = ({ page, records, query, ...options }: GetGNGDocumentosProps) => {
11
+ export const getGngDocumentos = ({ page, records , query, ...options }: GetGNGDocumentosProps) => {
12
12
  return useQuery(
13
13
  ['GNG_DOCUMENTOS', page, records, query],
14
- () => get<ResponseList<"Documents", GNGDocumentosResponse>>('/GNG/Document/Documents', {
14
+ () => get<ResponseList<"Documents", DocumentGng>>('/GNG/Document/Documents', {
15
15
  pPage: page || 1,
16
16
  pRecords: records || 50,
17
17
  pQuery: query
@@ -19,4 +19,3 @@ export const getGngDocumentos = ({ page, records, query, ...options }: GetGNGDoc
19
19
  options
20
20
  );
21
21
  }
22
-
@@ -1,20 +1,20 @@
1
1
  import { useQuery, UseQueryOptions } from '@tanstack/react-query';
2
2
  import { get } from "../../../../services/ApiService";
3
- import { ResponseList, SitooDocumentoResponse } from '../../../../interfaces';
3
+ import { ResponseList, DocumentSitoo } from '../../../../interfaces';
4
4
 
5
- interface GetSitooDocumentosProps extends UseQueryOptions<ResponseList<"Items", SitooDocumentoResponse>> {
5
+ interface GetSitooDocumentosProps extends UseQueryOptions<ResponseList<"Items", DocumentSitoo>> {
6
6
  fields?: string;
7
7
  externalid?: string;
8
- num?: number;
8
+
9
9
  }
10
10
 
11
- export const getSitooDocumentos = ({ fields, externalid, num, ...options}: GetSitooDocumentosProps) => {
11
+ export const getSitooDocumentos = ({ fields, externalid, ...options}: GetSitooDocumentosProps) => {
12
12
  return useQuery(
13
- ['SITOO_DOCUMENTOS', fields, externalid, num],
14
- () => get<ResponseList<"Items", SitooDocumentoResponse>>('/Sitoo/Orders', {
13
+ ['SITOO_DOCUMENTOS', fields, externalid],
14
+ () => get<ResponseList<"Items", DocumentSitoo>>('/Sitoo/Orders', {
15
15
  pFields: fields || "externalid,orderid",
16
16
  pExternalid: externalid ,
17
- pNum: num
17
+
18
18
  }),
19
19
  options
20
20
  );
@@ -1,24 +1,22 @@
1
- import { useMutation, useQueryClient, UseMutationOptions } from '@tanstack/react-query';
2
- import { get } from "../../../../services/ApiService";
1
+ import { useQuery, UseQueryOptions } from '@tanstack/react-query';
2
+ import { getBasic } from "../../../../services/ApiService";
3
3
  import { SitooVoucher } from '../../../../interfaces';
4
4
 
5
-
6
- interface GetSitooVouchersProps extends UseMutationOptions<any, unknown, SitooVoucher, unknown> {
5
+ interface GetSitooVouchersProps extends UseQueryOptions<SitooVoucher>{
7
6
  id?: string;
8
7
  }
9
8
 
10
-
11
9
  export const getSitooVouchers = ({ id, ...options }: GetSitooVouchersProps) => {
12
- const queryClient = useQueryClient();
13
- return useMutation<any, unknown, SitooVoucher>(() => {
14
- return get<SitooVoucher>(`/GNG/GiftCard/SPIGiftCard/giftcards/${id}.json`);
15
- }, {
16
- ...options,
17
- onSuccess: (data: any) => {
18
- queryClient.setQueryData(['SITOO_VOUCHERS'], data);
19
-
20
- },
21
- });
22
- };
10
+ return useQuery(
11
+ ['SITOO_VOUCHERS', id],
23
12
 
13
+ () => getBasic<SitooVoucher>(`/GNG/GiftCard/SPIGiftCard/giftcards/${id}.json`),
14
+ {
15
+ ...options,
16
+ retry: false,
17
+
18
+ }
19
+
20
+ );
21
+ }
24
22
 
@@ -14,6 +14,10 @@ export const getVoucherIntegrationRequestStatus = ({ pIntegrationType, pSourcePl
14
14
  pIntegrationType: pIntegrationType ,
15
15
  pSourcePlatformId: pSourcePlatformId
16
16
  }),
17
- options
17
+ {
18
+ ...options,
19
+ retry: false,
20
+
21
+ }
18
22
  );
19
23
  }
@@ -14,7 +14,7 @@ interface PostCreateIntegrationRequestProps extends UseQueryOptions<IntegrationR
14
14
  export const postCreateIntegrationRequest = ({integrationType, sourcePlatformId, destinations, query}: PostCreateIntegrationRequestProps) => {
15
15
  const queryClient = useQueryClient();
16
16
  return useMutation<IntegrationRequestStatus, unknown, IntegrationRequestStatus>(() => {
17
- return postWithParameters('/Document/IntegrationRequests', {
17
+ return postWithParameters('/Document/IntegrationRequests?', {
18
18
  pIntegrationType: integrationType ,
19
19
  pSourcePlatformId: sourcePlatformId ,
20
20
  pDestinations: destinations,
@@ -135,6 +135,7 @@ export * from './Asta/Actions/others/deleteActionQuery.hook';
135
135
  export * from './Asta/Actions/others/extractActionQuery.hook';
136
136
  export * from './Asta/Actions/others/archiveActionQuery.hook';
137
137
  export * from './Asta/Actions/others/finishActionQuery.hook';
138
+ export * from './Asta/Actions/others/startActionQuery.hook';
138
139
 
139
140
  //APRC
140
141
  export * from './Aprc/get/getPriceChangePinQuery.hook';
@@ -156,6 +157,13 @@ export * from './OSUA/get/vouchers/getVoucherIntegrationRequestStatus.hook';
156
157
 
157
158
  export * from './OSUA/mutate/postCreateIntegrationRequest.hook';
158
159
 
160
+ //BackofficeAtim
161
+
162
+ export * from './ATIM/BackOffice/get/useEmployeeTimekeepingDetails.hook';
163
+ export * from './ATIM/BackOffice/get/useStoresQueryHook.hook';
164
+ export * from './ATIM/BackOffice/mutate/postAttendanceRange.hook';
165
+
166
+
159
167
  //Others
160
168
  export * from './Others/useJobTitlesQuery.hook';
161
169
  export * from './Others/useContractStatesQuery.hook';