2020-08-10 09:19:26 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const salesOrderOperations: INodeProperties[] = [
|
2020-08-10 09:19:26 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'salesOrder',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all sales orders',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
description: 'The operation to perform.',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-08-10 09:19:26 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const salesOrderFields: INodeProperties[] = [
|
2020-08-10 09:19:26 -07:00
|
|
|
|
2020-08-10 09:19:56 -07:00
|
|
|
/* ------------------------------------------------------------------------- */
|
|
|
|
/* salesOrder:getAll */
|
|
|
|
/* ------------------------------------------------------------------------- */
|
2020-08-10 09:19:26 -07:00
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'salesOrder',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'salesOrder',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 1000,
|
|
|
|
},
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Filters',
|
|
|
|
name: 'filters',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Filter',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'salesOrder',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Customer ID',
|
|
|
|
name: 'customerId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
|
2022-04-22 09:29:51 -07:00
|
|
|
description: 'Only returns orders for a specified Customer GUID. The CustomerId can be specified as a list of comma-separated GUIDs.',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Customer Code',
|
|
|
|
name: 'customerCode',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Returns orders that start with the specific customer code',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'End Date',
|
|
|
|
name: 'endDate',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
2020-08-10 09:19:56 -07:00
|
|
|
description: 'Returns orders with order date before the specified date. UTC.',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Modified Since',
|
|
|
|
name: 'modifiedSince',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Returns orders created or edited after a specified date, must be UTC format',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Order Number',
|
|
|
|
name: 'orderNumber',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-08-10 09:19:56 -07:00
|
|
|
description: 'Returns a single order with the specified order number. If set, it overrides all other filters.',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Order Status',
|
|
|
|
name: 'orderStatus',
|
|
|
|
type: 'multiOptions',
|
|
|
|
options: [
|
2020-08-10 09:19:56 -07:00
|
|
|
{
|
|
|
|
name: 'Backordered',
|
|
|
|
value: 'Backordered',
|
|
|
|
},
|
2020-08-10 09:19:26 -07:00
|
|
|
{
|
|
|
|
name: 'Completed',
|
2020-08-10 09:19:56 -07:00
|
|
|
value: 'Completed',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
2020-08-10 09:19:56 -07:00
|
|
|
name: 'Deleted',
|
|
|
|
value: 'Deleted',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Parked',
|
2020-08-10 09:19:56 -07:00
|
|
|
value: 'Parked',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Placed',
|
2020-08-10 09:19:56 -07:00
|
|
|
value: 'Placed',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: [],
|
2020-08-10 09:19:56 -07:00
|
|
|
description: 'Returns orders with the specified status. If no orderStatus filter is specified, then we exclude "Deleted" by default.',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Start Date',
|
|
|
|
name: 'startDate',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
2020-08-10 09:19:56 -07:00
|
|
|
description: 'Returns orders with order date after the specified date. UTC.',
|
2020-08-10 09:19:26 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|