@zauru-sdk/graphql 2.2.0 → 2.10.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.
@@ -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 = { withLotStocks: false }) => `
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
@@ -118,36 +167,14 @@ query getPurchaseOrder($id: bigint) @cached {
118
167
  delivered_quantity
119
168
  item {
120
169
  name
170
+ stocks_only_integer
121
171
  }
122
172
  }
123
173
  lots(where: {active: {_eq: true}}) {
124
174
  id
125
175
  name
126
176
  description
127
- ${config.withLotStocks
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
- }
177
+ ${lotStocks}
151
178
  }
152
179
  shipment_purchase_orders {
153
180
  shipment_id
@@ -155,6 +182,7 @@ query getPurchaseOrder($id: bigint) @cached {
155
182
  }
156
183
  }
157
184
  `;
185
+ };
158
186
  exports.getPurchaseOrderStringQuery = getPurchaseOrderStringQuery;
159
187
  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
188
  let conditions = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "2.2.0",
3
+ "version": "2.10.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": "eaa293691510bcff7233d44098944210bf109bdb"
24
+ "gitHead": "e8f218d534f56eff1c871f2e6c2127d6fc383240"
25
25
  }