n8n-nodes-atendix 1.3.6 → 1.3.7
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.
|
@@ -216,7 +216,7 @@ class Atendix {
|
|
|
216
216
|
noDataExpression: true,
|
|
217
217
|
displayOptions: { show: { resource: ['invoice'] } },
|
|
218
218
|
options: [
|
|
219
|
-
{ name: 'Listar
|
|
219
|
+
{ name: 'Listar NFs do Pedido', value: 'list', description: 'Lista notas fiscais de um pedido específico', action: 'Listar notas fiscais do pedido' },
|
|
220
220
|
{ name: 'Buscar Nota Fiscal', value: 'get', description: 'Busca uma nota fiscal por ID', action: 'Buscar nota fiscal por ID' },
|
|
221
221
|
{ name: 'Buscar NF por Pedido', value: 'getByOrder', description: 'Busca a nota fiscal vinculada a um pedido', action: 'Buscar nota fiscal por pedido' },
|
|
222
222
|
{ name: 'Cadastrar Nota Fiscal', value: 'create', description: 'Cadastra uma nova nota fiscal em um pedido', action: 'Cadastrar nota fiscal' },
|
|
@@ -225,7 +225,7 @@ class Atendix {
|
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
227
|
displayName: 'ID do Pedido', name: 'invoiceOrderId', type: 'string', required: true,
|
|
228
|
-
displayOptions: { show: { resource: ['invoice'], operation: ['get', 'getByOrder', 'create'] } },
|
|
228
|
+
displayOptions: { show: { resource: ['invoice'], operation: ['list', 'get', 'getByOrder', 'create'] } },
|
|
229
229
|
default: '', description: 'ID do pedido vinculado à nota fiscal',
|
|
230
230
|
},
|
|
231
231
|
{
|
|
@@ -233,16 +233,7 @@ class Atendix {
|
|
|
233
233
|
displayOptions: { show: { resource: ['invoice'], operation: ['get'] } },
|
|
234
234
|
default: '', description: 'ID da nota fiscal (ex: 1347). Requer também o ID do Pedido.',
|
|
235
235
|
},
|
|
236
|
-
|
|
237
|
-
displayName: 'Filtros', name: 'filters', type: 'collection',
|
|
238
|
-
placeholder: 'Adicionar Filtro', default: {},
|
|
239
|
-
displayOptions: { show: { resource: ['invoice'], operation: ['list'] } },
|
|
240
|
-
options: [
|
|
241
|
-
{ displayName: 'ID do Pedido', name: 'orderId', type: 'string', default: '' },
|
|
242
|
-
{ displayName: 'Limite', name: 'limit', type: 'number', default: 50 },
|
|
243
|
-
{ displayName: 'Página', name: 'page', type: 'number', default: 1 },
|
|
244
|
-
],
|
|
245
|
-
},
|
|
236
|
+
// invoice list usa GET /orders/:id/invoices — sem filtros adicionais
|
|
246
237
|
{
|
|
247
238
|
displayName: 'Dados da Nota Fiscal', name: 'invoiceData', type: 'collection',
|
|
248
239
|
placeholder: 'Adicionar Campo', default: {},
|
|
@@ -422,14 +413,10 @@ class Atendix {
|
|
|
422
413
|
// ==================== NOTA FISCAL ====================
|
|
423
414
|
if (resource === 'invoice') {
|
|
424
415
|
if (operation === 'list') {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
qs.limit = filters.limit;
|
|
430
|
-
if (filters.page)
|
|
431
|
-
qs.page = filters.page;
|
|
432
|
-
responseData = await this.helpers.httpRequest({ method: 'GET', url: `${baseUrl}/invoices`, qs, json: true });
|
|
416
|
+
// ✅ CORRETO: GET /orders/:order_id/invoices
|
|
417
|
+
// GET /invoices NÃO EXISTE na API Tray (confirmado no PRD §3.3)
|
|
418
|
+
const invoiceOrderId = this.getNodeParameter('invoiceOrderId', i);
|
|
419
|
+
responseData = await this.helpers.httpRequest({ method: 'GET', url: `${baseUrl}/orders/${invoiceOrderId}/invoices`, qs, json: true });
|
|
433
420
|
}
|
|
434
421
|
if (operation === 'get') {
|
|
435
422
|
const invoiceOrderId = this.getNodeParameter('invoiceOrderId', i);
|