diff --git a/packages/destination-actions/src/destinations/topsort/purchase/__tests__/__snapshots__/snapshot.test.ts.snap b/packages/destination-actions/src/destinations/topsort/purchase/__tests__/__snapshots__/snapshot.test.ts.snap index 956e66ff39..4b80522d03 100644 --- a/packages/destination-actions/src/destinations/topsort/purchase/__tests__/__snapshots__/snapshot.test.ts.snap +++ b/packages/destination-actions/src/destinations/topsort/purchase/__tests__/__snapshots__/snapshot.test.ts.snap @@ -10,6 +10,7 @@ Object { "productId": "4mevd8V", "quantity": -6621698275147776, "unitPrice": -66216982751477.76, + "vendorId": "4mevd8V", }, ], "occurredAt": "2021-02-01T00:00:00.000Z", diff --git a/packages/destination-actions/src/destinations/topsort/purchase/__tests__/index.test.ts b/packages/destination-actions/src/destinations/topsort/purchase/__tests__/index.test.ts index 849b685e52..d97a5c2dc4 100644 --- a/packages/destination-actions/src/destinations/topsort/purchase/__tests__/index.test.ts +++ b/packages/destination-actions/src/destinations/topsort/purchase/__tests__/index.test.ts @@ -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', { diff --git a/packages/destination-actions/src/destinations/topsort/purchase/generated-types.ts b/packages/destination-actions/src/destinations/topsort/purchase/generated-types.ts index 58fd24788e..935d338437 100644 --- a/packages/destination-actions/src/destinations/topsort/purchase/generated-types.ts +++ b/packages/destination-actions/src/destinations/topsort/purchase/generated-types.ts @@ -29,5 +29,9 @@ export interface Payload { * Count of products purchased. */ quantity?: number + /** + * The vendor ID of the product being purchased. + */ + vendorId?: string }[] } diff --git a/packages/destination-actions/src/destinations/topsort/purchase/index.ts b/packages/destination-actions/src/destinations/topsort/purchase/index.ts index 69a0e8b78a..699869783a 100644 --- a/packages/destination-actions/src/destinations/topsort/purchase/index.ts +++ b/packages/destination-actions/src/destinations/topsort/purchase/index.ts @@ -61,11 +61,17 @@ const action: ActionDefinition = { 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' },