Change to correct plant names
This commit is contained in:
49
lib/osuuspuutarha/harvest/parser.ex
Normal file
49
lib/osuuspuutarha/harvest/parser.ex
Normal 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
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user