@zauru-sdk/graphql 2.25.2 → 2.26.3

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.
@@ -6,8 +6,8 @@ export declare const getPurchaseOrderStringQuery: (id: number, config?: {
6
6
  withReceptions: boolean;
7
7
  }) => string;
8
8
  export declare const getShipmentsStringQuery: ({ agency_to_id, agency_from_id, suffix, voided, delivered, shipped, returned, id_number_not_null, id_number, id_number_not_empty, withMovementLots, withPurchaseOrdersByShipmentReference, limit, id, wheres, memoILike, plannedShippingDateRange, plannedDeliveryDateRange, }: {
9
- agency_to_id?: number;
10
- agency_from_id?: number;
9
+ agency_to_id?: number | number[];
10
+ agency_from_id?: number | number[];
11
11
  suffix?: string;
12
12
  id_number_not_null?: boolean;
13
13
  voided?: boolean;
@@ -46,7 +46,6 @@ export declare const getPurchaseOrdersBetweenDatesStringQuery: (startDate: strin
46
46
  payeeId?: number | string;
47
47
  consolidateIdFilter?: boolean;
48
48
  lotItemIdExclusion?: number;
49
- poDetailTagId?: number;
50
49
  withLotStocks?: boolean;
51
50
  betweenIssueDate?: boolean;
52
51
  id_number?: string;
@@ -61,6 +60,7 @@ export declare const getPurchaseOrdersBetweenDatesStringQuery: (startDate: strin
61
60
  discountComparisonOperator?: "_eq" | "_neq" | "_gte" | "_lte" | "_gt" | "_lt";
62
61
  discount?: number;
63
62
  excludeVoided?: boolean;
63
+ tagId?: number | string;
64
64
  }) => string;
65
65
  export declare const getPayeesStringQuery: (filters?: {
66
66
  id_number?: string;
@@ -202,10 +202,20 @@ exports.getPurchaseOrderStringQuery = getPurchaseOrderStringQuery;
202
202
  const getShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix, voided, delivered, shipped, returned, id_number_not_null = false, id_number, id_number_not_empty = false, withMovementLots = false, withPurchaseOrdersByShipmentReference = false, limit = 1000, id, wheres, memoILike, plannedShippingDateRange, plannedDeliveryDateRange, }) => {
203
203
  let conditions = [];
204
204
  if (agency_to_id) {
205
- conditions.push(`agency_to_id: {_eq: ${agency_to_id}}`);
205
+ if (Array.isArray(agency_to_id)) {
206
+ conditions.push(`agency_to_id: {_in: [${agency_to_id.join(", ")}]}`);
207
+ }
208
+ else {
209
+ conditions.push(`agency_to_id: {_eq: ${agency_to_id}}`);
210
+ }
206
211
  }
207
212
  if (agency_from_id) {
208
- conditions.push(`agency_from_id: {_eq: ${agency_from_id}}`);
213
+ if (Array.isArray(agency_from_id)) {
214
+ conditions.push(`agency_from_id: {_in: [${agency_from_id.join(", ")}]}`);
215
+ }
216
+ else {
217
+ conditions.push(`agency_from_id: {_eq: ${agency_from_id}}`);
218
+ }
209
219
  }
210
220
  // Merge all id_number conditions into a single object to avoid duplicate keys
211
221
  const idNumberConditions = [];
@@ -438,9 +448,6 @@ const getPurchaseOrdersBetweenDatesStringQuery = (startDate, endDate, config) =>
438
448
  purchaseOrderDetailsConditions.push(`item_id: { _eq: ${config.itemId} }`);
439
449
  }
440
450
  }
441
- if (config.poDetailTagId) {
442
- purchaseOrderDetailsConditions.push(`tag_id: { _eq: ${config.poDetailTagId} }`);
443
- }
444
451
  if (purchaseOrderDetailsConditions.length > 0) {
445
452
  conditions.push(`purchase_order_details: { ${purchaseOrderDetailsConditions.join(", ")} }`);
446
453
  }
@@ -463,6 +470,9 @@ const getPurchaseOrdersBetweenDatesStringQuery = (startDate, endDate, config) =>
463
470
  if (!!config.discountComparisonOperator && !!config.discount) {
464
471
  conditions.push(`discount: { ${config.discountComparisonOperator}: ${config.discount} }`);
465
472
  }
473
+ if (config.tagId) {
474
+ conditions.push(`taggings: { tag_id: { _eq: ${config.tagId} } }`);
475
+ }
466
476
  const whereClause = conditions.length
467
477
  ? `where: { ${conditions.join(", ")} }`
468
478
  : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.25.2",
3
+ "version": "2.26.3",
4
4
  "description": "Queries de uso común para las aplicación de Zauru.",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -21,5 +21,5 @@
21
21
  "devDependencies": {
22
22
  "typescript": "^5.1.6"
23
23
  },
24
- "gitHead": "2cb51ed168e3e4df68625aecd1be63ff987977b3"
24
+ "gitHead": "b5c8ca28480c2cc45c7454d04ab72c26795ec97b"
25
25
  }