2021-03-10 14:51:05 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const quoteOperations: INodeProperties[] = [
|
2021-03-10 14:51:05 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-03-10 14:51:05 -08:00
|
|
|
default: 'get',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'quote',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-03-10 14:51:05 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const quoteFields: INodeProperties[] = [
|
2021-03-10 14:51:05 -08:00
|
|
|
// ----------------------------------
|
|
|
|
// quote: create
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Profile ID',
|
|
|
|
name: 'profileId',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
default: [],
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getProfiles',
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'ID of the user profile to create the quote under',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'quote',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Target Account ID',
|
|
|
|
name: 'targetAccountId',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
default: [],
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getRecipients',
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'ID of the account that will receive the funds',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'quote',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Amount Type',
|
|
|
|
name: 'amountType',
|
|
|
|
type: 'options',
|
|
|
|
default: 'source',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Source',
|
|
|
|
value: 'source',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Target',
|
|
|
|
value: 'target',
|
|
|
|
},
|
|
|
|
],
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether the amount is to be sent or received',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'quote',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Amount',
|
|
|
|
name: 'amount',
|
|
|
|
type: 'number',
|
|
|
|
default: 1,
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Amount of funds for the quote to create',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'quote',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Source Currency',
|
|
|
|
name: 'sourceCurrency',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Code of the currency to send for the quote to create',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'quote',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Target Currency',
|
|
|
|
name: 'targetCurrency',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Code of the currency to receive for the quote to create',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'quote',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// quote: get
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Quote ID',
|
|
|
|
name: 'quoteId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'ID of the quote to retrieve',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'quote',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|