import { getCurrentUnixTimestamp } from '../utils/helper'; import { EventRequest } from './EventRequest'; import type { IAddRateEvent } from './types'; export class AddRateEvent extends EventRequest { constructor({ itemId, rating, url, ref, recommendationId, from, timestamp = getCurrentUnixTimestamp(), userProperties, eventProperties, }: IAddRateEvent) { super({ itemId, eventType: 'rate', eventValue: rating.toString(), timestamp, url, ref, recommendationId, from, userProperties, eventProperties, }); } }