@zauru-sdk/graphql 2.0.184 → 2.0.186

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.
@@ -73,7 +73,9 @@ export declare const getItemsStringQuery = "\nquery getItems {\n items (where:
73
73
  export declare const getItemsBySuperCategoryStringQuery: (id: number, agency_id: number) => string;
74
74
  export declare const getConsolidatesBetweenDatesStringQuery: (startDate: string, endDate: string) => string;
75
75
  export declare const getEmployeeProfileStringQuery: (id: number) => string;
76
- export declare const getEmployeesStringQuery = "\nquery getEmployees {\n employees {\n name\n id\n user_id\n email\n seller\n accountant\n buyer\n support_agent\n inventory_controller\n active\n position\n }\n}\n";
76
+ export declare const getEmployeesStringQuery: (filters?: {
77
+ id?: number;
78
+ }) => string;
77
79
  export declare const getEmployeesByAgencyIdStringQuery: (id: number) => string;
78
80
  export declare const getBundlesByItemCategoryIdStringQuery: (id: number) => string;
79
81
  export declare const getBundleByNameStringQuery: (name: string) => string;
@@ -132,6 +134,7 @@ export declare const getInvoicesByAgencyIdStringQuery: (id: number, filters: {
132
134
  invoice_id?: string;
133
135
  }) => string;
134
136
  export declare const getCasesStringQuery: (filters?: {
137
+ id?: number;
135
138
  responsible_id?: number;
136
139
  client_id?: number;
137
140
  closed?: boolean;
@@ -750,23 +750,33 @@ query getEmployeeProfile {
750
750
  }
751
751
  `;
752
752
  exports.getEmployeeProfileStringQuery = getEmployeeProfileStringQuery;
753
- exports.getEmployeesStringQuery = `
753
+ const getEmployeesStringQuery = (filters) => {
754
+ const conditions = [];
755
+ if (filters?.id) {
756
+ conditions.push(`id: {_eq: ${filters.id}}`);
757
+ }
758
+ const whereClause = conditions.length
759
+ ? `where: { ${conditions.join(", ")} },`
760
+ : "";
761
+ return `
754
762
  query getEmployees {
755
- employees {
756
- name
757
- id
758
- user_id
759
- email
760
- seller
761
- accountant
762
- buyer
763
- support_agent
764
- inventory_controller
765
- active
766
- position
763
+ employees (${whereClause} order_by: {id: desc}) {
764
+ name
765
+ id
766
+ user_id
767
+ email
768
+ seller
769
+ accountant
770
+ buyer
771
+ support_agent
772
+ inventory_controller
773
+ active
774
+ position
775
+ }
767
776
  }
768
- }
769
- `;
777
+ `;
778
+ };
779
+ exports.getEmployeesStringQuery = getEmployeesStringQuery;
770
780
  const getEmployeesByAgencyIdStringQuery = (id) => `
771
781
  query getEmployeesByAgencyId {
772
782
  employees(where: {agency_id: {_eq: ${id}}}) {
@@ -1535,6 +1545,9 @@ query getInvoicesByAgencyId {
1535
1545
  exports.getInvoicesByAgencyIdStringQuery = getInvoicesByAgencyIdStringQuery;
1536
1546
  const getCasesStringQuery = (filters) => {
1537
1547
  const conditions = [];
1548
+ if (filters?.id) {
1549
+ conditions.push(`id: {_eq: ${filters.id}}`);
1550
+ }
1538
1551
  if (filters?.responsible_id) {
1539
1552
  conditions.push(`responsible_id: {_eq: ${filters.responsible_id}}`);
1540
1553
  }
@@ -1590,6 +1603,8 @@ const getCasesStringQuery = (filters) => {
1590
1603
  id
1591
1604
  item_id
1592
1605
  quantity
1606
+ unit_price
1607
+ price
1593
1608
  }
1594
1609
  submission_cases {
1595
1610
  id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.0.184",
3
+ "version": "2.0.186",
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": "04f5abcf077387b2dc0069077aae0f598f5b656b"
24
+ "gitHead": "ac66c630f3321403498b88e85be6bd8ad7655493"
25
25
  }