import { OrderTypeFeature } from '@isa/common/data-access';

export function getOrderTypeFeature(
  features: Record<string, string> = {},
): OrderTypeFeature | undefined {
  const orderType = features['orderType'];

  if (
    orderType &&
    Object.values(OrderTypeFeature).includes(orderType as OrderTypeFeature)
  ) {
    return orderType as OrderTypeFeature;
  }
  return undefined;
}
