2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2021-03-10 14:51:05 -08:00
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' ,
2022-07-10 13:50:51 -07:00
action : 'Create a quote' ,
2021-03-10 14:51:05 -08:00
} ,
{
name : 'Get' ,
value : 'get' ,
2022-07-10 13:50:51 -07:00
action : 'Get a quote' ,
2021-03-10 14:51:05 -08:00
} ,
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'quote' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
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
// ----------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'Profile Name or ID' ,
2021-03-10 14:51:05 -08:00
name : 'profileId' ,
type : 'options' ,
required : true ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getProfiles' ,
} ,
2022-08-17 08:50:24 -07:00
description :
'ID of the user profile to create the quote under. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-03-10 14:51:05 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'quote' ] ,
operation : [ 'create' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Target Account Name or ID' ,
2021-03-10 14:51:05 -08:00
name : 'targetAccountId' ,
type : 'options' ,
required : true ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getRecipients' ,
} ,
2022-08-17 08:50:24 -07:00
description :
'ID of the account that will receive the funds. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-03-10 14:51:05 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'quote' ] ,
operation : [ 'create' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
{
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 : {
2022-08-17 08:50:24 -07:00
resource : [ 'quote' ] ,
operation : [ 'create' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
{
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 : {
2022-08-17 08:50:24 -07:00
resource : [ 'quote' ] ,
operation : [ 'create' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
{
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 : {
2022-08-17 08:50:24 -07:00
resource : [ 'quote' ] ,
operation : [ 'create' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
{
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 : {
2022-08-17 08:50:24 -07:00
resource : [ 'quote' ] ,
operation : [ 'create' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
// ----------------------------------
// 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 : {
2022-08-17 08:50:24 -07:00
resource : [ 'quote' ] ,
operation : [ 'get' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;