Skip to content

Commit

Permalink
fix: purchase format
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinespildora committed Feb 13, 2025
1 parent e281223 commit 8c46e7b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Object {
"productId": "4mevd8V",
"quantity": -6621698275147776,
"unitPrice": -66216982751477.76,
"vendorId": "4mevd8V",
},
],
"occurredAt": "2021-02-01T00:00:00.000Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ describe('Topsort.purchase', () => {
nock(/.*/).persist().post(/.*/).reply(200)

const event = createTestEvent({
properties: {
products: [
{
product_id: '123',
price: 100,
quantity: 1,
vendor_id: 'v123'
}
]
}
products: [
{
product_id: '123',
price: 100,
quantity: 1,
brand: 'v123'
}
]
})

const responses = await testDestination.testAction('purchase', {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@ const action: ActionDefinition<Settings, Payload> = {
description: 'Count of products purchased.',
type: 'integer',
required: false
},
vendorId: {
label: 'Vendor ID',
description: 'The vendor ID of the product being purchased.',
type: 'string',
required: false
}
},
default: {
'@arrayPath': [
'$.properties.products',
'$.products',
{
productId: { '@path': '$.product_id' },
unitPrice: { '@path': '$.price' },
Expand Down

0 comments on commit 8c46e7b

Please sign in to comment.