@zauru-sdk/graphql 2.0.166 → 2.0.174

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.
@@ -128,5 +128,9 @@ export declare const getInvoicesByAgencyIdStringQuery: (id: number, filters: {
128
128
  tag_id?: string;
129
129
  invoice_id?: string;
130
130
  }) => string;
131
- export declare const getCasesByResponsibleIdStringQuery: (responsible_id: number, wheres?: string[]) => string;
131
+ export declare const getCasesStringQuery: (filters?: {
132
+ responsible_id?: number;
133
+ client_id?: number;
134
+ closed?: boolean;
135
+ }) => string;
132
136
  export declare const getPrintTemplatesStringQuery = "\nquery getPrintTemplates {\n print_templates {\n id\n name\n }\n}\n";
@@ -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.getSerialsStringQuery = exports.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
3
+ exports.getPrintTemplatesStringQuery = exports.getCasesStringQuery = 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}}}) {
@@ -1478,11 +1478,23 @@ query getInvoicesByAgencyId {
1478
1478
  }
1479
1479
  `;
1480
1480
  exports.getInvoicesByAgencyIdStringQuery = getInvoicesByAgencyIdStringQuery;
1481
- const getCasesByResponsibleIdStringQuery = (responsible_id, wheres = []) => {
1482
- const additionalWheres = wheres.join(",");
1483
- return `
1484
- query getCasesByResponsibleId {
1485
- cases(where: {responsible_id: {_eq: ${responsible_id}}${additionalWheres.length > 0 ? "," : ""}${additionalWheres}}, order_by: {id: desc}) {
1481
+ const getCasesStringQuery = (filters) => {
1482
+ const conditions = [];
1483
+ if (filters?.responsible_id) {
1484
+ conditions.push(`responsible_id: {_eq: ${filters.responsible_id}}`);
1485
+ }
1486
+ if (filters?.client_id) {
1487
+ conditions.push(`client_id: {_eq: ${filters.client_id}}`);
1488
+ }
1489
+ if (filters?.closed !== undefined) {
1490
+ conditions.push(`closed: {_eq: ${filters.closed}}`);
1491
+ }
1492
+ const whereClause = conditions.length
1493
+ ? `where: { ${conditions.join(", ")} },`
1494
+ : "";
1495
+ return `query getCases {
1496
+ cases (${whereClause} order_by: {id: desc})
1497
+ {
1486
1498
  id
1487
1499
  id_number
1488
1500
  serial_id
@@ -1503,6 +1515,9 @@ const getCasesByResponsibleIdStringQuery = (responsible_id, wheres = []) => {
1503
1515
  courtesy
1504
1516
  client {
1505
1517
  name
1518
+ tin
1519
+ email
1520
+ phone
1506
1521
  address_line_1
1507
1522
  }
1508
1523
  case_invoices {
@@ -1514,12 +1529,13 @@ const getCasesByResponsibleIdStringQuery = (responsible_id, wheres = []) => {
1514
1529
  case_supplies {
1515
1530
  id
1516
1531
  item_id
1532
+ quantity
1517
1533
  }
1518
- }
1519
1534
  }
1520
- `;
1535
+ }
1536
+ `;
1521
1537
  };
1522
- exports.getCasesByResponsibleIdStringQuery = getCasesByResponsibleIdStringQuery;
1538
+ exports.getCasesStringQuery = getCasesStringQuery;
1523
1539
  exports.getPrintTemplatesStringQuery = `
1524
1540
  query getPrintTemplates {
1525
1541
  print_templates {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.0.166",
3
+ "version": "2.0.174",
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": "39835f008adba7bc3f9d1ef997089a09c34ae322"
24
+ "gitHead": "193cebd0045eacd3451558583f7c4babc3a275e0"
25
25
  }