@zauru-sdk/graphql 2.0.41 → 2.0.46

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.
@@ -3,12 +3,15 @@ export declare const getPurchaseOrderByIdNumberStringQuery: (id_number: string)
3
3
  export declare const getPurchaseOrderStringQuery: (id: number, config?: {
4
4
  withLotStocks: boolean;
5
5
  }) => string;
6
- export declare const getShipmentsStringQuery: ({ agency_to_id, agency_from_id, suffix, voided, id_number_not_null, id_number, id_number_not_empty, withMovementLots, limit, id, wheres, memoILike, }: {
6
+ 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, limit, id, wheres, memoILike, }: {
7
7
  agency_to_id?: number;
8
8
  agency_from_id?: number;
9
9
  suffix?: string;
10
10
  id_number_not_null?: boolean;
11
11
  voided?: boolean;
12
+ delivered?: boolean;
13
+ shipped?: boolean;
14
+ returned?: boolean;
12
15
  id_number?: string;
13
16
  id_number_not_empty?: boolean;
14
17
  withMovementLots?: boolean;
@@ -152,9 +152,8 @@ query getPurchaseOrder($id: bigint) @cached {
152
152
  }
153
153
  `;
154
154
  exports.getPurchaseOrderStringQuery = getPurchaseOrderStringQuery;
155
- const getShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix, voided = false, id_number_not_null = false, id_number, id_number_not_empty = false, withMovementLots = false, limit = 1000, id, wheres, memoILike, }) => {
155
+ 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, limit = 1000, id, wheres, memoILike, }) => {
156
156
  let conditions = [];
157
- conditions.push(`voided: {_eq: ${voided}}`);
158
157
  if (suffix) {
159
158
  conditions.push(`id_number: {_ilike: "%${suffix}%"}`);
160
159
  }
@@ -182,6 +181,18 @@ const getShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix, voided
182
181
  if (memoILike) {
183
182
  conditions.push(`memo: {_ilike: "%${memoILike}%"}`);
184
183
  }
184
+ if (voided !== undefined) {
185
+ conditions.push(`voided: {_eq: ${voided}}`);
186
+ }
187
+ if (delivered !== undefined) {
188
+ conditions.push(`delivered: {_eq: ${delivered}}`);
189
+ }
190
+ if (shipped !== undefined) {
191
+ conditions.push(`shipped: {_eq: ${shipped}}`);
192
+ }
193
+ if (returned !== undefined) {
194
+ conditions.push(`returned: {_eq: ${returned}}`);
195
+ }
185
196
  const movementLots = withMovementLots
186
197
  ? `lot {
187
198
  id
@@ -193,9 +204,11 @@ const getShipmentsStringQuery = ({ agency_to_id, agency_from_id, suffix, voided
193
204
  shipments(
194
205
  limit: ${limit},
195
206
  order_by: {id: desc},
196
- where: {
207
+ ${conditions.length > 0
208
+ ? `where: {
197
209
  ${conditions.join(", ")}
198
- }
210
+ }`
211
+ : ""}
199
212
  ) {
200
213
  id
201
214
  zid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.0.41",
3
+ "version": "2.0.46",
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": "f509e381e349e72425d9ba0217e1ed5a2eb16461"
24
+ "gitHead": "aefd2b55a21a873eb419e284f872a40b2e6dec4d"
25
25
  }