// src/lib/orders.ts
function getReservationsLimitCount(order) {
  if (!order?.items?.length) {
    return 0;
  }
  return order.items.reduce((acc, item) => {
    const offerLinkCount = item.offer?.inventory_item_link?.length;
    const variantInventoryCount = item.variant?.inventory_items?.length;
    return acc + (offerLinkCount || variantInventoryCount || 1);
  }, 0);
}

export {
  getReservationsLimitCount
};
