@zauru-sdk/graphql 2.2.0 → 2.4.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.
- package/dist/GraphQL.queries.d.ts +2 -0
- package/dist/esm/GraphQL.queries.js +52 -25
- package/package.json +2 -2
|
@@ -2,6 +2,8 @@ export declare const getLast100ReceptionsStringQuery: (agency_id: number) => str
|
|
|
2
2
|
export declare const getPurchaseOrderByIdNumberStringQuery: (id_number: string) => string;
|
|
3
3
|
export declare const getPurchaseOrderStringQuery: (id: number, config?: {
|
|
4
4
|
withLotStocks: boolean;
|
|
5
|
+
withPayee: boolean;
|
|
6
|
+
withReceptions: boolean;
|
|
5
7
|
}) => string;
|
|
6
8
|
export declare const getShipmentsStringQuery: ({ agency_to_id, agency_from_id, suffix, voided, delivered, shipped, returned, id_number_not_null, id_number, id_number_not_empty, withMovementLots, withPurchaseOrdersByShipmentReference, limit, id, wheres, memoILike, plannedShippingDateRange, plannedDeliveryDateRange, }: {
|
|
7
9
|
agency_to_id?: number;
|
|
@@ -82,7 +82,54 @@ query getPurchaseOrderByIdNumber {
|
|
|
82
82
|
}
|
|
83
83
|
`;
|
|
84
84
|
exports.getPurchaseOrderByIdNumberStringQuery = getPurchaseOrderByIdNumberStringQuery;
|
|
85
|
-
const getPurchaseOrderStringQuery = (id, config = {
|
|
85
|
+
const getPurchaseOrderStringQuery = (id, config = {
|
|
86
|
+
withLotStocks: false,
|
|
87
|
+
withPayee: false,
|
|
88
|
+
withReceptions: true,
|
|
89
|
+
}) => {
|
|
90
|
+
const lotStocks = config.withLotStocks
|
|
91
|
+
? `lot_stocks {
|
|
92
|
+
id
|
|
93
|
+
available
|
|
94
|
+
incoming
|
|
95
|
+
outgoing
|
|
96
|
+
agency_id
|
|
97
|
+
}`
|
|
98
|
+
: "";
|
|
99
|
+
const payee = config.withPayee
|
|
100
|
+
? `payee {
|
|
101
|
+
id
|
|
102
|
+
name
|
|
103
|
+
id_number
|
|
104
|
+
email
|
|
105
|
+
phone
|
|
106
|
+
tin
|
|
107
|
+
active
|
|
108
|
+
payee_category_id
|
|
109
|
+
payee_category {
|
|
110
|
+
id
|
|
111
|
+
name
|
|
112
|
+
}
|
|
113
|
+
}`
|
|
114
|
+
: "";
|
|
115
|
+
const receptions = config.withReceptions
|
|
116
|
+
? `receptions {
|
|
117
|
+
id
|
|
118
|
+
received
|
|
119
|
+
voided
|
|
120
|
+
agency_id
|
|
121
|
+
entity_id
|
|
122
|
+
reception_details {
|
|
123
|
+
purchase_order_detail_id
|
|
124
|
+
item_id
|
|
125
|
+
lot_delivered_quantity
|
|
126
|
+
lot_description
|
|
127
|
+
lot_expire
|
|
128
|
+
lot_name
|
|
129
|
+
}
|
|
130
|
+
}`
|
|
131
|
+
: "";
|
|
132
|
+
return `
|
|
86
133
|
query getPurchaseOrder($id: bigint) @cached {
|
|
87
134
|
purchase_orders(where: {id: {_eq: ${id}}}) {
|
|
88
135
|
id
|
|
@@ -103,6 +150,8 @@ query getPurchaseOrder($id: bigint) @cached {
|
|
|
103
150
|
delivery_date
|
|
104
151
|
other_charges
|
|
105
152
|
shipment_reference
|
|
153
|
+
${payee}
|
|
154
|
+
${receptions}
|
|
106
155
|
webapp_table_rowables {
|
|
107
156
|
webapp_rows {
|
|
108
157
|
id
|
|
@@ -124,30 +173,7 @@ query getPurchaseOrder($id: bigint) @cached {
|
|
|
124
173
|
id
|
|
125
174
|
name
|
|
126
175
|
description
|
|
127
|
-
${
|
|
128
|
-
? `lot_stocks {
|
|
129
|
-
id
|
|
130
|
-
available
|
|
131
|
-
incoming
|
|
132
|
-
outgoing
|
|
133
|
-
agency_id
|
|
134
|
-
}`
|
|
135
|
-
: ""}
|
|
136
|
-
}
|
|
137
|
-
receptions {
|
|
138
|
-
id
|
|
139
|
-
received
|
|
140
|
-
voided
|
|
141
|
-
agency_id
|
|
142
|
-
entity_id
|
|
143
|
-
reception_details {
|
|
144
|
-
purchase_order_detail_id
|
|
145
|
-
item_id
|
|
146
|
-
lot_delivered_quantity
|
|
147
|
-
lot_description
|
|
148
|
-
lot_expire
|
|
149
|
-
lot_name
|
|
150
|
-
}
|
|
176
|
+
${lotStocks}
|
|
151
177
|
}
|
|
152
178
|
shipment_purchase_orders {
|
|
153
179
|
shipment_id
|
|
@@ -155,6 +181,7 @@ query getPurchaseOrder($id: bigint) @cached {
|
|
|
155
181
|
}
|
|
156
182
|
}
|
|
157
183
|
`;
|
|
184
|
+
};
|
|
158
185
|
exports.getPurchaseOrderStringQuery = getPurchaseOrderStringQuery;
|
|
159
186
|
const getShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix, voided, delivered, shipped, returned, id_number_not_null = false, id_number, id_number_not_empty = false, withMovementLots = false, withPurchaseOrdersByShipmentReference = false, limit = 1000, id, wheres, memoILike, plannedShippingDateRange, plannedDeliveryDateRange, }) => {
|
|
160
187
|
let conditions = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/graphql",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.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",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"typescript": "^5.1.6"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "322aeeae8a6462b8d9877918a5c2f320d6fd9b87"
|
|
25
25
|
}
|