@zauru-sdk/graphql 2.0.31 → 2.0.33

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,15 +3,18 @@ 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 getLast100ShipmentsStringQuery: ({ agency_to_id, suffix, voided, shipped, delivered, id_number_not_null, id_number, id_number_not_empty, }: {
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, }: {
7
7
  agency_to_id?: number;
8
+ agency_from_id?: number;
8
9
  suffix?: string;
9
10
  id_number_not_null?: boolean;
10
11
  voided?: boolean;
11
- shipped?: boolean;
12
- delivered?: boolean;
13
12
  id_number?: string;
14
13
  id_number_not_empty?: boolean;
14
+ withMovementLots?: boolean;
15
+ limit?: number;
16
+ id?: number;
17
+ wheres?: string[];
15
18
  }) => string;
16
19
  export declare const getLotsByNameStringQuery: (name: string, entity_id: number) => string;
17
20
  export declare const getLotStocksByAgencyIdStringQuery: (agency_id: number) => string;
@@ -58,7 +61,6 @@ export declare const getEmployeesByAgencyIdStringQuery: (id: number) => string;
58
61
  export declare const getBundlesByItemCategoryIdStringQuery: (id: number) => string;
59
62
  export declare const getBundleByNameStringQuery: (name: string) => string;
60
63
  export declare const getItemByNameStringQuery: (name: string) => string;
61
- export declare const getShipmentsStringQuery: (wheres?: string[]) => string;
62
64
  export declare const getAllFormsStringQuery: (config?: {
63
65
  withSubmissions: boolean;
64
66
  }) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPrintTemplatesStringQuery = exports.getCasesByResponsibleIdStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = exports.getLastInvoiceFormSubmissionStringQuery = exports.getInvoiceFormSubmissionsByAgencyIdStringQuery = exports.getFormSubmissionByIdStringQuery = exports.getMyCaseFormSubmissionsStringQuery = exports.getFormsByDocumentTypeStringQuery = exports.getFormsStringQuery = exports.getFormByNameStringQuery = exports.getAllFormsStringQuery = exports.getShipmentsStringQuery = 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.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getLast100ShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
3
+ exports.getPrintTemplatesStringQuery = exports.getCasesByResponsibleIdStringQuery = exports.getInvoicesByAgencyIdStringQuery = exports.getPaymentTermByIdStringQuery = exports.getPaymentMethodsStringQuery = exports.getPaymentTermsStringQuery = exports.getSuggestedPricesStringQuery = exports.getCurrenciesStringQuery = exports.getInvoiceFormSubmissionsByInvoiceIdStringQuery = 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.getLotStocksByAgencyIdStringQuery = exports.getLotsByNameStringQuery = exports.getShipmentsStringQuery = exports.getPurchaseOrderStringQuery = exports.getPurchaseOrderByIdNumberStringQuery = exports.getLast100ReceptionsStringQuery = void 0;
4
4
  const getLast100ReceptionsStringQuery = (agency_id) => `
5
5
  query getLast100Receptions {
6
6
  purchase_orders(limit: 100, order_by: {created_at: desc}, where: {voided: {_eq: false}, agency_id: {_eq: ${agency_id}}}) {
@@ -152,17 +152,18 @@ query getPurchaseOrder($id: bigint) @cached {
152
152
  }
153
153
  `;
154
154
  exports.getPurchaseOrderStringQuery = getPurchaseOrderStringQuery;
155
- const getLast100ShipmentsStringQuery = ({ agency_to_id, suffix, voided = false, shipped = false, delivered = false, id_number_not_null = false, id_number, id_number_not_empty = false, }) => {
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, }) => {
156
156
  let conditions = [];
157
157
  conditions.push(`voided: {_eq: ${voided}}`);
158
- conditions.push(`shipped: {_eq: ${shipped}}`);
159
- conditions.push(`delivered: {_eq: ${delivered}}`);
160
158
  if (suffix) {
161
159
  conditions.push(`id_number: {_ilike: "%${suffix}%"}`);
162
160
  }
163
161
  if (agency_to_id) {
164
162
  conditions.push(`agency_to_id: {_eq: ${agency_to_id}}`);
165
163
  }
164
+ if (agency_from_id) {
165
+ conditions.push(`agency_from_id: {_eq: ${agency_from_id}}`);
166
+ }
166
167
  if (id_number) {
167
168
  conditions.push(`id_number: {_eq: "${id_number}"}`);
168
169
  }
@@ -172,9 +173,22 @@ const getLast100ShipmentsStringQuery = ({ agency_to_id, suffix, voided = false,
172
173
  if (id_number_not_null) {
173
174
  conditions.push(`id_number: {_is_null: false}`);
174
175
  }
176
+ if (id) {
177
+ conditions.push(`id: {_eq: ${id}}`);
178
+ }
179
+ if (wheres) {
180
+ conditions.push(...wheres);
181
+ }
182
+ const movementLots = withMovementLots
183
+ ? `lot {
184
+ id
185
+ name
186
+ description
187
+ }`
188
+ : "";
175
189
  return `query getLast100Shipments {
176
190
  shipments(
177
- limit: 100,
191
+ limit: ${limit},
178
192
  order_by: {id: desc},
179
193
  where: {
180
194
  ${conditions.join(", ")}
@@ -192,21 +206,26 @@ const getLast100ShipmentsStringQuery = ({ agency_to_id, suffix, voided = false,
192
206
  agency_to_id
193
207
  transporter_id
194
208
  created_at
209
+ planned_shipping
210
+ planned_delivery
211
+ delivered
212
+ shipped
213
+ shipped_at
214
+ delivered_at
215
+ returned
216
+ returned_at
195
217
  movements {
196
218
  id
197
219
  booked_quantity
198
220
  delivered_quantity
199
221
  reference
200
- lot {
201
- id
202
- name
203
- description
204
- }
222
+ item_id
223
+ ${movementLots}
205
224
  }
206
225
  }
207
226
  }`;
208
227
  };
209
- exports.getLast100ShipmentsStringQuery = getLast100ShipmentsStringQuery;
228
+ exports.getShipmentsStringQuery = getShipmentsStringQuery;
210
229
  const getLotsByNameStringQuery = (name, entity_id) => `
211
230
  query getLots {
212
231
  lots (limit: 100, order_by: {id: desc}, where: {entity_id: {_eq: ${entity_id}}, name: {_eq: "${name}"}}) {
@@ -694,29 +713,6 @@ query getItemByName {
694
713
  }
695
714
  `;
696
715
  exports.getItemByNameStringQuery = getItemByNameStringQuery;
697
- const getShipmentsStringQuery = (wheres = []) => {
698
- const additionalWheres = wheres.join(",");
699
- return `query getShipments {
700
- shipments (${additionalWheres.length > 0 ? `where: {${additionalWheres}},` : ""} order_by: {id: desc}) {
701
- id
702
- id_number
703
- reference
704
- needs_transport
705
- payee_id
706
- booker_id
707
- shipped
708
- shipper_id
709
- delivered
710
- delivered_at
711
- voided
712
- returned
713
- memo
714
- planned_delivery
715
- }
716
- }
717
- `;
718
- };
719
- exports.getShipmentsStringQuery = getShipmentsStringQuery;
720
716
  const getAllFormsStringQuery = (config = { withSubmissions: false }) => `
721
717
  query getAllForms {
722
718
  settings_forms (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.0.31",
3
+ "version": "2.0.33",
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": "06b14f4fc6a5a06dba2e0ad910afbc57c9448d7d"
24
+ "gitHead": "16838516924a5b98ef2fdf89ec46881451b9589b"
25
25
  }