@zauru-sdk/hooks 2.0.177 → 2.0.180
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.
- package/dist/catalogs.d.ts +5 -1
- package/dist/esm/catalogs.js +27 -3
- package/package.json +3 -3
package/dist/catalogs.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export declare const useGetProviders: (config?: ReduxParamsConfig) => {
|
|
|
83
83
|
loading: boolean;
|
|
84
84
|
data: PayeeGraphQL[];
|
|
85
85
|
};
|
|
86
|
-
export declare const
|
|
86
|
+
export declare const useGetCases: (config?: ReduxParamsConfig) => {
|
|
87
87
|
loading: boolean;
|
|
88
88
|
data: CaseGraphQL[];
|
|
89
89
|
};
|
|
@@ -183,6 +183,10 @@ export declare const useGetMyCaseFormSubmissions: (config?: ReduxParamsConfig) =
|
|
|
183
183
|
loading: boolean;
|
|
184
184
|
data: SubmissionCasesGraphQL[];
|
|
185
185
|
};
|
|
186
|
+
export declare const useGetCaseFormSubmissionsByCaseId: (config?: ReduxParamsConfig) => {
|
|
187
|
+
loading: boolean;
|
|
188
|
+
data: SubmissionCasesGraphQL[];
|
|
189
|
+
};
|
|
186
190
|
export declare const useGetInvoiceFormSubmissionsByInvoiceId: (config?: ReduxParamsConfig) => {
|
|
187
191
|
loading: boolean;
|
|
188
192
|
data: SubmissionInvoicesGraphQL[];
|
package/dist/esm/catalogs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetMyCaseFormSubmissions = exports.useGetInvoiceFormSubmissionsByAgencyId = exports.useGetCaseForms = exports.useGetInvoiceForms = exports.useGetAllForms = exports.useGetBitacoraRechazoMasivo = exports.useGetCCPorcentajesDeRechazo = exports.useGetMotivosDeRechazo = exports.useGetTiposDeMuestra = exports.useGetInvoicesByCurrentAgency = exports.useGetInvoicesByLab = exports.useGetShipmentsToMyAgency = exports.useGetEmployees = exports.useGetEmployeesByCurrentAgency = exports.useGetEmployeesByLab = exports.useGetPaymentMethods = exports.useGetPaymentTerms = exports.useGetSuggestedPrices = exports.useGetAgencies = exports.useGetPrintTemplates = exports.useGetPayeesForLab = exports.useGetPayees = exports.useGetClientCategories = exports.useGetProviderCategories = exports.
|
|
3
|
+
exports.useGetInvoiceFormSubmissionsByInvoiceId = exports.useGetCaseFormSubmissionsByCaseId = exports.useGetMyCaseFormSubmissions = exports.useGetInvoiceFormSubmissionsByAgencyId = exports.useGetCaseForms = exports.useGetInvoiceForms = exports.useGetAllForms = exports.useGetBitacoraRechazoMasivo = exports.useGetCCPorcentajesDeRechazo = exports.useGetMotivosDeRechazo = exports.useGetTiposDeMuestra = exports.useGetInvoicesByCurrentAgency = exports.useGetInvoicesByLab = exports.useGetShipmentsToMyAgency = exports.useGetEmployees = exports.useGetEmployeesByCurrentAgency = exports.useGetEmployeesByLab = exports.useGetPaymentMethods = exports.useGetPaymentTerms = exports.useGetSuggestedPrices = exports.useGetAgencies = exports.useGetPrintTemplates = exports.useGetPayeesForLab = exports.useGetPayees = exports.useGetClientCategories = exports.useGetProviderCategories = exports.useGetCases = exports.useGetProviders = exports.useGetReceptionTypes = exports.useGetCurrencies = exports.useGetBundlesForLab = exports.useGetBundlesRecipForLab = exports.useGetPayeeCategoriesLabPrices = exports.useGetPayeeCategories = exports.useGetTemplates = exports.useGetBookings = exports.useGetItemCategoriesForLab = exports.useGetItemServicesByLab = exports.useGetMyAgencyLotStocks = exports.useGetItemsByLab = exports.useGetItemsByReception = exports.useGetItems = void 0;
|
|
4
4
|
exports.useGetReduxCatalog = useGetReduxCatalog;
|
|
5
5
|
const react_1 = require("@remix-run/react");
|
|
6
6
|
const react_2 = require("react");
|
|
@@ -232,8 +232,8 @@ const useGetReceptionTypes = (config) => useGetReduxCatalog("receptionTypes", co
|
|
|
232
232
|
exports.useGetReceptionTypes = useGetReceptionTypes;
|
|
233
233
|
const useGetProviders = (config) => useGetReduxCatalog("providers", config);
|
|
234
234
|
exports.useGetProviders = useGetProviders;
|
|
235
|
-
const
|
|
236
|
-
exports.
|
|
235
|
+
const useGetCases = (config) => useGetReduxCatalog("cases", config);
|
|
236
|
+
exports.useGetCases = useGetCases;
|
|
237
237
|
const useGetProviderCategories = (config) => useGetReduxCatalog("providerCategories", config);
|
|
238
238
|
exports.useGetProviderCategories = useGetProviderCategories;
|
|
239
239
|
const useGetClientCategories = (config) => useGetReduxCatalog("clientCategories", config);
|
|
@@ -362,6 +362,30 @@ const useGetMyCaseFormSubmissions = (config) => {
|
|
|
362
362
|
};
|
|
363
363
|
};
|
|
364
364
|
exports.useGetMyCaseFormSubmissions = useGetMyCaseFormSubmissions;
|
|
365
|
+
const useGetCaseFormSubmissionsByCaseId = (config) => {
|
|
366
|
+
const caseId = config?.otherParams?.caseId;
|
|
367
|
+
const withFiles = config?.otherParams?.withFiles;
|
|
368
|
+
const data = useGetReduxCatalog("caseFormSubmissionsByCaseId", {
|
|
369
|
+
otherParams: {
|
|
370
|
+
caseId: `${caseId}`,
|
|
371
|
+
withFiles: `${withFiles}`,
|
|
372
|
+
},
|
|
373
|
+
});
|
|
374
|
+
// Filtrar los registros para obtener sólo los de la versión más alta.
|
|
375
|
+
const groupedByVersion = (data.data || []).reduce((acc, record) => {
|
|
376
|
+
const zid = record.settings_form_submission.zid;
|
|
377
|
+
if (!acc[zid]) {
|
|
378
|
+
acc[zid] = record;
|
|
379
|
+
}
|
|
380
|
+
return acc;
|
|
381
|
+
}, {});
|
|
382
|
+
const latestVersionRecords = Object.values(groupedByVersion);
|
|
383
|
+
return {
|
|
384
|
+
loading: data.loading,
|
|
385
|
+
data: latestVersionRecords,
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
exports.useGetCaseFormSubmissionsByCaseId = useGetCaseFormSubmissionsByCaseId;
|
|
365
389
|
const useGetInvoiceFormSubmissionsByInvoiceId = (config) => {
|
|
366
390
|
const invoiceId = config?.otherParams?.invoiceId;
|
|
367
391
|
const withFiles = config?.otherParams?.withFiles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/hooks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.180",
|
|
4
4
|
"description": "Hooks reutilizables dentro de las webapps de Zauru.",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"@remix-run/react": "^2.8.1",
|
|
29
29
|
"@zauru-sdk/common": "^2.0.177",
|
|
30
30
|
"@zauru-sdk/icons": "^2.0.99",
|
|
31
|
-
"@zauru-sdk/redux": "^2.0.
|
|
31
|
+
"@zauru-sdk/redux": "^2.0.180",
|
|
32
32
|
"@zauru-sdk/types": "^2.0.177",
|
|
33
33
|
"react": "^18.2.0",
|
|
34
34
|
"react-dom": "^18.2.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "a472464c4382cade774fa80e8c468e90d5aa5364"
|
|
37
37
|
}
|