Change to correct plant names

This commit is contained in:
2023-06-25 22:03:07 +03:00
parent 8d7b91abb0
commit ca47202a87
8 changed files with 99 additions and 10 deletions

View File

@@ -0,0 +1,49 @@
defmodule Osuuspuutarha.Harvest.Parser do
def parse_plant(:lettuce) do
"Lettuce"
end
def parse_plant(:tomato) do
"Tomato"
end
def parse_plant(:cabbage) do
"Cabbage"
end
def parse_plant(:pumpkin) do
"Pumpkin"
end
def parse_plant(:zucchini) do
"Zucchini"
end
def parse_plant(:cucumber) do
"Cucumber"
end
def parse_plant(:melon) do
"Melon"
end
def parse_plant(:sweet_corn) do
"Sweet Corn"
end
def parse_plant(:bean) do
"Bean"
end
def parse_plant(:parsnip) do
"Parsnip"
end
def parse_plant(:carrot) do
"Carrot"
end
def parse_plant(:beetroot) do
"Beetroot"
end
end

View File

@@ -5,7 +5,23 @@ defmodule Osuuspuutarha.Harvest.Yield do
schema "yields" do
field :amount, :decimal
field :date, :date
field :plant, Ecto.Enum, values: [:salad, :carrot, :cabbage]
field :plant, Ecto.Enum,
values: [
:lettuce,
:tomato,
:cabbage,
:pumpkin,
:zucchini,
:cucumber,
:melon,
:sweet_corn,
:bean,
:parsnip,
:carrot,
:beetroot
]
field :unit, Ecto.Enum, values: [:kg, :kpl]
timestamps()