@zauru-sdk/graphql 2.0.164 → 2.0.166
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.
- package/dist/GraphQL.queries.d.ts +6 -1
- package/dist/esm/GraphQL.queries.js +32 -11
- package/package.json +2 -2
|
@@ -50,7 +50,12 @@ export declare const getPurchaseOrdersBetweenDatesStringQuery: (startDate: strin
|
|
|
50
50
|
discount?: number;
|
|
51
51
|
excludeVoided?: boolean;
|
|
52
52
|
}) => string;
|
|
53
|
-
export declare const getPayeesStringQuery
|
|
53
|
+
export declare const getPayeesStringQuery: (filters?: {
|
|
54
|
+
id_number?: string;
|
|
55
|
+
name?: string;
|
|
56
|
+
vendor?: boolean;
|
|
57
|
+
tin?: string;
|
|
58
|
+
}) => string;
|
|
54
59
|
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";
|
|
55
60
|
export declare const getAgenciesStringQuery = "\nquery getAgencies {\n agencies {\n id\n name\n address_line_2\n }\n}\n";
|
|
56
61
|
export declare const getWebAppRowStringQuery: (id: number) => string;
|
|
@@ -466,18 +466,39 @@ const getPurchaseOrdersBetweenDatesStringQuery = (startDate, endDate, config) =>
|
|
|
466
466
|
`;
|
|
467
467
|
};
|
|
468
468
|
exports.getPurchaseOrdersBetweenDatesStringQuery = getPurchaseOrdersBetweenDatesStringQuery;
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
id_number
|
|
474
|
-
name
|
|
475
|
-
tin
|
|
476
|
-
vendor
|
|
477
|
-
address_line_1
|
|
469
|
+
const getPayeesStringQuery = (filters) => {
|
|
470
|
+
const conditions = [];
|
|
471
|
+
if (filters?.id_number) {
|
|
472
|
+
conditions.push(`id_number: { _ilike: "%${filters.id_number}%" }`);
|
|
478
473
|
}
|
|
479
|
-
|
|
480
|
-
|
|
474
|
+
if (filters?.name) {
|
|
475
|
+
conditions.push(`name: { _ilike: "%${filters.name}%" }`);
|
|
476
|
+
}
|
|
477
|
+
if (filters?.vendor !== undefined) {
|
|
478
|
+
conditions.push(`vendor: { _eq: ${filters.vendor} }`);
|
|
479
|
+
}
|
|
480
|
+
if (filters?.tin) {
|
|
481
|
+
conditions.push(`tin: { _eq: "${filters.tin}" }`);
|
|
482
|
+
}
|
|
483
|
+
const whereClause = conditions.length
|
|
484
|
+
? `where: { ${conditions.join(", ")} }`
|
|
485
|
+
: "";
|
|
486
|
+
return `query getPayees {
|
|
487
|
+
payees (
|
|
488
|
+
order_by: { id: desc },
|
|
489
|
+
${whereClause}
|
|
490
|
+
) {
|
|
491
|
+
id
|
|
492
|
+
id_number
|
|
493
|
+
name
|
|
494
|
+
tin
|
|
495
|
+
vendor
|
|
496
|
+
address_line_1
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
`;
|
|
500
|
+
};
|
|
501
|
+
exports.getPayeesStringQuery = getPayeesStringQuery;
|
|
481
502
|
exports.getProvidersStringQuery = `
|
|
482
503
|
query getProviders {
|
|
483
504
|
payees (where: {vendor: {_eq: true}}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/graphql",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.166",
|
|
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": "
|
|
24
|
+
"gitHead": "39835f008adba7bc3f9d1ef997089a09c34ae322"
|
|
25
25
|
}
|