@zauru-sdk/graphql 1.0.68 → 1.0.69

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.
@@ -15,6 +15,7 @@ export declare const getPurchaseOrdersBetweenDatesStringQuery: (config?: {
15
15
  poDetailTagId?: number;
16
16
  withLotStocks?: boolean;
17
17
  betweenIssueDate?: boolean;
18
+ id_number?: string;
18
19
  }) => string;
19
20
  export declare const getPayeesStringQuery = "\nquery getPayees {\n payees {\n id\n id_number\n name\n tin\n vendor\n address_line_1\n }\n}\n";
20
21
  export declare const getProvidersStringQuery = "\nquery getProviders {\n payees (where: {vendor: {_eq: true}}) {\n id\n id_number\n name\n tin\n address_line_1\n }\n}\n";
@@ -209,12 +209,12 @@ const getPurchaseOrdersBetweenDatesStringQuery = (config = {
209
209
  withLotStocks: false,
210
210
  betweenIssueDate: false,
211
211
  }) => `
212
- query getPurchaseOrdersBetweenDates(
213
- $startDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
214
- $endDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
215
- $lotItemIdExclusion: Int = null,
216
- $poDetailTagId: Int = null
217
- ) {
212
+ query getPurchaseOrdersBetweenDates ${config.id_number
213
+ ? ""
214
+ : `(
215
+ $startDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
216
+ $endDate: ${config?.betweenIssueDate ? "date" : "timestamp"}
217
+ )`} {
218
218
  purchase_orders (
219
219
  order_by: {id: desc},
220
220
  where: {
@@ -238,15 +238,18 @@ query getPurchaseOrdersBetweenDates(
238
238
  },`
239
239
  : ""}
240
240
  ${config.lotItemIdExclusion
241
- ? "lots: {item_id: {_neq: $lotItemIdExclusion}},"
241
+ ? `lots: {item_id: {_neq: ${config.lotItemIdExclusion}}},`
242
242
  : ""}
243
243
  ${config.poDetailTagId
244
- ? "purchase_order_details: {tag_id: {_eq: $poDetailTagId}},"
244
+ ? `purchase_order_details: {tag_id: {_eq: ${config.poDetailTagId}}},`
245
245
  : ""}
246
246
  ${config.consolidateIdFilter ? "consolidate_id: {_is_null: true}," : ""}
247
- ${config.betweenIssueDate
248
- ? "issue_date: {_gte: $startDate, _lte: $endDate}"
249
- : "created_at: {_gte: $startDate, _lte: $endDate}"}
247
+ ${config.id_number ? `id_number: {_ilike: "%${config.id_number}%"}` : ""}
248
+ ${config.id_number
249
+ ? ""
250
+ : config.betweenIssueDate
251
+ ? "issue_date: {_gte: $startDate, _lte: $endDate}"
252
+ : "created_at: {_gte: $startDate, _lte: $endDate}"}
250
253
  }
251
254
  ) {
252
255
  id
@@ -209,12 +209,12 @@ const getPurchaseOrdersBetweenDatesStringQuery = (config = {
209
209
  withLotStocks: false,
210
210
  betweenIssueDate: false,
211
211
  }) => `
212
- query getPurchaseOrdersBetweenDates(
213
- $startDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
214
- $endDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
215
- $lotItemIdExclusion: Int = null,
216
- $poDetailTagId: Int = null
217
- ) {
212
+ query getPurchaseOrdersBetweenDates ${config.id_number
213
+ ? ""
214
+ : `(
215
+ $startDate: ${config?.betweenIssueDate ? "date" : "timestamp"},
216
+ $endDate: ${config?.betweenIssueDate ? "date" : "timestamp"}
217
+ )`} {
218
218
  purchase_orders (
219
219
  order_by: {id: desc},
220
220
  where: {
@@ -238,15 +238,18 @@ query getPurchaseOrdersBetweenDates(
238
238
  },`
239
239
  : ""}
240
240
  ${config.lotItemIdExclusion
241
- ? "lots: {item_id: {_neq: $lotItemIdExclusion}},"
241
+ ? `lots: {item_id: {_neq: ${config.lotItemIdExclusion}}},`
242
242
  : ""}
243
243
  ${config.poDetailTagId
244
- ? "purchase_order_details: {tag_id: {_eq: $poDetailTagId}},"
244
+ ? `purchase_order_details: {tag_id: {_eq: ${config.poDetailTagId}}},`
245
245
  : ""}
246
246
  ${config.consolidateIdFilter ? "consolidate_id: {_is_null: true}," : ""}
247
- ${config.betweenIssueDate
248
- ? "issue_date: {_gte: $startDate, _lte: $endDate}"
249
- : "created_at: {_gte: $startDate, _lte: $endDate}"}
247
+ ${config.id_number ? `id_number: {_ilike: "%${config.id_number}%"}` : ""}
248
+ ${config.id_number
249
+ ? ""
250
+ : config.betweenIssueDate
251
+ ? "issue_date: {_gte: $startDate, _lte: $endDate}"
252
+ : "created_at: {_gte: $startDate, _lte: $endDate}"}
250
253
  }
251
254
  ) {
252
255
  id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "Queries de uso común para las aplicación de Zauru.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -22,5 +22,5 @@
22
22
  "devDependencies": {
23
23
  "typescript": "^5.1.6"
24
24
  },
25
- "gitHead": "907be35569dc738a582858bb47d96910ab5dcec3"
25
+ "gitHead": "46dd382e956e8b34c2a65ef078d8fddb2cdd434c"
26
26
  }