Commit 146c2523 authored by Ofer Cohen's avatar Ofer Cohen
Browse files

Merge branch 'EIRNI-467' into 'master'

EIRNI-467: n8n | billrun | added option to select entity state in GET request

See merge request sdoc/n8n-plugins/n8n-nodes-billrun!9
parents 793728f3 558f02ea
......@@ -158,6 +158,66 @@ class BillRun {
},
description: 'JSON representing all data.',
},
{
displayName: 'Active',
name: 'getActive',
type: 'boolean',
default: true,
displayOptions: {
show: {
action: [
'get',
],
module: [
'plans',
'rates',
'services',
'subscribers',
],
},
},
description: 'Get active entities',
},
{
displayName: 'Future',
name: 'getFuture',
type: 'boolean',
default: true,
displayOptions: {
show: {
action: [
'get',
],
module: [
'plans',
'rates',
'services',
'subscribers',
],
},
},
description: 'Get future entities',
},
{
displayName: 'Inactive',
name: 'getInactive',
type: 'boolean',
default: true,
displayOptions: {
show: {
action: [
'get',
],
module: [
'plans',
'rates',
'services',
'subscribers',
],
},
},
description: 'Get inactive entities',
},
...PayOfflineDescription_1.payOfflineFields,
...ChargeDescription_1.chargeFields,
...ImmediateChargeDescription_1.immediateChargeFields,
......@@ -356,6 +416,19 @@ class BillRun {
body = {
query: JSON.stringify(attributes),
};
let states = [];
if (this.getNodeParameter('getActive', i, false)) {
states.push(0);
}
if (this.getNodeParameter('getFuture', i, false)) {
states.push(1);
}
if (this.getNodeParameter('getInactive', i, false)) {
states.push(2);
}
if (states.length > 0) {
body.states = JSON.stringify(states);
}
break;
case 'create':
endpoint = `/billapi/${module}/create`;
......
This diff is collapsed.
......@@ -167,6 +167,7 @@ async function getPlans() {
$regex: '^postpaid$'
},
}),
states: JSON.stringify([0, 1, 2]),
};
plansRes = await billrunApiRequest.call(this, 'GET', endpoint, body);
}
......
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/BillRun/GenericFunctions.ts"],"names":[],"mappings":";;AAaA,wCAAwC;AACxC,iCAAiC;AACjC,6BAA6B;AAC7B,2BAAoC;AACpC,+BAAoC;AAEpC,MAAM,QAAQ,GAAG,IAAI,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AC,GAAa;YAC5D,KAAK,EAAE,OAAO,CAAC,GAAa;YAC5B,WAAW,EAAE,EAAE;SACf,CAAC,CAAC;KACH;IAED,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAChC,OAAO,UAAU,CAAC;AACnB,CAAC;AAzCD,kCAyCC"}
\ No newline at end of file
......@@ -184,6 +184,66 @@ export class BillRun implements INodeType {
},
description: 'JSON representing all data.',
},
{
displayName: 'Active',
name: 'getActive',
type: 'boolean',
default: true,
displayOptions: {
show: {
action: [
'get',
],
module: [
'plans',
'rates',
'services',
'subscribers',
],
},
},
description: 'Get active entities',
},
{
displayName: 'Future',
name: 'getFuture',
type: 'boolean',
default: true,
displayOptions: {
show: {
action: [
'get',
],
module: [
'plans',
'rates',
'services',
'subscribers',
],
},
},
description: 'Get future entities',
},
{
displayName: 'Inactive',
name: 'getInactive',
type: 'boolean',
default: true,
displayOptions: {
show: {
action: [
'get',
],
module: [
'plans',
'rates',
'services',
'subscribers',
],
},
},
description: 'Get inactive entities',
},
...payOfflineFields,
...chargeFields,
...immediateChargeFields,
......@@ -376,7 +436,8 @@ export class BillRun implements INodeType {
delete attributes.custom_fields;
attributes = {...attributes, ...customFields};
}
let body = {};
let body:any = {};
let endpoint = '';
let method = '';
......@@ -387,6 +448,19 @@ export class BillRun implements INodeType {
body = {
query: JSON.stringify(attributes),
};
let states = [];
if (this.getNodeParameter('getActive', i, false)) {
states.push(0); // 0 - active
}
if (this.getNodeParameter('getFuture', i, false)) {
states.push(1); // 1 - future
}
if (this.getNodeParameter('getInactive', i, false)) {
states.push(2); // 2 - inactive
}
if (states.length > 0) {
body.states = JSON.stringify(states);
}
break;
case 'create':
endpoint = `/billapi/${module}/create`;
......
......@@ -186,6 +186,7 @@ export async function getPlans(this: ILoadOptionsFunctions): Promise<INodeProper
$regex: '^postpaid$'
},
}),
states: JSON.stringify([0,1,2]),
};
plansRes = await billrunApiRequest.call(this, 'GET', endpoint, body);
} catch (err) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment