New pikkuboksi order types added

This commit is contained in:
2024-01-01 19:43:50 +02:00
parent 546780b2e1
commit 4914fb8c76
3 changed files with 45 additions and 5 deletions

View File

@@ -24,7 +24,18 @@ defmodule Osuuspuutarha.Orders.Order do
:merimasku :merimasku
] ]
field :order_type, Ecto.Enum, values: [:full, :everyother, :elo, :community] field :order_type, Ecto.Enum,
values: [
:full,
:everyother,
:elo,
:community,
:full_pikku,
:everyother_pikku,
:elo_pikku,
:community_pikku
]
field :pcode, :string field :pcode, :string
field :phone, :string field :phone, :string
field :split_invoice, :boolean, default: false field :split_invoice, :boolean, default: false

View File

@@ -7,9 +7,18 @@ defmodule Osuuspuutarha.Orders.Parser do
end end
end end
@spec parse_order_type(:community | :elo | :everyother | :full) :: <<_::64, _::_*8>> @spec parse_order_type(
:community
| :elo
| :everyother
| :full
| :full_pikku
| :everyother_pikku
| :elo_pikku
| :community_pikku
) :: <<_::64, _::_*8>>
def parse_order_type(:full) do def parse_order_type(:full) do
"Joka viikko" "Koko kausi"
end end
def parse_order_type(:everyother) do def parse_order_type(:everyother) do
@@ -21,7 +30,23 @@ defmodule Osuuspuutarha.Orders.Parser do
end end
def parse_order_type(:community) do def parse_order_type(:community) do
"Osuuskuntatoiminta" "Viljely-yhteisö"
end
def parse_order_type(:full_pikku) do
"Koko kausi (pikkuboksi)"
end
def parse_order_type(:everyother_pikku) do
"Joka toinen viikko (pikkuboksi)"
end
def parse_order_type(:elo_pikku) do
"Elotilaus (pikkuboksi)"
end
def parse_order_type(:community_pikku) do
"Viljely-yhteisö (pikkuboksi)"
end end
@spec parse_location( @spec parse_location(

View File

@@ -16,7 +16,11 @@
"Koko kausi": :full, "Koko kausi": :full,
"Joka toinen viikko": :everyother, "Joka toinen viikko": :everyother,
"Elotilaus": :elo, "Elotilaus": :elo,
"Viljely-yhteisö": :community "Viljely-yhteisö": :community,
"Koko kausi (pikkuboksi)": :full_pikku,
"Joka toinen viikko (pikkuboksi)": :everyother_pikku,
"Elotilaus (pikkuboksi)": :elo_pikku,
"Viljely-yhteisö (pikkuboksi)": :community_pikku
], ],
prompt: "Ei valintaa" prompt: "Ei valintaa"
%> %>