import { QueueCondition } from '../formula/queue-condition.formula';
import { CustomerQueueItemListManager } from './customer-queue-item-list.manager';
import { ItemQueueModel } from 'src/modules/item-related/item-queue/data/models/item-queue.model';

export class CustomerQueueRecommendManager extends CustomerQueueItemListManager {
  recommend(items: ItemQueueModel[]) {
    const queueCondition = new QueueCondition(this.queues);

    return items.map((queueItem) => {
      const item = queueItem.items[0];
      return {
        id: item.id,
        queue_item_id: queueItem.id,
        title: queueItem.name,
        image_url: item.image_url,

        queue_condition: queueCondition.condition(queueItem.id),
      };
    });
  }
}
