@zauru-sdk/utils 1.0.17 → 1.0.18
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/CHANGELOG.md +8 -0
- package/dist/zauru/bitacora-edicion-masiva.utils.d.ts +3 -3
- package/dist/zauru/bitacora-edicion-masiva.utils.js +6 -6
- package/dist/zauru/consolidated-history.utils.d.ts +3 -3
- package/dist/zauru/consolidated-history.utils.js +6 -6
- package/dist/zauru/costos-items.utils.d.ts +9 -9
- package/dist/zauru/costos-items.utils.js +17 -17
- package/dist/zauru/discharges-histsory.utils.d.ts +3 -3
- package/dist/zauru/discharges-histsory.utils.js +6 -6
- package/dist/zauru/items.utils.d.ts +3 -3
- package/dist/zauru/items.utils.js +6 -6
- package/dist/zauru/motivos-rechazo.utils.d.ts +2 -2
- package/dist/zauru/motivos-rechazo.utils.js +4 -4
- package/dist/zauru/payees.utils.d.ts +5 -5
- package/dist/zauru/payees.utils.js +10 -10
- package/dist/zauru/specialItem.utils.d.ts +4 -4
- package/dist/zauru/specialItem.utils.js +9 -9
- package/dist/zauru/templates.utils.d.ts +6 -6
- package/dist/zauru/templates.utils.js +12 -12
- package/dist/zauru/tiposMuestra.utils.d.ts +4 -4
- package/dist/zauru/tiposMuestra.utils.js +8 -8
- package/dist/zauru/webapp-tables.utils.d.ts +1 -1
- package/dist/zauru/webapp-tables.utils.js +2 -2
- package/package.json +3 -3
- package/src/zauru/bitacora-edicion-masiva.utils.ts +9 -9
- package/src/zauru/consolidated-history.utils.ts +9 -9
- package/src/zauru/costos-items.utils.ts +31 -25
- package/src/zauru/discharges-histsory.utils.ts +9 -9
- package/src/zauru/items.utils.ts +9 -9
- package/src/zauru/motivos-rechazo.utils.ts +6 -6
- package/src/zauru/payees.utils.ts +15 -15
- package/src/zauru/specialItem.utils.ts +25 -15
- package/src/zauru/templates.utils.ts +18 -18
- package/src/zauru/tiposMuestra.utils.ts +12 -12
- package/src/zauru/webapp-tables.utils.ts +2 -2
|
@@ -16,7 +16,13 @@ import {
|
|
|
16
16
|
} from "@zauru-sdk/types";
|
|
17
17
|
import moment from "moment";
|
|
18
18
|
import { createSpecialItem, updateSpecialItem } from "./specialItem.utils.js";
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
createWebAppTableRegister,
|
|
21
|
+
getPurchasesList,
|
|
22
|
+
getVariablesByName,
|
|
23
|
+
getWebAppTableRegisters,
|
|
24
|
+
updateWebAppTableRegister,
|
|
25
|
+
} from "@zauru-sdk/services";
|
|
20
26
|
import { updatePurchaseItemPrice } from "./purchase-orders.utils.js";
|
|
21
27
|
|
|
22
28
|
/**
|
|
@@ -203,7 +209,7 @@ const logTotal = (total: number) => {
|
|
|
203
209
|
* @param body
|
|
204
210
|
* @returns
|
|
205
211
|
*/
|
|
206
|
-
export
|
|
212
|
+
export const updateOneItemPrice = (
|
|
207
213
|
headers: any,
|
|
208
214
|
session: Session,
|
|
209
215
|
body: {
|
|
@@ -212,7 +218,7 @@ export async function updateOneItemPrice(
|
|
|
212
218
|
item: number;
|
|
213
219
|
price: number;
|
|
214
220
|
}
|
|
215
|
-
): Promise<AxiosUtilsResponse<any>> {
|
|
221
|
+
): Promise<AxiosUtilsResponse<any>> => {
|
|
216
222
|
return handlePossibleAxiosErrors(async () => {
|
|
217
223
|
//PASO 1
|
|
218
224
|
//Obtengo todas las órdenes de compra dentro del rango de fechas
|
|
@@ -336,7 +342,7 @@ export async function updateOneItemPrice(
|
|
|
336
342
|
|
|
337
343
|
return response.data;
|
|
338
344
|
});
|
|
339
|
-
}
|
|
345
|
+
};
|
|
340
346
|
|
|
341
347
|
/**
|
|
342
348
|
* changePricesInit
|
|
@@ -346,12 +352,12 @@ export async function updateOneItemPrice(
|
|
|
346
352
|
* @param body
|
|
347
353
|
* @returns
|
|
348
354
|
*/
|
|
349
|
-
export
|
|
355
|
+
export const changePricesInit = (
|
|
350
356
|
headers: any,
|
|
351
357
|
session: Session,
|
|
352
358
|
specialItems: WebAppRowGraphQL<SpecialItem>[],
|
|
353
359
|
body: BitacoraCostosItems
|
|
354
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
360
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
355
361
|
return handlePossibleAxiosErrors(async () => {
|
|
356
362
|
//PASO 1
|
|
357
363
|
//Obtengo todas las órdenes de compra dentro del rango de fechas
|
|
@@ -452,7 +458,7 @@ export async function changePricesInit(
|
|
|
452
458
|
|
|
453
459
|
return response.data;
|
|
454
460
|
});
|
|
455
|
-
}
|
|
461
|
+
};
|
|
456
462
|
|
|
457
463
|
/**
|
|
458
464
|
* changePrice
|
|
@@ -461,10 +467,10 @@ export async function changePricesInit(
|
|
|
461
467
|
* @param body
|
|
462
468
|
* @returns
|
|
463
469
|
*/
|
|
464
|
-
export async
|
|
470
|
+
export const changePrice = async (
|
|
465
471
|
headers: any,
|
|
466
472
|
costo: PurchaseOrderCosto
|
|
467
|
-
): Promise<PurchaseOrderCosto> {
|
|
473
|
+
): Promise<PurchaseOrderCosto> => {
|
|
468
474
|
const x = costo;
|
|
469
475
|
|
|
470
476
|
const msgActualizando = `==============================> ACTUALIZANDO ÓRDEN DE COMPRA: ID: ${
|
|
@@ -504,7 +510,7 @@ export async function changePrice(
|
|
|
504
510
|
costo.finalizado = true;
|
|
505
511
|
}
|
|
506
512
|
return costo;
|
|
507
|
-
}
|
|
513
|
+
};
|
|
508
514
|
|
|
509
515
|
/**
|
|
510
516
|
* changePrices
|
|
@@ -513,12 +519,12 @@ export async function changePrice(
|
|
|
513
519
|
* @param body
|
|
514
520
|
* @returns
|
|
515
521
|
*/
|
|
516
|
-
export
|
|
522
|
+
export const changePrices = (
|
|
517
523
|
headers: any,
|
|
518
524
|
session: Session,
|
|
519
525
|
bitacora: BitacoraCostosItems,
|
|
520
526
|
id_bitacora: string
|
|
521
|
-
): Promise<AxiosUtilsResponse<any>> {
|
|
527
|
+
): Promise<AxiosUtilsResponse<any>> => {
|
|
522
528
|
return handlePossibleAxiosErrors(async () => {
|
|
523
529
|
const costosWithPurchaseIds = bitacora.costosActualizados;
|
|
524
530
|
const costosEspecialesWithPurchaseIds =
|
|
@@ -630,7 +636,7 @@ export async function changePrices(
|
|
|
630
636
|
|
|
631
637
|
return response.data;
|
|
632
638
|
});
|
|
633
|
-
}
|
|
639
|
+
};
|
|
634
640
|
|
|
635
641
|
/**
|
|
636
642
|
* corregirCostos
|
|
@@ -639,12 +645,12 @@ export async function changePrices(
|
|
|
639
645
|
* @param costos
|
|
640
646
|
* @returns
|
|
641
647
|
*/
|
|
642
|
-
export
|
|
648
|
+
export const corregirCostos = (
|
|
643
649
|
headers: any,
|
|
644
650
|
session: Session,
|
|
645
651
|
costos: PurchaseOrderCosto[],
|
|
646
652
|
costosEspeciales: PurchaseOrderCosto[]
|
|
647
|
-
) {
|
|
653
|
+
) => {
|
|
648
654
|
return handlePossibleAxiosErrors(async () => {
|
|
649
655
|
//PASO 1
|
|
650
656
|
//Hago una copia
|
|
@@ -773,7 +779,7 @@ export async function corregirCostos(
|
|
|
773
779
|
|
|
774
780
|
return response.data;
|
|
775
781
|
});
|
|
776
|
-
}
|
|
782
|
+
};
|
|
777
783
|
|
|
778
784
|
/**
|
|
779
785
|
* Get saveBitacoraCostos from the web app table.
|
|
@@ -781,11 +787,11 @@ export async function corregirCostos(
|
|
|
781
787
|
* @param session Session object.
|
|
782
788
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<BitacoraCostosItems>[]>.
|
|
783
789
|
*/
|
|
784
|
-
export
|
|
790
|
+
export const saveBitacoraCostos = (
|
|
785
791
|
headers: any,
|
|
786
792
|
session: Session,
|
|
787
793
|
body: BitacoraCostosItems
|
|
788
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
794
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
789
795
|
return handlePossibleAxiosErrors(async () => {
|
|
790
796
|
const { bitacora_costos_verduras_web_app_table_id } =
|
|
791
797
|
await getVariablesByName(headers, session, [
|
|
@@ -800,7 +806,7 @@ export async function saveBitacoraCostos(
|
|
|
800
806
|
|
|
801
807
|
return response;
|
|
802
808
|
});
|
|
803
|
-
}
|
|
809
|
+
};
|
|
804
810
|
|
|
805
811
|
/**
|
|
806
812
|
* Put updateBitacoraCostos from the web app table.
|
|
@@ -808,12 +814,12 @@ export async function saveBitacoraCostos(
|
|
|
808
814
|
* @param session Session object.
|
|
809
815
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<BitacoraCostosItems>[]>.
|
|
810
816
|
*/
|
|
811
|
-
export
|
|
817
|
+
export const updateBitacoraCostos = (
|
|
812
818
|
headers: any,
|
|
813
819
|
session: Session,
|
|
814
820
|
body: BitacoraCostosItems,
|
|
815
821
|
id_registro: string | number
|
|
816
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
822
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
817
823
|
return handlePossibleAxiosErrors(async () => {
|
|
818
824
|
const { bitacora_costos_verduras_web_app_table_id } =
|
|
819
825
|
await getVariablesByName(headers, session, [
|
|
@@ -829,7 +835,7 @@ export async function updateBitacoraCostos(
|
|
|
829
835
|
|
|
830
836
|
return response;
|
|
831
837
|
});
|
|
832
|
-
}
|
|
838
|
+
};
|
|
833
839
|
|
|
834
840
|
/**
|
|
835
841
|
* Get getCostosBitacora from the web app table.
|
|
@@ -837,10 +843,10 @@ export async function updateBitacoraCostos(
|
|
|
837
843
|
* @param session Session object.
|
|
838
844
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<BitacoraCostosItems>[]>.
|
|
839
845
|
*/
|
|
840
|
-
export
|
|
846
|
+
export const getCostosBitacora = (
|
|
841
847
|
headers: any,
|
|
842
848
|
session: Session
|
|
843
|
-
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<BitacoraCostosItems>[]>> {
|
|
849
|
+
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<BitacoraCostosItems>[]>> => {
|
|
844
850
|
return handlePossibleAxiosErrors(async () => {
|
|
845
851
|
const { bitacora_costos_verduras_web_app_table_id } =
|
|
846
852
|
await getVariablesByName(headers, session, [
|
|
@@ -862,4 +868,4 @@ export async function getCostosBitacora(
|
|
|
862
868
|
|
|
863
869
|
return bitacora;
|
|
864
870
|
});
|
|
865
|
-
}
|
|
871
|
+
};
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
* @param session Session object.
|
|
20
20
|
* @returns A Promise of AxiosUtilsResponse<DischargeHistory[]>.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export const getDischargeHistories = (
|
|
23
23
|
headers: any,
|
|
24
24
|
session: Session
|
|
25
|
-
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<DischargeHistory>[]>> {
|
|
25
|
+
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<DischargeHistory>[]>> => {
|
|
26
26
|
return handlePossibleAxiosErrors(async () => {
|
|
27
27
|
const { discharge_history_web_app_table_id } = await getVariablesByName(
|
|
28
28
|
headers,
|
|
@@ -45,7 +45,7 @@ export async function getDischargeHistories(
|
|
|
45
45
|
|
|
46
46
|
return history;
|
|
47
47
|
});
|
|
48
|
-
}
|
|
48
|
+
};
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Create a template in the web app table.
|
|
@@ -54,11 +54,11 @@ export async function getDischargeHistories(
|
|
|
54
54
|
* @param body DischargeHistory data to be created.
|
|
55
55
|
* @returns A Promise of AxiosUtilsResponse<DischargeHistory>.
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
57
|
+
export const createDischargeHistory = (
|
|
58
58
|
headers: any,
|
|
59
59
|
session: Session,
|
|
60
60
|
body: DischargeHistory
|
|
61
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
61
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
62
62
|
return handlePossibleAxiosErrors(async () => {
|
|
63
63
|
const { discharge_history_web_app_table_id } = await getVariablesByName(
|
|
64
64
|
headers,
|
|
@@ -72,7 +72,7 @@ export async function createDischargeHistory(
|
|
|
72
72
|
);
|
|
73
73
|
return response;
|
|
74
74
|
});
|
|
75
|
-
}
|
|
75
|
+
};
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* Put updateDischargeHistory from the web app table.
|
|
@@ -80,12 +80,12 @@ export async function createDischargeHistory(
|
|
|
80
80
|
* @param session Session object.
|
|
81
81
|
* @returns A Promise of AxiosUtilsResponse<DischargeHistory[]>.
|
|
82
82
|
*/
|
|
83
|
-
export
|
|
83
|
+
export const updateDischargeHistory = (
|
|
84
84
|
headers: any,
|
|
85
85
|
session: Session,
|
|
86
86
|
body: DischargeHistory,
|
|
87
87
|
id_registro: string | number
|
|
88
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
88
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
89
89
|
return handlePossibleAxiosErrors(async () => {
|
|
90
90
|
const { discharge_history_web_app_table_id } = await getVariablesByName(
|
|
91
91
|
headers,
|
|
@@ -102,4 +102,4 @@ export async function updateDischargeHistory(
|
|
|
102
102
|
|
|
103
103
|
return response;
|
|
104
104
|
});
|
|
105
|
-
}
|
|
105
|
+
};
|
package/src/zauru/items.utils.ts
CHANGED
|
@@ -172,10 +172,10 @@ function formatHTMLItemList(item: HTMLItemListSchema): ItemDataTable {
|
|
|
172
172
|
* @param headers
|
|
173
173
|
* @returns
|
|
174
174
|
*/
|
|
175
|
-
export
|
|
175
|
+
export const getLabItemCategories = (
|
|
176
176
|
headers: any,
|
|
177
177
|
session: Session
|
|
178
|
-
): Promise<AxiosUtilsResponse<ItemCategoryGraphQL[]>> {
|
|
178
|
+
): Promise<AxiosUtilsResponse<ItemCategoryGraphQL[]>> => {
|
|
179
179
|
return handlePossibleAxiosErrors(async () => {
|
|
180
180
|
const { lab_super_category_item_id } = await getVariablesByName(
|
|
181
181
|
headers,
|
|
@@ -194,7 +194,7 @@ export async function getLabItemCategories(
|
|
|
194
194
|
|
|
195
195
|
return response.data;
|
|
196
196
|
});
|
|
197
|
-
}
|
|
197
|
+
};
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
200
|
* createNewLaboratoryClient
|
|
@@ -203,11 +203,11 @@ export async function getLabItemCategories(
|
|
|
203
203
|
* @param body
|
|
204
204
|
* @returns
|
|
205
205
|
*/
|
|
206
|
-
export
|
|
206
|
+
export const createNewLaboratoryItemCategory = (
|
|
207
207
|
session: Session,
|
|
208
208
|
headers: any,
|
|
209
209
|
body: Partial<ItemCategoryGraphQL>
|
|
210
|
-
): Promise<AxiosUtilsResponse<boolean>> {
|
|
210
|
+
): Promise<AxiosUtilsResponse<boolean>> => {
|
|
211
211
|
return handlePossibleAxiosErrors(async () => {
|
|
212
212
|
const { lab_super_category_item_id } = await getVariablesByName(
|
|
213
213
|
headers,
|
|
@@ -231,7 +231,7 @@ export async function createNewLaboratoryItemCategory(
|
|
|
231
231
|
|
|
232
232
|
return true;
|
|
233
233
|
});
|
|
234
|
-
}
|
|
234
|
+
};
|
|
235
235
|
|
|
236
236
|
/**
|
|
237
237
|
* createNewLaboratoryItem
|
|
@@ -240,10 +240,10 @@ export async function createNewLaboratoryItemCategory(
|
|
|
240
240
|
* @param body
|
|
241
241
|
* @returns
|
|
242
242
|
*/
|
|
243
|
-
export
|
|
243
|
+
export const createNewLaboratoryItem = (
|
|
244
244
|
headers: any,
|
|
245
245
|
body: Partial<ItemGraphQL>
|
|
246
|
-
): Promise<AxiosUtilsResponse<ItemGraphQL>> {
|
|
246
|
+
): Promise<AxiosUtilsResponse<ItemGraphQL>> => {
|
|
247
247
|
return handlePossibleAxiosErrors(async () => {
|
|
248
248
|
const sendBody = {
|
|
249
249
|
active: true,
|
|
@@ -266,4 +266,4 @@ export async function createNewLaboratoryItem(
|
|
|
266
266
|
|
|
267
267
|
return createResponse.data;
|
|
268
268
|
});
|
|
269
|
-
}
|
|
269
|
+
};
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
WebAppTableUpdateResponse,
|
|
13
13
|
} from "@zauru-sdk/types";
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export const formatearMotivoDeRechazo = (
|
|
16
16
|
entity: WebAppRowGraphQL<MotivoRechazo>
|
|
17
|
-
): BasicIdNameSchema {
|
|
17
|
+
): BasicIdNameSchema => {
|
|
18
18
|
return { id: entity.id, name: entity.data.Nombre } as BasicIdNameSchema;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Post saveBitacoraPOMassive from the web app table.
|
|
@@ -24,11 +24,11 @@ export function formatearMotivoDeRechazo(
|
|
|
24
24
|
* @param session Session object.
|
|
25
25
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<BitacoraPOMassive>[]>.
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export const saveRechazoCanastas = (
|
|
28
28
|
headers: any,
|
|
29
29
|
session: Session,
|
|
30
30
|
body: any
|
|
31
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
31
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
32
32
|
return handlePossibleAxiosErrors(async () => {
|
|
33
33
|
const { recepciones_rejections_webapp_table_id } = await getVariablesByName(
|
|
34
34
|
headers,
|
|
@@ -44,4 +44,4 @@ export async function saveRechazoCanastas(
|
|
|
44
44
|
|
|
45
45
|
return response;
|
|
46
46
|
});
|
|
47
|
-
}
|
|
47
|
+
};
|
|
@@ -30,9 +30,9 @@ export const TEXT_PAYEE_CATEGORY_NAME_FOR_PRICE = "CAT-LABORATORIO: ";
|
|
|
30
30
|
* @param headers
|
|
31
31
|
* @returns
|
|
32
32
|
*/
|
|
33
|
-
export
|
|
33
|
+
export const getClientesLaboratorio = (
|
|
34
34
|
session: Session
|
|
35
|
-
): Promise<AxiosUtilsResponse<PayeeGraphQL[]>> {
|
|
35
|
+
): Promise<AxiosUtilsResponse<PayeeGraphQL[]>> => {
|
|
36
36
|
return handlePossibleAxiosErrors(async () => {
|
|
37
37
|
const clientesResponse = await getPayeeCategoriesByNotesMatch(
|
|
38
38
|
session,
|
|
@@ -48,7 +48,7 @@ export async function getClientesLaboratorio(
|
|
|
48
48
|
|
|
49
49
|
return clientes;
|
|
50
50
|
});
|
|
51
|
-
}
|
|
51
|
+
};
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* createNewLaboratoryClient
|
|
@@ -57,10 +57,10 @@ export async function getClientesLaboratorio(
|
|
|
57
57
|
* @param body
|
|
58
58
|
* @returns
|
|
59
59
|
*/
|
|
60
|
-
export
|
|
60
|
+
export const createNewLaboratoryClient = (
|
|
61
61
|
headers: any,
|
|
62
62
|
body: Partial<PayeeGraphQL>
|
|
63
|
-
): Promise<AxiosUtilsResponse<boolean>> {
|
|
63
|
+
): Promise<AxiosUtilsResponse<boolean>> => {
|
|
64
64
|
return handlePossibleAxiosErrors(async () => {
|
|
65
65
|
const sendBody = {
|
|
66
66
|
...body,
|
|
@@ -80,7 +80,7 @@ export async function createNewLaboratoryClient(
|
|
|
80
80
|
|
|
81
81
|
return true;
|
|
82
82
|
});
|
|
83
|
-
}
|
|
83
|
+
};
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* createNewLaboratoryClientCategoryPrice
|
|
@@ -89,10 +89,10 @@ export async function createNewLaboratoryClient(
|
|
|
89
89
|
* @param body
|
|
90
90
|
* @returns
|
|
91
91
|
*/
|
|
92
|
-
export
|
|
92
|
+
export const updateLaboratoryClientCategoryPrice = (
|
|
93
93
|
headers: any,
|
|
94
94
|
body: Partial<PayeeCategoryGraphQL>
|
|
95
|
-
): Promise<AxiosUtilsResponse<boolean>> {
|
|
95
|
+
): Promise<AxiosUtilsResponse<boolean>> => {
|
|
96
96
|
return handlePossibleAxiosErrors(async () => {
|
|
97
97
|
const sendBody: Partial<PayeeCategoryGraphQL> = {
|
|
98
98
|
...body,
|
|
@@ -110,7 +110,7 @@ export async function updateLaboratoryClientCategoryPrice(
|
|
|
110
110
|
|
|
111
111
|
return true;
|
|
112
112
|
});
|
|
113
|
-
}
|
|
113
|
+
};
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* createNewLaboratoryClientCategoryPrice
|
|
@@ -119,11 +119,11 @@ export async function updateLaboratoryClientCategoryPrice(
|
|
|
119
119
|
* @param body
|
|
120
120
|
* @returns
|
|
121
121
|
*/
|
|
122
|
-
export
|
|
122
|
+
export const createNewLaboratoryClientCategoryPrice = (
|
|
123
123
|
headers: any,
|
|
124
124
|
session: Session,
|
|
125
125
|
body: Partial<PayeeCategoryGraphQL>
|
|
126
|
-
): Promise<AxiosUtilsResponse<boolean>> {
|
|
126
|
+
): Promise<AxiosUtilsResponse<boolean>> => {
|
|
127
127
|
return handlePossibleAxiosErrors(async () => {
|
|
128
128
|
const sendBody: Partial<PayeeCategoryGraphQL> = {
|
|
129
129
|
...body,
|
|
@@ -191,7 +191,7 @@ export async function createNewLaboratoryClientCategoryPrice(
|
|
|
191
191
|
}
|
|
192
192
|
return true;
|
|
193
193
|
});
|
|
194
|
-
}
|
|
194
|
+
};
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* deleteLaboratoryClientCategoryPrice
|
|
@@ -199,10 +199,10 @@ export async function createNewLaboratoryClientCategoryPrice(
|
|
|
199
199
|
* @param body
|
|
200
200
|
* @returns
|
|
201
201
|
*/
|
|
202
|
-
export
|
|
202
|
+
export const deleteLaboratoryClientCategoryPrice = (
|
|
203
203
|
headers: any,
|
|
204
204
|
body: Partial<PayeeCategoryGraphQL>
|
|
205
|
-
): Promise<AxiosUtilsResponse<boolean>> {
|
|
205
|
+
): Promise<AxiosUtilsResponse<boolean>> => {
|
|
206
206
|
return handlePossibleAxiosErrors(async () => {
|
|
207
207
|
//Elimino la categoría
|
|
208
208
|
await deletePayeeCategory(headers, body.id ?? "");
|
|
@@ -210,4 +210,4 @@ export async function deleteLaboratoryClientCategoryPrice(
|
|
|
210
210
|
await deletePriceList(headers, body.price_list_id ?? "");
|
|
211
211
|
return true;
|
|
212
212
|
});
|
|
213
|
-
}
|
|
213
|
+
};
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import type { Session } from "@remix-run/node";
|
|
2
2
|
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import {
|
|
4
|
+
createWebAppTableRegister,
|
|
5
|
+
deleteWebAppTableRegister,
|
|
6
|
+
getVariablesByName,
|
|
7
|
+
getWebAppTableRegisters,
|
|
8
|
+
updateWebAppTableRegister,
|
|
9
|
+
} from "@zauru-sdk/services";
|
|
10
|
+
import {
|
|
11
|
+
AxiosUtilsResponse,
|
|
12
|
+
SpecialItem,
|
|
13
|
+
WebAppRowGraphQL,
|
|
14
|
+
WebAppTableUpdateResponse,
|
|
15
|
+
} from "@zauru-sdk/types";
|
|
6
16
|
|
|
7
17
|
/**
|
|
8
18
|
* Get specialItems from the web app table.
|
|
@@ -10,10 +20,10 @@ import { AxiosUtilsResponse, SpecialItem, WebAppRowGraphQL, WebAppTableUpdateRes
|
|
|
10
20
|
* @param session Session object.
|
|
11
21
|
* @returns A Promise of AxiosUtilsResponse<WebAppRowGraphQL<SpecialItem>[]>>.
|
|
12
22
|
*/
|
|
13
|
-
export
|
|
23
|
+
export const getSpecialItems = (
|
|
14
24
|
headers: any,
|
|
15
25
|
session: Session
|
|
16
|
-
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<SpecialItem>[]>> {
|
|
26
|
+
): Promise<AxiosUtilsResponse<WebAppRowGraphQL<SpecialItem>[]>> => {
|
|
17
27
|
return handlePossibleAxiosErrors(async () => {
|
|
18
28
|
const { special_product_web_app_table_id } = await getVariablesByName(
|
|
19
29
|
headers,
|
|
@@ -36,7 +46,7 @@ export async function getSpecialItems(
|
|
|
36
46
|
|
|
37
47
|
return specialItems;
|
|
38
48
|
});
|
|
39
|
-
}
|
|
49
|
+
};
|
|
40
50
|
|
|
41
51
|
/**
|
|
42
52
|
* Create a specialItem in the web app table.
|
|
@@ -45,11 +55,11 @@ export async function getSpecialItems(
|
|
|
45
55
|
* @param body SpecialItem data to be created.
|
|
46
56
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
47
57
|
*/
|
|
48
|
-
export
|
|
58
|
+
export const createSpecialItem = (
|
|
49
59
|
headers: any,
|
|
50
60
|
session: Session,
|
|
51
61
|
body: SpecialItem
|
|
52
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
62
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
53
63
|
return handlePossibleAxiosErrors(async () => {
|
|
54
64
|
const { special_product_web_app_table_id } = await getVariablesByName(
|
|
55
65
|
headers,
|
|
@@ -63,7 +73,7 @@ export async function createSpecialItem(
|
|
|
63
73
|
);
|
|
64
74
|
return response;
|
|
65
75
|
});
|
|
66
|
-
}
|
|
76
|
+
};
|
|
67
77
|
|
|
68
78
|
/**
|
|
69
79
|
* Delete a specialItem from the web app table.
|
|
@@ -72,11 +82,11 @@ export async function createSpecialItem(
|
|
|
72
82
|
* @param id ID of the specialItem to be deleted.
|
|
73
83
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
74
84
|
*/
|
|
75
|
-
export
|
|
85
|
+
export const deleteSpecialItem = (
|
|
76
86
|
headers: any,
|
|
77
87
|
session: Session,
|
|
78
88
|
id: string
|
|
79
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
89
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
80
90
|
return handlePossibleAxiosErrors(async () => {
|
|
81
91
|
const { special_product_web_app_table_id } = await getVariablesByName(
|
|
82
92
|
headers,
|
|
@@ -91,7 +101,7 @@ export async function deleteSpecialItem(
|
|
|
91
101
|
);
|
|
92
102
|
return response;
|
|
93
103
|
});
|
|
94
|
-
}
|
|
104
|
+
};
|
|
95
105
|
|
|
96
106
|
/**
|
|
97
107
|
* Update a specialItem in the web app table.
|
|
@@ -101,12 +111,12 @@ export async function deleteSpecialItem(
|
|
|
101
111
|
* @param body Updated specialItem data.
|
|
102
112
|
* @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
|
|
103
113
|
*/
|
|
104
|
-
export
|
|
114
|
+
export const updateSpecialItem = (
|
|
105
115
|
headers: any,
|
|
106
116
|
session: Session,
|
|
107
117
|
id: string,
|
|
108
118
|
body: Partial<SpecialItem>
|
|
109
|
-
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> {
|
|
119
|
+
): Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>> => {
|
|
110
120
|
return handlePossibleAxiosErrors(async () => {
|
|
111
121
|
const { special_product_web_app_table_id } = await getVariablesByName(
|
|
112
122
|
headers,
|
|
@@ -123,4 +133,4 @@ export async function updateSpecialItem(
|
|
|
123
133
|
|
|
124
134
|
return response;
|
|
125
135
|
});
|
|
126
|
-
}
|
|
136
|
+
};
|