@zauru-sdk/graphql 6.11.0 → 6.13.0

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.
@@ -77,6 +77,9 @@ export declare const getPayeesStringQuery: (filters?: {
77
77
  name?: string;
78
78
  vendor?: boolean;
79
79
  tin?: string;
80
+ active?: boolean;
81
+ id_number_not_empty?: boolean;
82
+ id_number_not_null?: boolean;
80
83
  }) => string;
81
84
  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";
82
85
  export declare const getAgenciesStringQuery = "\nquery getAgencies {\n agencies {\n id\n name\n address_line_2\n }\n}\n";
@@ -183,6 +186,7 @@ export declare const getPaymentMethodsStringQuery: (config: {
183
186
  onlyActives: boolean;
184
187
  }) => string;
185
188
  export declare const getPaymentTermByIdStringQuery: (id: number) => string;
189
+ export declare const getPaymentByIdStringQuery: (id: number) => string;
186
190
  export declare const getInvoicesStringQuery: (options?: GetInvoicesOptions) => string;
187
191
  export declare const getInvoicesByAgencyIdStringQuery: (id: number, filters: {
188
192
  tag_id?: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCasesStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getInvoicesStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getCaseFormSubmissionsByCaseIdStringQuery = 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.getBookingByPurchaseOrderAndReferenceStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
4
- exports.getProductionWorkOrderStringQuery = exports.getPrintTemplatesStringQuery = void 0;
3
+ exports.getInvoicesByAgencyIdStringQuery = exports.getInvoicesStringQuery = exports.getPaymentByIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getCaseFormSubmissionsByCaseIdStringQuery = 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.getBookingByPurchaseOrderAndReferenceStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
4
+ exports.getProductionWorkOrderStringQuery = exports.getPrintTemplatesStringQuery = exports.getCasesStringQuery = void 0;
5
5
  const getLast100ReceptionsStringQuery = (agency_id) => {
6
6
  const conditions = ["voided: {_eq: false}"];
7
7
  if (agency_id) {
@@ -614,8 +614,18 @@ const getPurchaseOrdersBetweenDatesStringQuery = (startDate, endDate, config) =>
614
614
  exports.getPurchaseOrdersBetweenDatesStringQuery = getPurchaseOrdersBetweenDatesStringQuery;
615
615
  const getPayeesStringQuery = (filters) => {
616
616
  const conditions = [];
617
+ const idNumberConditions = [];
617
618
  if (filters?.id_number) {
618
- conditions.push(`id_number: { _ilike: "%${filters.id_number}%" }`);
619
+ idNumberConditions.push(`_ilike: "%${filters.id_number}%"`);
620
+ }
621
+ if (filters?.id_number_not_empty) {
622
+ idNumberConditions.push(`_neq: ""`);
623
+ }
624
+ if (filters?.id_number_not_null) {
625
+ idNumberConditions.push(`_is_null: false`);
626
+ }
627
+ if (idNumberConditions.length) {
628
+ conditions.push(`id_number: { ${idNumberConditions.join(", ")} }`);
619
629
  }
620
630
  if (filters?.name) {
621
631
  conditions.push(`name: { _ilike: "%${filters.name}%" }`);
@@ -626,6 +636,9 @@ const getPayeesStringQuery = (filters) => {
626
636
  if (filters?.tin) {
627
637
  conditions.push(`tin: { _eq: "${filters.tin}" }`);
628
638
  }
639
+ if (filters?.active !== undefined) {
640
+ conditions.push(`active: { _eq: ${filters.active} }`);
641
+ }
629
642
  const whereClause = conditions.length
630
643
  ? `where: { ${conditions.join(", ")} }`
631
644
  : "";
@@ -639,6 +652,7 @@ const getPayeesStringQuery = (filters) => {
639
652
  name
640
653
  tin
641
654
  vendor
655
+ active
642
656
  address_line_1
643
657
  payee_category_id
644
658
  payee_category {
@@ -1765,6 +1779,56 @@ query getPaymentTermById {
1765
1779
  }
1766
1780
  `;
1767
1781
  exports.getPaymentTermByIdStringQuery = getPaymentTermByIdStringQuery;
1782
+ const getPaymentByIdStringQuery = (id) => {
1783
+ const paymentId = requirePositiveInt(id, "payment id");
1784
+ return `
1785
+ query getPaymentById {
1786
+ payments(where: { id: { _eq: ${paymentId} } }, limit: 1) {
1787
+ id
1788
+ zid
1789
+ id_number
1790
+ draft
1791
+ payee_id
1792
+ date
1793
+ agency_id
1794
+ payment_method_id
1795
+ reference
1796
+ charger_id
1797
+ receipt
1798
+ amount
1799
+ voided
1800
+ memo
1801
+ created_at
1802
+ updated_at
1803
+ creator_id
1804
+ entity_id
1805
+ payment_details_count
1806
+ confirmed_at
1807
+ confirmer_id
1808
+ pos
1809
+ draft_number
1810
+ voider_id
1811
+ exchange_rate
1812
+ currency_id
1813
+ voided_at
1814
+ payment_details {
1815
+ id
1816
+ payment_id
1817
+ invoice_id
1818
+ credit_note_id
1819
+ amount
1820
+ reference
1821
+ created_at
1822
+ updated_at
1823
+ entity_id
1824
+ contract_id
1825
+ contract_recurrence
1826
+ }
1827
+ }
1828
+ }
1829
+ `;
1830
+ };
1831
+ exports.getPaymentByIdStringQuery = getPaymentByIdStringQuery;
1768
1832
  const getInvoicesStringQuery = (options) => {
1769
1833
  const conditions = [];
1770
1834
  const rawLimit = options?.limit != null ? Number(options.limit) : 500;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "6.11.0",
3
+ "version": "6.13.0",
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",
@@ -23,5 +23,5 @@
23
23
  "tsx": "^4.23.15",
24
24
  "typescript": "^5.1.6"
25
25
  },
26
- "gitHead": "9acaa9221f755ad34df00b631f59bf8b569712ba"
26
+ "gitHead": "a2e3412dde7cdfd7f33ebc6c5b90b022ab24ae27"
27
27
  }