@eagleeye-solutions/integration-events-common
Version:
Eagle Eye CDP connector common functionality
27 lines (26 loc) • 1.21 kB
TypeScript
import { EeAirOutboundEvent } from '..';
import { POSConnectWalletRefundEventData } from '../types';
import { BaseEventHandlerOpts } from './types';
/**
* Returns an array of events derived from a POSCONNECT.WALLET.REFUND event.
*
* Note that a refund may either be a full refund (i.e. all products in the original
* order are refunded) or a partial refund, where only a subset of the original
* products are refunded.
*
* Handling of Points accounts
*
* For a full refund, we expect a walletAccountTransactionEntity/UPDATE/POINTS
* with event = REFUND_DEBIT to be the only operation on the points account, so
* this is used to derive the new points balances.
*
* For a partial refund, we expect the same walletAccountTransactionEntity/UPDATE/POINTS
* with event = REFUND_DEBIT that deducts the original total number of points
* awarded, followed by a walletAccountTransactionEntity/UPDATE/POINTS with event = EARN
* that awards points for the non-refunded items in the original order.
*
* @param event
* @param configuration
* @returns
*/
export declare function getPosConnectWalletRefundEventData(event: EeAirOutboundEvent, opts: BaseEventHandlerOpts): POSConnectWalletRefundEventData;