All checks were successful
build / build (push) Successful in 11s
Implements a fully-featured action requests table in a single LiveView module using Flop, Ecto, and SQLite. Includes: - Fuzzy search, status/assignment filters, column sorting, 15-per-page pagination - Real-time updates, bookmarkable URLs via `handle_params/3` - JS-disabled fallback with GET forms (no duplicate logic) - 1,000,000 seeded records, Tailwind + DaisyUI styling, light/dark themes - Comprehensive README with comparisons to Django+React/Rails+React stacks - 31 tests covering all scenarios Tech: Phoenix 1.8+, LiveView, Flop, Ecto, SQLite, Elixir 1.15+
18 lines
548 B
Elixir
18 lines
548 B
Elixir
defmodule ActionRequestsDemo.Factory do
|
|
alias ActionRequestsDemo.Repo
|
|
alias ActionRequestsDemo.ActionRequests.ActionRequest
|
|
|
|
def insert_action_request(attrs \\ %{}) do
|
|
default_attrs = %{
|
|
patient_name: "Patient #{System.unique_integer([:positive])}",
|
|
status: Enum.random(["resolved", "unresolved"]),
|
|
assigned_user_id: Enum.random([nil, 1, 2]),
|
|
delivery_scheduled_at: ~N[2025-11-16 10:00:00]
|
|
}
|
|
|
|
%ActionRequest{}
|
|
|> ActionRequest.changeset(Map.merge(default_attrs, attrs))
|
|
|> Repo.insert!()
|
|
end
|
|
end
|