import { Injectable } from '@nestjs/common';
import { ItemQueueEntity } from '../../domain/entities/item-queue.entity';
import { InjectRepository } from '@nestjs/typeorm';
import { ItemQueueModel } from '../models/item-queue.model';
import { CONNECTION_NAME } from 'src/core/strings/constants/base.constants';
import { Repository } from 'typeorm';
import { BaseReadService } from 'src/core/modules/data/service/base-read.service';

@Injectable()
export class ItemQueueReadService extends BaseReadService<ItemQueueEntity> {
  constructor(
    @InjectRepository(ItemQueueModel, CONNECTION_NAME.DEFAULT)
    private repo: Repository<ItemQueueModel>,
  ) {
    super(repo);
  }

  async list(): Promise<ItemQueueEntity[]> {
    return this.repo.find();
  }
}
