import { IHubEventJoin, IHubEventLeave, IHubJoinRequestBase } from './hubs'; import { IConfirmUserDetails } from './client-app-hub'; export declare type TCheckoutOrderAction = 'idle' | 'add-orderline' | 'remove-orderline' | 'modify-quantity' | 'pick-discount-product-new' | 'pick-discount-product-upgrade' | 'pick-discount-product-downgrade' | 'pick-discount-product-prompt-user' | 'start-payment' | 'finish-payment' | 'checkout-start' | 'checkout-stop' | 'checkout-completed' | 'confirm-user-details-cancel' | 'confirm-user-details'; export declare type TFeedbackAction = 'pick-discount-product' | 'confirm-user-details'; /** * The display order updated event * * @export * @interface IHubEventDisplayOrderUpdated */ export interface IHubEventDisplayOrderUpdated { /** * The current order details * * @type {EVA.Core.OrderDto} */ ShoppingCart: EVA.Core.OrderDto; /** * The current order amounts data: (sub)totals, discounts, taxes, etc * * @type {EVA.Core.OpenOrderAmounts} */ Amounts: EVA.Core.OpenOrderAmounts; /** * Custom pay load data which differ per Action type * */ AdditionalData: { /** * The action type. See TCheckoutOrderAction above * * @type {TCheckoutOrderAction} */ Action: TCheckoutOrderAction; /** * The target order line for add, remove or modify quantity messages * * @type {number} */ OrderLineID?: number; /** * The details of the payment that was started or finished * Used for: `start-payment` and `finish-payment` * * @type {{ * Method: string; * ChangeAmount?: number; * Success?: boolean; * }} */ Payment?: { Method: string; ChangeAmount?: number; Success?: boolean; }; /** * Potential discount details for display purposes. Always sent if available * * @type {EVA.Core.PrefigureDiscountsResponse} */ PrefigureDiscounts?: EVA.Core.PrefigureDiscountsResponse; /** * Potential discount products for display purposes. Always sent if available * * @type {EVA.Core.GetProductsResponse} */ DiscountProducts?: EVA.Core.GetProductsResponse; /** * Potential gift product choices for display purposes. Always sent if available * * @type {EVA.Core.GetPickProductDiscountOptionsForOrderResponse} */ PickProductDiscountsForOrder?: EVA.Core.GetPickProductDiscountOptionsForOrderResponse; /** * The details for a `confirm-user-details` message * * @type {IConfirmUserDetails} */ ConfirmUserDetails?: IConfirmUserDetails; /** * Placeholder typings for future custom data */ [name: string]: any; }; } /** * The CFD feedback received event * * @export * @interface IHubEventFeedbackReceived */ export interface IHubEventFeedbackReceived { DeviceID: number; Feedback: { Action: TFeedbackAction; PickProductDiscountOptionsForOrderLine?: EVA.Core.SetPickProductDiscountOptionsForOrderLine; ConfirmUserDetails?: IConfirmUserDetails; }; } /** * The customer facing display hub join request payload * * @export * @interface IHubCustomerFacingDisplayJoinRequest */ export interface IHubCustomerFacingDisplayJoinRequest extends IHubJoinRequestBase { deviceId: number; displayOrderUpdatedCallback?: (orderEvent: IHubEventDisplayOrderUpdated) => void; feedbackReceivedCallback?: (feedbackEvent: IHubEventFeedbackReceived) => void; joinCallback?: (joinEvent: IHubEventJoin) => void; leaveCallback?: (leaveEvent: IHubEventLeave) => void; } export interface IHubPushDisplayOrderToDeviceID extends IHubEventDisplayOrderUpdated { DeviceID: number; }