import { Action } from '@ngrx/store'; import { EventBlock, AddToCartInfoBlock, BasicPayload, ProductClickBlock } from '../models/adobe-analytics-data-layer-models.interface'; import { clickElementTypes, clickElementValues, siteErrorTypes, clickElementSubTypes, pageTypes } from '../constants/adobe-analytics.constants'; import { HttpReturnRecord } from '../models/web-performance.interface'; import { Whitelist } from '../models/event-transceiver.interface'; export enum EventTransceiverActions { EventTransceiverReceiveRegisterComponentEvent = '[Event Transceiver] Register Component', EventTransceiverReceiveComponentRenderEvent = '[Event Transceiver] Component Rendered ', EventTransceiverReceiveHTTPReturnEvent = '[Event Transceiver] Receive HTTP Return Event', EventTransceiverReceivePageLoadEvent = '[Event Transceiver] Receive Page Load Event', EventTransceiverReceiveUIEvent = '[Event Transceiver] Receive User Interaction Event', EventTransceiverReceiveErrorEvent = '[Event Transceiver] Receive Error Event', EventTransceiverReceiveClickEvent = '[Event Transceiver] Receive Click Event', EventTransceiverReceiveSiteErrorEvent = '[Event Transceiver] Receive Site Error', EventTransceiverReceiveAddToCartEvent = '[Event Transceiver] Receive Add to Cart Event', EventTransceiverReceiveSuperSkuSwitch = '[Event Transceiver] Receive Super Sku Switch', EventTransceiverSetWhitelistEvent = '[Event Transceiver] Set Whitelist', EventTransceiverInitializeWhitelist = '[Event Transceiver] Initialize Whitelist', EventTransceiverReceiveCarouselItemClick = '[Event Transceiver] Receive Carousel Item Click', EventTransceiverUpdatePETAEvent = '[Event Transceiver] Receive PETA Update Event', EventTransceiverTransmitAnalyticsEvent = '[Event Transceiver] Transmit Analytics Event', EventTransceiverSetWhitelistSuccess = '[Event Transceiver] Set Whitelist Success' } export class EventTransceiverReceiveRegisterComponentEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceiveRegisterComponentEvent; constructor(public componentName: string) {} } export class EventTransceiverReceiveComponentRenderEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceiveComponentRenderEvent; constructor(public componentName: string) {} } export class EventTransceiverReceiveHTTPReturnEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceiveHTTPReturnEvent; constructor(public payload: HttpReturnRecord) {} } export class EventTransceiverReceivePageLoadEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceivePageLoadEvent; constructor( public event: EventBlock, public dataWrapper, public pageMeta: any ) { } } export class EventTransceiverReceiveClickEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceiveClickEvent; constructor(public event: EventBlock, public elementType: clickElementTypes, public elementSubType: clickElementSubTypes, public elementValue: clickElementValues) { } } export class EventTransceiverReceiveSiteErrorEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceiveSiteErrorEvent; constructor( public event: EventBlock, public errorType: siteErrorTypes, public userInformed: boolean, public errorCode: string, public errorValue: string, public target: string, public errorPayload?: any ) { } } export class EventTransceiverReceiveAddToCartEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceiveAddToCartEvent; constructor(public event: EventBlock, public analyticsData: AddToCartInfoBlock[]) { } } export class EventTransceiverReceiveSuperSkuSwitchEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceiveSuperSkuSwitch; constructor( public page: pageTypes, public productId: string, public attributeName: string, // Colour public attributeId: string, // id_colour public targetProductId: string, public targetValueId: string, // Green public targetValueName: string // id_green ) {} } export class EventTransceiverSetWhitelistEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverSetWhitelistEvent; constructor(public payload: Whitelist) {} } export class EventTransceiverSetWhitelistSuccess implements Action { readonly type = EventTransceiverActions.EventTransceiverSetWhitelistSuccess; constructor(public payload: Whitelist) {} } export class EventTransceiverInitializeWhitelist implements Action { readonly type = EventTransceiverActions.EventTransceiverInitializeWhitelist; constructor() {} } export class EventTransceiverReceiveCarouselItemClickEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverReceiveCarouselItemClick; constructor(public payload: ProductClickBlock) {} } export class EventTransceiverUpdatePETAEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverUpdatePETAEvent; constructor(public analyticsData: any) { } } export class EventTransceiverTransmitAnalyticsEvent implements Action { readonly type = EventTransceiverActions.EventTransceiverTransmitAnalyticsEvent; constructor(public payload: BasicPayload) { } }