From e4cf7ca1984c5a9817b2b74aa57e593c9c573570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veikko=20Lintuj=C3=A4rvi?= Date: Thu, 13 Mar 2025 22:41:49 +0200 Subject: [PATCH] New delivery spot added to registration form --- lib/osuuspuutarha/orders/order.ex | 2 +- lib/osuuspuutarha/orders/parser.ex | 6 +++--- .../live/order_live/form_component.html.heex | 12 ++++++------ test/osuuspuutarha/orders_test.exs | 4 ++-- test/osuuspuutarha_web/live/order_live_test.exs | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/osuuspuutarha/orders/order.ex b/lib/osuuspuutarha/orders/order.ex index 890272b..3edcc6b 100644 --- a/lib/osuuspuutarha/orders/order.ex +++ b/lib/osuuspuutarha/orders/order.ex @@ -14,7 +14,7 @@ defmodule Osuuspuutarha.Orders.Order do field :location, Ecto.Enum, values: [ :koroinen, - :ocean, + :kissakahvila, :raisio, :naantali, :viherlassila, diff --git a/lib/osuuspuutarha/orders/parser.ex b/lib/osuuspuutarha/orders/parser.ex index 371b6fe..0f7f2a6 100644 --- a/lib/osuuspuutarha/orders/parser.ex +++ b/lib/osuuspuutarha/orders/parser.ex @@ -55,7 +55,7 @@ defmodule Osuuspuutarha.Orders.Parser do | :koroinen | :livonsaari | :naantali - | :ocean + | :kissakahvila | :raisio | :viherlassila | :merimasku @@ -65,8 +65,8 @@ defmodule Osuuspuutarha.Orders.Parser do "Koroinen" end - def parse_location(:ocean) do - "Ocean Spirit" + def parse_location(:kissakahvila) do + "Turku, Martinkatu 1, Kissakahvila" end def parse_location(:raisio) do diff --git a/lib/osuuspuutarha_web/live/order_live/form_component.html.heex b/lib/osuuspuutarha_web/live/order_live/form_component.html.heex index eeae17b..adfddbf 100644 --- a/lib/osuuspuutarha_web/live/order_live/form_component.html.heex +++ b/lib/osuuspuutarha_web/live/order_live/form_component.html.heex @@ -46,15 +46,15 @@ <%= select f, :location, [ - "Koroinen, Koroistentie 2": "koroinen", - "Ocean Spirit, Linnankatu 37": "ocean", + "Turku, Koroistentie 2, Koroinen": "koroinen", + "Turku, Martinkatu 1, Kissakahvila": "kissakahvila", + "Turku, Alakyläntie 2, Viherlassila": "viherlassila", + "Turku, Vanha Suurtori 3, Kirjakahvila": "kirjakahvila", "Raisio, Timonkuja 8": "raisio", "Naantali, Alitalontie 20": "naantali", - "Viherlassila, Alakyläntie 2": "viherlassila", - "Kirjakahvila, Vanha Suurtori 3": "kirjakahvila", - "Askainen, Askaistentie 986": "askainen", + "Askainen, Askaistentie 751, Askaisten Holvi": "askainen", "Livonsaari, Pohjanpääntie 90": "livonsaari", - "C/o Naantalin hunaja, Paltteentie 2, Merimasku": "merimasku", + "Merimasku, Paltteentie 2, ℅ Naantalin hunaja": "merimasku", "Masku, Mäksmäentie 9": "masku" ], prompt: "Ei valintaa" diff --git a/test/osuuspuutarha/orders_test.exs b/test/osuuspuutarha/orders_test.exs index 6f9d198..c16c236 100644 --- a/test/osuuspuutarha/orders_test.exs +++ b/test/osuuspuutarha/orders_test.exs @@ -82,7 +82,7 @@ defmodule Osuuspuutarha.OrdersTest do fname: "some updated fname", is_member: false, lname: "some updated lname", - location: :ocean, + location: :kissakahvila, order_type: :everyother, pcode: "some updated pcode", phone: "some updated phone", @@ -98,7 +98,7 @@ defmodule Osuuspuutarha.OrdersTest do assert order.fname == "some updated fname" assert order.is_member == false assert order.lname == "some updated lname" - assert order.location == :ocean + assert order.location == :kissakahvila assert order.order_type == :everyother assert order.pcode == "some updated pcode" assert order.phone == "some updated phone" diff --git a/test/osuuspuutarha_web/live/order_live_test.exs b/test/osuuspuutarha_web/live/order_live_test.exs index ed6a0c1..7f334f3 100644 --- a/test/osuuspuutarha_web/live/order_live_test.exs +++ b/test/osuuspuutarha_web/live/order_live_test.exs @@ -27,7 +27,7 @@ defmodule OsuuspuutarhaWeb.OrderLiveTest do fname: "some updated fname", is_member: false, lname: "some updated lname", - location: :ocean, + location: :kissakahvila, order_type: :everyother, pcode: "some updated pcode", phone: "some updated phone",