import { SupportedEventRequest as ApiSupportedEventRequest } from '@spiffy-ai/commerce-api-client';
import { SupportedEventRequest as CoreSupportedEventRequest } from '../models/api/supportedEventRequest';
import { coreUserEventToApiUserEvent } from './coreUserEventToApiUserEvent';
import { coreContextToApiContext } from './coreContextToApiContext';

export const coreSupportedEventRequestToApiRequest = (
  coreSupportedEventRequest: CoreSupportedEventRequest,
): ApiSupportedEventRequest => ({
  id: coreSupportedEventRequest.id,
  user_event: coreUserEventToApiUserEvent(coreSupportedEventRequest.userEvent),
  context: coreContextToApiContext(coreSupportedEventRequest.context),
});
