Skip to content

Commit 8287c78

Browse files
epsilon-required-field-bug (#3126)
1 parent 5902630 commit 8287c78

File tree

1 file changed

+115
-98
lines changed
  • packages/destination-actions/src/destinations/epsilon/sendEvent

1 file changed

+115
-98
lines changed

packages/destination-actions/src/destinations/epsilon/sendEvent/fields.ts

Lines changed: 115 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ export const dtm_fid: InputField = {
44
label: 'Form ID',
55
description: 'Form ID used in Epsilon’s system to identify app visits vs. conversions.',
66
type: 'string',
7-
required: true
8-
}
7+
required: true,
8+
default: { '@path': '$.properties.form_id' }
9+
}
910

1011
export const dtm_promo_id: InputField = {
1112
label: 'Promo ID',
@@ -84,12 +85,14 @@ export const identifiers: InputField = {
8485
},
8586
dtm_email_hash: {
8687
label: 'Email address',
87-
description: 'Accepts hashed or unhashed emails. Segment will ensure that a non hashed email is hashed before being sent to Epsilon',
88+
description:
89+
'Accepts hashed or unhashed emails. Segment will ensure that a non hashed email is hashed before being sent to Epsilon',
8890
type: 'string'
8991
},
9092
dtm_mobile_hash: {
9193
label: 'Mobile Hash',
92-
description: 'Accepts hashed or unhashed mobile numbers. Segment will ensure that a non hashed mobile number is hashed before being sent to Epsilon',
94+
description:
95+
'Accepts hashed or unhashed mobile numbers. Segment will ensure that a non hashed mobile number is hashed before being sent to Epsilon',
9396
type: 'string'
9497
},
9598
dtm_user_id: {
@@ -128,11 +131,12 @@ export const dtmc_department: InputField = {
128131
default: { '@path': '$.properties.department' },
129132
depends_on: {
130133
conditions: [
131-
{
132-
fieldKey: 'dtm_event',
133-
operator: 'is',
134-
value: ['custom', 'department', 'category', 'subcategory', 'product', 'addFavorites', 'addSavedList', 'cart']
135-
}]
134+
{
135+
fieldKey: 'dtm_event',
136+
operator: 'is',
137+
value: ['custom', 'department', 'category', 'subcategory', 'product', 'addFavorites', 'addSavedList', 'cart']
138+
}
139+
]
136140
}
137141
}
138142

@@ -143,11 +147,12 @@ export const dtmc_category: InputField = {
143147
default: { '@path': '$.properties.category' },
144148
depends_on: {
145149
conditions: [
146-
{
147-
fieldKey: 'dtm_event',
148-
operator: 'is',
149-
value: ['custom', 'category', 'subcategory', 'product', 'addFavorites', 'addSavedList', 'cart']
150-
}]
150+
{
151+
fieldKey: 'dtm_event',
152+
operator: 'is',
153+
value: ['custom', 'category', 'subcategory', 'product', 'addFavorites', 'addSavedList', 'cart']
154+
}
155+
]
151156
}
152157
}
153158

@@ -158,26 +163,28 @@ export const dtmc_sub_category: InputField = {
158163
default: { '@path': '$.properties.sub_category' },
159164
depends_on: {
160165
conditions: [
161-
{
162-
fieldKey: 'dtm_event',
163-
operator: 'is',
164-
value: ['custom', 'subcategory', 'product', 'addFavorites', 'addSavedList', 'cart']
165-
}]
166+
{
167+
fieldKey: 'dtm_event',
168+
operator: 'is',
169+
value: ['custom', 'subcategory', 'product', 'addFavorites', 'addSavedList', 'cart']
170+
}
171+
]
166172
}
167173
}
168174

169175
export const dtmc_product_id: InputField = {
170-
label: 'Product ID',
176+
label: 'Product ID',
171177
description: 'Unique identifier for the product',
172178
type: 'string',
173179
default: { '@path': '$.properties.product_id' },
174180
depends_on: {
175181
conditions: [
176-
{
177-
fieldKey: 'dtm_event',
178-
operator: 'is',
179-
value: ['custom', 'product', 'addFavorites', 'addSavedList', 'cart']
180-
}]
182+
{
183+
fieldKey: 'dtm_event',
184+
operator: 'is',
185+
value: ['custom', 'product', 'addFavorites', 'addSavedList', 'cart']
186+
}
187+
]
181188
}
182189
}
183190

@@ -188,11 +195,12 @@ export const dtmc_brand: InputField = {
188195
default: { '@path': '$.properties.brand' },
189196
depends_on: {
190197
conditions: [
191-
{
192-
fieldKey: 'dtm_event',
193-
operator: 'is',
194-
value: ['custom', 'product', 'addFavorites', 'addSavedList', 'cart']
195-
}]
198+
{
199+
fieldKey: 'dtm_event',
200+
operator: 'is',
201+
value: ['custom', 'product', 'addFavorites', 'addSavedList', 'cart']
202+
}
203+
]
196204
}
197205
}
198206

@@ -203,11 +211,12 @@ export const dtmc_upc: InputField = {
203211
default: { '@path': '$.properties.upc' },
204212
depends_on: {
205213
conditions: [
206-
{
207-
fieldKey: 'dtm_event',
208-
operator: 'is',
209-
value: ['custom', 'product', 'addFavorites', 'addSavedList', 'cart']
210-
}]
214+
{
215+
fieldKey: 'dtm_event',
216+
operator: 'is',
217+
value: ['custom', 'product', 'addFavorites', 'addSavedList', 'cart']
218+
}
219+
]
211220
}
212221
}
213222

@@ -218,11 +227,12 @@ export const dtmc_mpn: InputField = {
218227
default: { '@path': '$.properties.mpn' },
219228
depends_on: {
220229
conditions: [
221-
{
222-
fieldKey: 'dtm_event',
223-
operator: 'is',
224-
value: ['custom', 'product', 'addFavorites', 'addSavedList', 'cart']
225-
}]
230+
{
231+
fieldKey: 'dtm_event',
232+
operator: 'is',
233+
value: ['custom', 'product', 'addFavorites', 'addSavedList', 'cart']
234+
}
235+
]
226236
}
227237
}
228238

@@ -233,11 +243,12 @@ export const dtmc_transaction_id: InputField = {
233243
default: { '@path': '$.properties.order_id' },
234244
depends_on: {
235245
conditions: [
236-
{
237-
fieldKey: 'dtm_event',
238-
operator: 'is',
239-
value: ['custom', 'conversion']
240-
}]
246+
{
247+
fieldKey: 'dtm_event',
248+
operator: 'is',
249+
value: ['custom', 'conversion']
250+
}
251+
]
241252
}
242253
}
243254

@@ -251,45 +262,47 @@ export const dtm_conv_val: InputField = {
251262
},
252263
depends_on: {
253264
conditions: [
254-
{
255-
fieldKey: 'dtm_event',
256-
operator: 'is',
257-
value: ['custom', 'conversion']
258-
}]
265+
{
266+
fieldKey: 'dtm_event',
267+
operator: 'is',
268+
value: ['custom', 'conversion']
269+
}
270+
]
259271
}
260272
}
261273

262-
export const dtm_items : InputField = {
274+
export const dtm_items: InputField = {
263275
label: 'Items Purchased',
264276
description: 'An array of all items in the conversion.',
265-
type: 'object',
277+
type: 'object',
266278
multiple: true,
267279
additionalProperties: true,
268280
properties: {
269-
product_id: {
270-
label: 'Product ID',
271-
description: 'Unique identifier / SKU for the product.',
272-
type: 'string'
273-
},
274-
item_amount: {
275-
label: 'Item Amount',
276-
description: 'Unit cost / price for 1 unit of the item.',
277-
type: 'number'
278-
},
279-
item_quantity: {
280-
label: 'Item Quantity',
281-
description: 'number of SKU items in the transaction.',
282-
type: 'integer'
283-
},
284-
item_discount: {
285-
label: 'Item Discount',
286-
description: 'Discount value from the original amount.',
287-
type: 'number'
288-
}
281+
product_id: {
282+
label: 'Product ID',
283+
description: 'Unique identifier / SKU for the product.',
284+
type: 'string'
285+
},
286+
item_amount: {
287+
label: 'Item Amount',
288+
description: 'Unit cost / price for 1 unit of the item.',
289+
type: 'number'
290+
},
291+
item_quantity: {
292+
label: 'Item Quantity',
293+
description: 'number of SKU items in the transaction.',
294+
type: 'integer'
295+
},
296+
item_discount: {
297+
label: 'Item Discount',
298+
description: 'Discount value from the original amount.',
299+
type: 'number'
300+
}
289301
},
290302
default: {
291303
'@arrayPath': [
292-
'$.properties.products', {
304+
'$.properties.products',
305+
{
293306
product_id: { '@path': '$.product_id' },
294307
price: { '@path': '$.price' },
295308
quantity: { '@path': '$.quantity' },
@@ -299,11 +312,12 @@ export const dtm_items : InputField = {
299312
},
300313
depends_on: {
301314
conditions: [
302-
{
303-
fieldKey: 'dtm_event',
304-
operator: 'is',
305-
value: ['custom', 'conversion']
306-
}]
315+
{
316+
fieldKey: 'dtm_event',
317+
operator: 'is',
318+
value: ['custom', 'conversion']
319+
}
320+
]
307321
}
308322
}
309323

@@ -317,16 +331,17 @@ export const dtm_conv_curr: InputField = {
317331
},
318332
depends_on: {
319333
conditions: [
320-
{
321-
fieldKey: 'dtm_event',
322-
operator: 'is',
323-
value: ['custom', 'conversion']
324-
}]
334+
{
335+
fieldKey: 'dtm_event',
336+
operator: 'is',
337+
value: ['custom', 'conversion']
338+
}
339+
]
325340
}
326341
}
327342

328343
export const dtmc_conv_type: InputField = {
329-
label: 'Order Type',
344+
label: 'Order Type',
330345
description: 'Differentiate between types of online purchases (Delivery, Pickup, etc.)',
331346
type: 'string',
332347
default: { '@path': '$.properties.order_type' },
@@ -335,11 +350,12 @@ export const dtmc_conv_type: InputField = {
335350
},
336351
depends_on: {
337352
conditions: [
338-
{
339-
fieldKey: 'dtm_event',
340-
operator: 'is',
341-
value: ['custom', 'conversion']
342-
}]
353+
{
354+
fieldKey: 'dtm_event',
355+
operator: 'is',
356+
value: ['custom', 'conversion']
357+
}
358+
]
343359
}
344360
}
345361

@@ -353,11 +369,12 @@ export const dtmc_conv_store_location: InputField = {
353369
},
354370
depends_on: {
355371
conditions: [
356-
{
357-
fieldKey: 'dtm_event',
358-
operator: 'is',
359-
value: ['custom', 'conversion']
360-
}]
372+
{
373+
fieldKey: 'dtm_event',
374+
operator: 'is',
375+
value: ['custom', 'conversion']
376+
}
377+
]
361378
}
362379
}
363380

@@ -389,7 +406,7 @@ export const deviceType: InputField = {
389406
label: 'Device Type',
390407
description: 'Type of the device (e.g., iOS, Android).',
391408
type: 'string',
392-
required: true,
409+
required: true,
393410
choices: [
394411
{ label: 'iOS', value: 'ios' },
395412
{ label: 'Android', value: 'android' }
@@ -398,12 +415,12 @@ export const deviceType: InputField = {
398415
}
399416

400417
export const standardFields = {
401-
id,
418+
id,
402419
appId,
403420
dtm_event,
404-
version,
421+
version,
405422
dtm_fid,
406423
dtm_promo_id,
407424
identifiers,
408425
deviceType
409-
}
426+
}

0 commit comments

Comments
 (0)