# Script for populating the database. You can run it as:
#
#     mix run priv/repo/seeds.exs
#
# Inside the script, you can read and write to any of your
# repositories directly:
#
#     App.Repo.insert!(%App.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.

App.Repo.delete_all(App.Product)

products = [
  %{name: "Wireless Bluetooth Earbuds", price: 49.99},
  %{name: "Smartphone Stand/Holder", price: 14.99},
  %{name: "Laptop Backpack", price: 39.99},
  %{name: "Insulated Stainless Steel Water Bottle (1L)", price: 24.99},
  %{name: "LED Desk Lamp with USB Charging Port", price: 29.99},
  %{name: "Wireless Charging Pad", price: 19.99},
  %{name: "Fitness Tracker Smart Band", price: 34.99},
  %{name: "Portable Power Bank (10,000mAh)", price: 29.99},
  %{name: "Noise-Canceling Over-Ear Headphones", price: 79.99},
  %{name: "Adjustable Laptop Stand", price: 25.99}
]

Enum.each(products, fn product ->
  App.Repo.insert!(%App.Product{name: product.name, price: product.price})
end)
