Autogen Yield liveviews

This commit is contained in:
2023-06-08 21:07:00 +03:00
parent 090053c312
commit 3a983516c9
13 changed files with 578 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
defmodule Osuuspuutarha.HarvestFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Osuuspuutarha.Harvest` context.
"""
@doc """
Generate a yield.
"""
def yield_fixture(attrs \\ %{}) do
{:ok, yield} =
attrs
|> Enum.into(%{
amount: "120.5",
date: ~D[2023-06-07],
plant: :salad,
unit: :kg
})
|> Osuuspuutarha.Harvest.create_yield()
yield
end
end