
class CategoryConverterUseCase {
  constructor({categoriesMapping}) {
    this.categoriesMapping = categoriesMapping
  }

  execute(category) {
    const entry = this.categoriesMapping.find(item => item.id === category)

    return entry ? entry.related[0].split(', ').map(str => str.trim()) : null;
  }
}

module.exports = { CategoryConverterUseCase }