@zauru-sdk/utils 2.31.0 → 2.32.2

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.
@@ -1,5 +1,5 @@
1
1
  import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
2
- import { createWebAppTableRegister, deleteWebAppTableRegister, getVariablesByName, getWebAppTableRegisters, updateWebAppTableRegister, } from "@zauru-sdk/services";
2
+ import { associateWebAppTableRegister, createWebAppTableRegister, deleteWebAppTableRegister, getVariablesByName, getWebAppTableRegisters, updateWebAppTableRegister, } from "@zauru-sdk/services";
3
3
  /**
4
4
  * Get programaciones from the web app table.
5
5
  * @param headers Request headers.
@@ -45,6 +45,21 @@ export const deleteProgramacion = (headers, session, id) => {
45
45
  return response;
46
46
  });
47
47
  };
48
+ /**
49
+ * Associate a PurchaseOrder to an existing programacion.
50
+ * @param headers Request headers.
51
+ * @param session Session object.
52
+ * @param id ID of the programacion (webapp row) to associate to.
53
+ * @param purchase_order_id ID of the PurchaseOrder to associate.
54
+ * @returns A Promise of AxiosUtilsResponse<WebAppRowAssociateResponse>.
55
+ */
56
+ export const associatePurchaseOrderToProgramacion = (headers, session, id, purchase_order_id) => {
57
+ return handlePossibleAxiosErrors(async () => {
58
+ const { programaciones_webapp_table_id } = await getVariablesByName(headers, session, ["programaciones_webapp_table_id"]);
59
+ const response = await associateWebAppTableRegister(headers, programaciones_webapp_table_id, Number(id), { temp_purchase_order_id: purchase_order_id });
60
+ return response;
61
+ });
62
+ };
48
63
  /**
49
64
  * Update a programacion in the web app table.
50
65
  * @param headers Request headers.
@@ -1,5 +1,5 @@
1
1
  import type { Session } from "@remix-run/node";
2
- import { WebAppRowGraphQL, Programacion, AxiosUtilsResponse, WebAppTableUpdateResponse } from "@zauru-sdk/types";
2
+ import { AxiosUtilsResponse, Programacion, WebAppRowAssociateResponse, WebAppRowGraphQL, WebAppTableUpdateResponse } from "@zauru-sdk/types";
3
3
  /**
4
4
  * Get programaciones from the web app table.
5
5
  * @param headers Request headers.
@@ -23,6 +23,15 @@ export declare const createProgramacion: (headers: any, session: Session, body:
23
23
  * @returns A Promise of AxiosUtilsResponse<WebAppTableUpdateResponse>.
24
24
  */
25
25
  export declare const deleteProgramacion: (headers: any, session: Session, id: string) => Promise<AxiosUtilsResponse<WebAppTableUpdateResponse>>;
26
+ /**
27
+ * Associate a PurchaseOrder to an existing programacion.
28
+ * @param headers Request headers.
29
+ * @param session Session object.
30
+ * @param id ID of the programacion (webapp row) to associate to.
31
+ * @param purchase_order_id ID of the PurchaseOrder to associate.
32
+ * @returns A Promise of AxiosUtilsResponse<WebAppRowAssociateResponse>.
33
+ */
34
+ export declare const associatePurchaseOrderToProgramacion: (headers: any, session: Session, id: string, purchase_order_id: number | string) => Promise<AxiosUtilsResponse<WebAppRowAssociateResponse>>;
26
35
  /**
27
36
  * Update a programacion in the web app table.
28
37
  * @param headers Request headers.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/utils",
3
- "version": "2.31.0",
3
+ "version": "2.32.2",
4
4
  "description": "Utilidades, parseo de request y demás para desarrollo de webapps de Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -24,11 +24,11 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@remix-run/node": "^2.8.1",
27
- "@zauru-sdk/common": "^2.30.0",
28
- "@zauru-sdk/config": "^2.23.1",
29
- "@zauru-sdk/graphql": "^2.26.3",
30
- "@zauru-sdk/services": "^2.30.0",
31
- "@zauru-sdk/types": "^2.30.0"
27
+ "@zauru-sdk/common": "^2.32.2",
28
+ "@zauru-sdk/config": "^2.32.0",
29
+ "@zauru-sdk/graphql": "^2.32.0",
30
+ "@zauru-sdk/services": "^2.32.2",
31
+ "@zauru-sdk/types": "^2.32.2"
32
32
  },
33
- "gitHead": "2f9ee02a1ef76fbf71637b8455e4840786489628"
33
+ "gitHead": "a576adb455249b281fd063c8ff911a87ce60ae0b"
34
34
  }