berrypod/lib/berrypod_web/live/shop/orders.ex
jamey 01ff8decd5
All checks were successful
deploy / deploy (push) Successful in 1m17s
add order status lookup for customers
Magic link flow on contact page: customer enters email, gets a
time-limited signed link, clicks through to /orders showing all their
paid orders and full detail pages with thumbnails and product links.

- OrderLookupController generates/verifies Phoenix.Token signed links
- Contact LiveView handles lookup_orders + reset_tracking events
- Orders and OrderDetail LiveViews gated by session email
- Order detail shows thumbnails, links to products still available
- .themed-button gets base padding/font-weight so all usages are consistent
- order-summary-card sticky scoped to .cart-grid (was leaking to orders list)
- 27 new tests (1095 total)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 08:40:08 +00:00

35 lines
680 B
Elixir

defmodule BerrypodWeb.Shop.Orders do
use BerrypodWeb, :live_view
alias Berrypod.Orders
@impl true
def mount(_params, session, socket) do
email = session["order_lookup_email"]
socket =
socket
|> assign(:page_title, "Your orders")
|> assign(:lookup_email, email)
socket =
if email do
assign(socket, :orders, Orders.list_orders_by_email(email))
else
assign(socket, :orders, nil)
end
{:ok, socket}
end
@impl true
def handle_params(_params, _uri, socket), do: {:noreply, socket}
@impl true
def render(assigns) do
~H"""
<BerrypodWeb.PageTemplates.orders {assigns} />
"""
end
end