import { Injectable } from '@angular/core';
import { IProduct } from '../models/order.interface';

@Injectable({
  providedIn: 'root',
})
export class Products {
  public getProductList(): IProduct[] {
    return [
      {
        id: 1,
        name: 'Classic Burger',
        basePrice: 8.5,
        bestChoice: false,
        img: 'rindburger.png',
      },
      {
        id: 2,
        name: 'Mr.Krabs Burger',
        basePrice: 9.5,
        bestChoice: true,
        img: 'krabsburger.png',
      },
      {
        id: 3,
        name: 'Veggie Burger',
        basePrice: 10.0,
        bestChoice: false,
        img: 'veggieburger.png',
      },
    ];
  }

  getProductById(id: number) {
    return this.getProductList().find((product) => {
      return product.id === id;
    })
  }

}
