@zauru-sdk/graphql 2.0.195 → 2.0.203
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.
|
@@ -33,6 +33,7 @@ export declare const getLotsByNameStringQuery: (name: string, entity_id: number)
|
|
|
33
33
|
export declare const getLotStocksByAgencyIdStringQuery: (agency_id: number) => string;
|
|
34
34
|
export declare const getSerialsStringQuery: (filters: {
|
|
35
35
|
name?: string;
|
|
36
|
+
id?: number | string;
|
|
36
37
|
}) => string;
|
|
37
38
|
export declare const getPurchaseOrdersBetweenDatesStringQuery: (startDate: string, endDate: string, config: {
|
|
38
39
|
agencyId?: number | string;
|
|
@@ -148,5 +149,7 @@ export declare const getCasesStringQuery: (filters?: {
|
|
|
148
149
|
closed?: boolean;
|
|
149
150
|
tag_id?: string;
|
|
150
151
|
limit?: number;
|
|
152
|
+
}, includes?: {
|
|
153
|
+
includeSerial?: boolean;
|
|
151
154
|
}) => string;
|
|
152
155
|
export declare const getPrintTemplatesStringQuery = "\nquery getPrintTemplates {\n print_templates {\n id\n name\n }\n}\n";
|
|
@@ -302,6 +302,9 @@ const getSerialsStringQuery = (filters) => {
|
|
|
302
302
|
if (filters.name) {
|
|
303
303
|
conditions.push(`name: {_ilike: "%${filters.name}%"}`);
|
|
304
304
|
}
|
|
305
|
+
if (filters.id) {
|
|
306
|
+
conditions.push(`id: {_eq: ${filters.id}}`);
|
|
307
|
+
}
|
|
305
308
|
const whereClause = conditions.length
|
|
306
309
|
? `where: { ${conditions.join(", ")} }`
|
|
307
310
|
: "";
|
|
@@ -320,7 +323,6 @@ const getSerialsStringQuery = (filters) => {
|
|
|
320
323
|
agency_id
|
|
321
324
|
agency_future_id
|
|
322
325
|
created_at
|
|
323
|
-
}
|
|
324
326
|
}
|
|
325
327
|
`;
|
|
326
328
|
};
|
|
@@ -1551,7 +1553,7 @@ query getInvoicesByAgencyId {
|
|
|
1551
1553
|
}
|
|
1552
1554
|
`;
|
|
1553
1555
|
exports.getInvoicesByAgencyIdStringQuery = getInvoicesByAgencyIdStringQuery;
|
|
1554
|
-
const getCasesStringQuery = (filters) => {
|
|
1556
|
+
const getCasesStringQuery = (filters, includes) => {
|
|
1555
1557
|
const conditions = [];
|
|
1556
1558
|
if (filters?.id) {
|
|
1557
1559
|
conditions.push(`id: {_eq: ${filters.id}}`);
|
|
@@ -1571,6 +1573,21 @@ const getCasesStringQuery = (filters) => {
|
|
|
1571
1573
|
const whereClause = conditions.length
|
|
1572
1574
|
? `where: { ${conditions.join(", ")} },`
|
|
1573
1575
|
: "";
|
|
1576
|
+
const joins = [];
|
|
1577
|
+
if (includes?.includeSerial) {
|
|
1578
|
+
joins.push(`
|
|
1579
|
+
serial {
|
|
1580
|
+
id
|
|
1581
|
+
id_number
|
|
1582
|
+
name
|
|
1583
|
+
description
|
|
1584
|
+
item_id
|
|
1585
|
+
entity_id
|
|
1586
|
+
agency_id
|
|
1587
|
+
agency_future_id
|
|
1588
|
+
created_at
|
|
1589
|
+
}`);
|
|
1590
|
+
}
|
|
1574
1591
|
return `query getCases {
|
|
1575
1592
|
cases (${whereClause} order_by: {id: desc}, limit: ${filters?.limit || 1000})
|
|
1576
1593
|
{
|
|
@@ -1594,6 +1611,7 @@ const getCasesStringQuery = (filters) => {
|
|
|
1594
1611
|
courtesy
|
|
1595
1612
|
total
|
|
1596
1613
|
responsible_id
|
|
1614
|
+
${joins?.join("\n") || ""}
|
|
1597
1615
|
client {
|
|
1598
1616
|
name
|
|
1599
1617
|
tin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/graphql",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.203",
|
|
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": "71ffd90ef4de8f031f2b507b38151902caaeb006"
|
|
25
25
|
}
|