@zauru-sdk/graphql 2.0.160 → 2.0.164

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.
@@ -23,9 +23,13 @@ export declare const getShipmentsStringQuery: ({ agency_to_id, agency_from_id, s
23
23
  }) => string;
24
24
  export declare const getLotsByNameStringQuery: (name: string, entity_id: number) => string;
25
25
  export declare const getLotStocksByAgencyIdStringQuery: (agency_id: number) => string;
26
+ export declare const getSerialsStringQuery: (filters: {
27
+ name?: string;
28
+ }) => string;
26
29
  export declare const getPurchaseOrdersBetweenDatesStringQuery: (startDate: string, endDate: string, config: {
27
30
  agencyId?: number | string;
28
31
  itemId?: number | string;
32
+ reference?: string;
29
33
  payeeCategoryId?: number | string;
30
34
  payeeId?: number | string;
31
35
  consolidateIdFilter?: boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPrintTemplatesStringQuery = exports.getCasesByResponsibleIdStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getLastInvoiceFormSubmissionStringQuery = exports.getInvoiceFormSubmissionsByAgencyIdStringQuery = exports.getFormSubmissionByIdStringQuery = exports.getMyCaseFormSubmissionsStringQuery = exports.getFormsByDocumentTypeStringQuery = exports.getFormsStringQuery = exports.getFormByNameStringQuery = exports.getAllFormsStringQuery = exports.getItemByNameStringQuery = exports.getBundleByNameStringQuery = exports.getBundlesByItemCategoryIdStringQuery = exports.getEmployeesByAgencyIdStringQuery = exports.getEmployeesStringQuery = exports.getEmployeeProfileStringQuery = exports.getConsolidatesBetweenDatesStringQuery = exports.getItemsBySuperCategoryStringQuery = exports.getItemsStringQuery = exports.getItemsByCategoryStringQuery = exports.getItemCategoryByIdStringQuery = exports.getSuperCategoryByIdStringQuery = exports.getPayeeByIdStringQuery = exports.getClientCategoriesStringQuery = exports.getProviderCategoriesStringQuery = exports.getPayeeCategoriesStringQuery = exports.getPayeeCategoriesByNotesMatchStringQuery = exports.getPayeeCategoryByIdStringQuery = exports.getWebAppRowsByWebAppTableIdStringQuery = exports.getWebAppRowStringQuery = exports.getAgenciesStringQuery = exports.getProvidersStringQuery = exports.getPayeesStringQuery = exports.getPurchaseOrdersBetweenDatesStringQuery = exports.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
3
+ exports.getPrintTemplatesStringQuery = exports.getCasesByResponsibleIdStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getLastInvoiceFormSubmissionStringQuery = exports.getInvoiceFormSubmissionsByAgencyIdStringQuery = exports.getFormSubmissionByIdStringQuery = exports.getMyCaseFormSubmissionsStringQuery = exports.getFormsByDocumentTypeStringQuery = exports.getFormsStringQuery = exports.getFormByNameStringQuery = exports.getAllFormsStringQuery = exports.getItemByNameStringQuery = exports.getBundleByNameStringQuery = exports.getBundlesByItemCategoryIdStringQuery = exports.getEmployeesByAgencyIdStringQuery = exports.getEmployeesStringQuery = exports.getEmployeeProfileStringQuery = exports.getConsolidatesBetweenDatesStringQuery = exports.getItemsBySuperCategoryStringQuery = exports.getItemsStringQuery = exports.getItemsByCategoryStringQuery = exports.getItemCategoryByIdStringQuery = exports.getSuperCategoryByIdStringQuery = exports.getPayeeByIdStringQuery = exports.getClientCategoriesStringQuery = exports.getProviderCategoriesStringQuery = exports.getPayeeCategoriesStringQuery = exports.getPayeeCategoriesByNotesMatchStringQuery = exports.getPayeeCategoryByIdStringQuery = exports.getWebAppRowsByWebAppTableIdStringQuery = exports.getWebAppRowStringQuery = exports.getAgenciesStringQuery = exports.getProvidersStringQuery = exports.getPayeesStringQuery = exports.getPurchaseOrdersBetweenDatesStringQuery = exports.getSerialsStringQuery = exports.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
4
4
  const getLast100ReceptionsStringQuery = (agency_id) => `
5
5
  query getLast100Receptions {
6
6
  purchase_orders(limit: 100, order_by: {created_at: desc}, where: {voided: {_eq: false}, agency_id: {_eq: ${agency_id}}}) {
@@ -289,6 +289,34 @@ query getLotStocksByAgencyId {
289
289
  }
290
290
  `;
291
291
  exports.getLotStocksByAgencyIdStringQuery = getLotStocksByAgencyIdStringQuery;
292
+ const getSerialsStringQuery = (filters) => {
293
+ const conditions = [];
294
+ if (filters.name) {
295
+ conditions.push(`name: {_ilike: "%${filters.name}%"}`);
296
+ }
297
+ const whereClause = conditions.length
298
+ ? `where: { ${conditions.join(", ")} }`
299
+ : "";
300
+ return `
301
+ query getSerials {
302
+ serials (
303
+ order_by: { id: desc },
304
+ ${whereClause}
305
+ ) {
306
+ id
307
+ id_number
308
+ name
309
+ description
310
+ item_id
311
+ entity_id
312
+ agency_id
313
+ agency_future_id
314
+ created_at
315
+ }
316
+ }
317
+ `;
318
+ };
319
+ exports.getSerialsStringQuery = getSerialsStringQuery;
292
320
  const getPurchaseOrdersBetweenDatesStringQuery = (startDate, endDate, config) => {
293
321
  const conditions = [];
294
322
  if (config.excludeVoided) {
@@ -327,6 +355,14 @@ const getPurchaseOrdersBetweenDatesStringQuery = (startDate, endDate, config) =>
327
355
  conditions.push(`purchase_order_details: { item_id: { _eq: ${config.itemId} } }`);
328
356
  }
329
357
  }
358
+ if (config.reference) {
359
+ if (config.reference.toString().includes(",")) {
360
+ conditions.push(`reference: { _in: [${config.reference}] }`);
361
+ }
362
+ else {
363
+ conditions.push(`reference: { _eq: "${config.reference}" }`);
364
+ }
365
+ }
330
366
  if (config.lotItemIdExclusion) {
331
367
  conditions.push(`lots: { item_id: { _neq: ${config.lotItemIdExclusion} } }`);
332
368
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.0.160",
3
+ "version": "2.0.164",
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": "c091846ffc5e1c360a9a5550f0acba3697d4f1f6"
24
+ "gitHead": "44804384967c4f4a6315c49550b464b79b55a06a"
25
25
  }