import { getCurrentUnixTimestamp } from '../utils/helper'; import { EventRequest } from './EventRequest'; import type { IAddPurchaseEvent } from './types'; export class AddPurchaseEvent extends EventRequest { constructor({ itemId, price, url, ref, timestamp = getCurrentUnixTimestamp(), userProperties, eventProperties, }: IAddPurchaseEvent) { super({ itemId, eventType: 'purchase', eventValue: price.toString(), timestamp, url, ref, userProperties, eventProperties, }); } }