<.link
- navigate={Routes.ammo_group_show_path(Endpoint, :show, ammo_group)}
+ navigate={Routes.pack_show_path(Endpoint, :show, pack)}
class="text-primary-600 link"
aria-label={
- dgettext("actions", "View ammo group of %{ammo_group_count} bullets",
- ammo_group_count: ammo_group_count
+ dgettext("actions", "View ammo group of %{pack_count} bullets",
+ pack_count: pack_count
)
}
>
@@ -216,11 +216,11 @@
<% else %>
<.ammo_group_card
- :for={%{id: ammo_group_id, container_id: container_id} = ammo_group <- @ammo_groups}
- ammo_group={ammo_group}
- original_count={@original_counts && Map.fetch!(@original_counts, ammo_group_id)}
- cpr={Map.get(@cprs, ammo_group_id)}
- last_used_date={Map.get(@last_used_dates, ammo_group_id)}
+ :for={%{id: pack_id, container_id: container_id} = pack <- @packs}
+ pack={pack}
+ original_count={@original_counts && Map.fetch!(@original_counts, pack_id)}
+ cpr={Map.get(@cprs, pack_id)}
+ last_used_date={Map.get(@last_used_dates, pack_id)}
current_user={@current_user}
container={Map.fetch!(@containers, container_id)}
/>
diff --git a/lib/cannery_web/live/container_live/index.ex b/lib/cannery_web/live/container_live/index.ex
index 07084e4b..c5f6e741 100644
--- a/lib/cannery_web/live/container_live/index.ex
+++ b/lib/cannery_web/live/container_live/index.ex
@@ -79,15 +79,15 @@ defmodule CanneryWeb.ContainerLive.Index do
prompt = dgettext("prompts", "%{name} has been deleted", name: container_name)
socket |> put_flash(:info, prompt) |> display_containers()
- {:error, %{action: :delete, errors: [ammo_groups: _error], valid?: false} = changeset} ->
- ammo_groups_error = changeset |> changeset_errors(:ammo_groups) |> Enum.join(", ")
+ {:error, %{action: :delete, errors: [packs: _error], valid?: false} = changeset} ->
+ packs_error = changeset |> changeset_errors(:packs) |> Enum.join(", ")
prompt =
dgettext(
"errors",
"Could not delete %{name}: %{error}",
name: changeset |> Changeset.get_field(:name, "container"),
- error: ammo_groups_error
+ error: packs_error
)
socket |> put_flash(:error, prompt)
diff --git a/lib/cannery_web/live/container_live/show.ex b/lib/cannery_web/live/container_live/show.ex
index 50a2d6a1..042a17bc 100644
--- a/lib/cannery_web/live/container_live/show.ex
+++ b/lib/cannery_web/live/container_live/show.ex
@@ -64,13 +64,13 @@ defmodule CanneryWeb.ContainerLive.Show do
|> put_flash(:info, prompt)
|> push_navigate(to: Routes.container_index_path(socket, :index))
- {:error, %{action: :delete, errors: [ammo_groups: _error], valid?: false} = changeset} ->
- ammo_groups_error = changeset |> changeset_errors(:ammo_groups) |> Enum.join(", ")
+ {:error, %{action: :delete, errors: [packs: _error], valid?: false} = changeset} ->
+ packs_error = changeset |> changeset_errors(:packs) |> Enum.join(", ")
prompt =
dgettext("errors", "Could not delete %{name}: %{error}",
name: changeset |> Changeset.get_field(:name, "container"),
- error: ammo_groups_error
+ error: packs_error
)
socket |> put_flash(:error, prompt)
@@ -109,10 +109,10 @@ defmodule CanneryWeb.ContainerLive.Show do
current_user
) do
%{name: container_name} = container = Containers.get_container!(id, current_user)
- ammo_groups = Ammo.list_ammo_groups_for_container(container, class, current_user)
- original_counts = ammo_groups |> Ammo.get_original_counts(current_user)
- cprs = ammo_groups |> Ammo.get_cprs(current_user)
- last_used_dates = ammo_groups |> ActivityLog.get_last_used_dates(current_user)
+ packs = Ammo.list_packs_for_container(container, class, current_user)
+ original_counts = packs |> Ammo.get_original_counts(current_user)
+ cprs = packs |> Ammo.get_cprs(current_user)
+ last_used_dates = packs |> ActivityLog.get_last_used_dates(current_user)
page_title =
case live_action do
@@ -125,8 +125,8 @@ defmodule CanneryWeb.ContainerLive.Show do
|> assign(
container: container,
round_count: Ammo.get_round_count_for_container!(container, current_user),
- ammo_groups_count: Ammo.get_ammo_groups_count_for_container!(container, current_user),
- ammo_groups: ammo_groups,
+ packs_count: Ammo.get_packs_count_for_container!(container, current_user),
+ packs: packs,
original_counts: original_counts,
cprs: cprs,
last_used_dates: last_used_dates,
diff --git a/lib/cannery_web/live/container_live/show.html.heex b/lib/cannery_web/live/container_live/show.html.heex
index 79e07d63..8d732dfe 100644
--- a/lib/cannery_web/live/container_live/show.html.heex
+++ b/lib/cannery_web/live/container_live/show.html.heex
@@ -20,7 +20,7 @@
<%= gettext("Packs:") %>
- <%= @ammo_groups_count %>
+ <%= @packs_count %>
@@ -118,16 +118,16 @@
- <%= if @ammo_groups |> Enum.empty?() do %>
+ <%= if @packs |> Enum.empty?() do %>
<%= gettext("No ammo in this container") %>
<% else %>
<%= if @view_table do %>
<.live_component
- module={CanneryWeb.Components.AmmoGroupTableComponent}
+ module={CanneryWeb.Components.PackTableComponent}
id="ammo-type-show-table"
- ammo_groups={@ammo_groups}
+ packs={@packs}
current_user={@current_user}
show_used={false}
>
@@ -140,11 +140,11 @@
<% else %>
<.ammo_group_card
- :for={%{id: ammo_group_id} = ammo_group <- @ammo_groups}
- ammo_group={ammo_group}
- original_count={Map.fetch!(@original_counts, ammo_group_id)}
- cpr={Map.get(@cprs, ammo_group_id)}
- last_used_date={Map.get(@last_used_dates, ammo_group_id)}
+ :for={%{id: pack_id} = pack <- @packs}
+ pack={pack}
+ original_count={Map.fetch!(@original_counts, pack_id)}
+ cpr={Map.get(@cprs, pack_id)}
+ last_used_date={Map.get(@last_used_dates, pack_id)}
current_user={@current_user}
/>
diff --git a/lib/cannery_web/live/range_live/form_component.ex b/lib/cannery_web/live/range_live/form_component.ex
index 5de223a6..acb28dfe 100644
--- a/lib/cannery_web/live/range_live/form_component.ex
+++ b/lib/cannery_web/live/range_live/form_component.ex
@@ -4,33 +4,33 @@ defmodule CanneryWeb.RangeLive.FormComponent do
"""
use CanneryWeb, :live_component
- alias Cannery.{Accounts.User, ActivityLog, ActivityLog.ShotGroup, Ammo, Ammo.AmmoGroup}
+ alias Cannery.{Accounts.User, ActivityLog, ActivityLog.ShotGroup, Ammo, Ammo.Pack}
alias Ecto.Changeset
alias Phoenix.LiveView.Socket
@impl true
- def mount(socket), do: {:ok, socket |> assign(:ammo_group, nil)}
+ def mount(socket), do: {:ok, socket |> assign(:pack, nil)}
@impl true
@spec update(
%{
required(:shot_group) => ShotGroup.t(),
required(:current_user) => User.t(),
- optional(:ammo_group) => AmmoGroup.t(),
+ optional(:pack) => Pack.t(),
optional(any()) => any()
},
Socket.t()
) :: {:ok, Socket.t()}
def update(
%{
- shot_group: %ShotGroup{ammo_group_id: ammo_group_id},
+ shot_group: %ShotGroup{pack_id: pack_id},
current_user: current_user
} = assigns,
socket
)
- when is_binary(ammo_group_id) do
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- {:ok, socket |> assign(assigns) |> assign(:ammo_group, ammo_group) |> assign_changeset(%{})}
+ when is_binary(pack_id) do
+ pack = Ammo.get_pack!(pack_id, current_user)
+ {:ok, socket |> assign(assigns) |> assign(:pack, pack) |> assign_changeset(%{})}
end
def update(%{shot_group: %ShotGroup{}} = assigns, socket) do
@@ -66,7 +66,7 @@ defmodule CanneryWeb.RangeLive.FormComponent do
assigns: %{
action: live_action,
current_user: user,
- ammo_group: ammo_group,
+ pack: pack,
shot_group: shot_group
}
} = socket,
@@ -81,7 +81,7 @@ defmodule CanneryWeb.RangeLive.FormComponent do
changeset =
case default_action do
- :insert -> shot_group |> ShotGroup.create_changeset(user, ammo_group, shot_group_params)
+ :insert -> shot_group |> ShotGroup.create_changeset(user, pack, shot_group_params)
:update -> shot_group |> ShotGroup.update_changeset(user, shot_group_params)
end
diff --git a/lib/cannery_web/live/range_live/form_component.html.heex b/lib/cannery_web/live/range_live/form_component.html.heex
index 28b631ad..3be3aee6 100644
--- a/lib/cannery_web/live/range_live/form_component.html.heex
+++ b/lib/cannery_web/live/range_live/form_component.html.heex
@@ -22,7 +22,7 @@
<%= label(f, :count, gettext("Shots fired"), class: "title text-lg text-primary-600") %>
<%= number_input(f, :count,
min: 1,
- max: @shot_group.count + @ammo_group.count,
+ max: @shot_group.count + @pack.count,
class: "input input-primary col-span-2"
) %>
<%= error_tag(f, :count, "col-span-3") %>
diff --git a/lib/cannery_web/live/range_live/index.ex b/lib/cannery_web/live/range_live/index.ex
index 0e459757..ad914fe9 100644
--- a/lib/cannery_web/live/range_live/index.ex
+++ b/lib/cannery_web/live/range_live/index.ex
@@ -1,6 +1,6 @@
defmodule CanneryWeb.RangeLive.Index do
@moduledoc """
- Main page for range day mode, where `AmmoGroup`s can be used up.
+ Main page for range day mode, where `Pack`s can be used up.
"""
use CanneryWeb, :live_view
@@ -30,7 +30,7 @@ defmodule CanneryWeb.RangeLive.Index do
socket
|> assign(
page_title: gettext("Record Shots"),
- ammo_group: Ammo.get_ammo_group!(id, current_user)
+ pack: Ammo.get_pack!(id, current_user)
)
end
@@ -82,13 +82,12 @@ defmodule CanneryWeb.RangeLive.Index do
def handle_event(
"toggle_staged",
- %{"ammo_group_id" => ammo_group_id},
+ %{"pack_id" => pack_id},
%{assigns: %{current_user: current_user}} = socket
) do
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
+ pack = Ammo.get_pack!(pack_id, current_user)
- {:ok, _ammo_group} =
- ammo_group |> Ammo.update_ammo_group(%{"staged" => !ammo_group.staged}, current_user)
+ {:ok, _pack} = pack |> Ammo.update_pack(%{"staged" => !pack.staged}, current_user)
prompt = dgettext("prompts", "Ammo unstaged succesfully")
{:noreply, socket |> put_flash(:info, prompt) |> display_shot_groups()}
@@ -123,15 +122,15 @@ defmodule CanneryWeb.RangeLive.Index do
%{assigns: %{class: class, search: search, current_user: current_user}} = socket
) do
shot_groups = ActivityLog.list_shot_groups(search, class, current_user)
- ammo_groups = Ammo.list_staged_ammo_groups(current_user)
+ packs = Ammo.list_staged_packs(current_user)
chart_data = shot_groups |> get_chart_data_for_shot_group()
- original_counts = ammo_groups |> Ammo.get_original_counts(current_user)
- cprs = ammo_groups |> Ammo.get_cprs(current_user)
- last_used_dates = ammo_groups |> ActivityLog.get_last_used_dates(current_user)
+ original_counts = packs |> Ammo.get_original_counts(current_user)
+ cprs = packs |> Ammo.get_cprs(current_user)
+ last_used_dates = packs |> ActivityLog.get_last_used_dates(current_user)
socket
|> assign(
- ammo_groups: ammo_groups,
+ packs: packs,
original_counts: original_counts,
cprs: cprs,
last_used_dates: last_used_dates,
diff --git a/lib/cannery_web/live/range_live/index.html.heex b/lib/cannery_web/live/range_live/index.html.heex
index 527d19d4..23c832f4 100644
--- a/lib/cannery_web/live/range_live/index.html.heex
+++ b/lib/cannery_web/live/range_live/index.html.heex
@@ -3,43 +3,43 @@
<%= gettext("Range day") %>
- <%= if @ammo_groups |> Enum.empty?() do %>
+ <%= if @packs |> Enum.empty?() do %>
<%= gettext("No ammo staged") %>
<%= display_emoji("😔") %>
- <.link navigate={Routes.ammo_group_index_path(Endpoint, :index)} class="btn btn-primary">
+ <.link navigate={Routes.pack_index_path(Endpoint, :index)} class="btn btn-primary">
<%= dgettext("actions", "Why not get some ready to shoot?") %>
<% else %>
- <.link navigate={Routes.ammo_group_index_path(Endpoint, :index)} class="btn btn-primary">
+ <.link navigate={Routes.pack_index_path(Endpoint, :index)} class="btn btn-primary">
<%= dgettext("actions", "Stage ammo") %>
<.ammo_group_card
- :for={%{id: ammo_group_id} = ammo_group <- @ammo_groups}
- ammo_group={ammo_group}
- original_count={Map.fetch!(@original_counts, ammo_group_id)}
- cpr={Map.get(@cprs, ammo_group_id)}
- last_used_date={Map.get(@last_used_dates, ammo_group_id)}
+ :for={%{id: pack_id} = pack <- @packs}
+ pack={pack}
+ original_count={Map.fetch!(@original_counts, pack_id)}
+ cpr={Map.get(@cprs, pack_id)}
+ last_used_date={Map.get(@last_used_dates, pack_id)}
current_user={@current_user}
>
<.link
- patch={Routes.range_index_path(Endpoint, :add_shot_group, ammo_group)}
+ patch={Routes.range_index_path(Endpoint, :add_shot_group, pack)}
class="btn btn-primary"
>
<%= dgettext("actions", "Record shots") %>
@@ -186,7 +186,7 @@
id={:new}
title={@page_title}
action={@live_action}
- ammo_group={@ammo_group}
+ pack={@pack}
return_to={Routes.range_index_path(Endpoint, :index)}
current_user={@current_user}
/>
diff --git a/lib/cannery_web/router.ex b/lib/cannery_web/router.ex
index 0c2bebca..cf611013 100644
--- a/lib/cannery_web/router.ex
+++ b/lib/cannery_web/router.ex
@@ -89,19 +89,19 @@ defmodule CanneryWeb.Router do
live "/container/edit/:id", ContainerLive.Show, :edit
live "/container/edit_tags/:id", ContainerLive.Show, :edit_tags
- live "/ammo", AmmoGroupLive.Index, :index
- live "/ammo/new", AmmoGroupLive.Index, :new
- live "/ammo/edit/:id", AmmoGroupLive.Index, :edit
- live "/ammo/clone/:id", AmmoGroupLive.Index, :clone
- live "/ammo/add_shot_group/:id", AmmoGroupLive.Index, :add_shot_group
- live "/ammo/move/:id", AmmoGroupLive.Index, :move
- live "/ammo/search/:search", AmmoGroupLive.Index, :search
+ live "/ammo", PackLive.Index, :index
+ live "/ammo/new", PackLive.Index, :new
+ live "/ammo/edit/:id", PackLive.Index, :edit
+ live "/ammo/clone/:id", PackLive.Index, :clone
+ live "/ammo/add_shot_group/:id", PackLive.Index, :add_shot_group
+ live "/ammo/move/:id", PackLive.Index, :move
+ live "/ammo/search/:search", PackLive.Index, :search
- live "/ammo/show/:id", AmmoGroupLive.Show, :show
- live "/ammo/show/edit/:id", AmmoGroupLive.Show, :edit
- live "/ammo/show/add_shot_group/:id", AmmoGroupLive.Show, :add_shot_group
- live "/ammo/show/move/:id", AmmoGroupLive.Show, :move
- live "/ammo/show/:id/edit/:shot_group_id", AmmoGroupLive.Show, :edit_shot_group
+ live "/ammo/show/:id", PackLive.Show, :show
+ live "/ammo/show/edit/:id", PackLive.Show, :edit
+ live "/ammo/show/add_shot_group/:id", PackLive.Show, :add_shot_group
+ live "/ammo/show/move/:id", PackLive.Show, :move
+ live "/ammo/show/:id/edit/:shot_group_id", PackLive.Show, :edit_shot_group
live "/range", RangeLive.Index, :index
live "/range/edit/:id", RangeLive.Index, :edit
diff --git a/priv/gettext/actions.pot b/priv/gettext/actions.pot
index 607760a8..04d5a57c 100644
--- a/priv/gettext/actions.pot
+++ b/priv/gettext/actions.pot
@@ -157,18 +157,18 @@ msgid "Why not get some ready to shoot?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:98
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:90
+#: lib/cannery_web/components/move_ammo_group_component.ex:88
#, elixir-autogen, elixir-format
msgid "Add another container!"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:126
+#: lib/cannery_web/components/move_ammo_group_component.ex:124
#, elixir-autogen, elixir-format
msgid "Select"
msgstr ""
@@ -208,9 +208,9 @@ msgstr ""
msgid "add an ammo type first"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:80
+#: lib/cannery_web/components/move_ammo_group_component.ex:78
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr ""
@@ -220,13 +220,13 @@ msgstr ""
msgid "Set Unlimited"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:89
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:87
#: lib/cannery_web/live/range_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Stage for range"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:88
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:86
#: lib/cannery_web/live/range_live/index.html.heex:37
#, elixir-autogen, elixir-format
msgid "Unstage from range"
@@ -276,7 +276,7 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:161
+#: lib/cannery_web/live/ammo_group_live/show.ex:160
#: lib/cannery_web/live/range_live/index.html.heex:155
#, elixir-autogen, elixir-format
msgid "Delete shot record of %{shot_group_count} shots"
@@ -300,18 +300,12 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
-#, elixir-autogen, elixir-format
-msgid "Edit ammo group of %{ammo_group_count} bullets"
-msgstr ""
-
#: lib/cannery_web/live/invite_live/index.html.heex:46
#, elixir-autogen, elixir-format
msgid "Edit invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:146
+#: lib/cannery_web/live/ammo_group_live/show.ex:145
#, elixir-autogen, elixir-format
msgid "Edit shot group of %{shot_group_count} shots"
msgstr ""
@@ -344,17 +338,23 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format
-msgid "Clone ammo group of %{ammo_group_count} bullets"
+msgid "Clone ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format
-msgid "Delete ammo group of %{ammo_group_count} bullets"
+msgid "Delete ammo group of %{pack_count} bullets"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
+#, elixir-autogen, elixir-format
+msgid "Edit ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format
-msgid "View ammo group of %{ammo_group_count} bullets"
+msgid "View ammo group of %{pack_count} bullets"
msgstr ""
diff --git a/priv/gettext/de/LC_MESSAGES/actions.po b/priv/gettext/de/LC_MESSAGES/actions.po
index 1e36e6df..d4849d85 100644
--- a/priv/gettext/de/LC_MESSAGES/actions.po
+++ b/priv/gettext/de/LC_MESSAGES/actions.po
@@ -170,18 +170,18 @@ msgid "Why not get some ready to shoot?"
msgstr "Warum nicht einige für den Schießstand auswählen?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:98
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr "Schüsse dokumentieren"
-#: lib/cannery_web/components/move_ammo_group_component.ex:90
+#: lib/cannery_web/components/move_ammo_group_component.ex:88
#, elixir-autogen, elixir-format
msgid "Add another container!"
msgstr "Einen weiteren Behälter hinzufügen!"
-#: lib/cannery_web/components/move_ammo_group_component.ex:126
+#: lib/cannery_web/components/move_ammo_group_component.ex:124
#, elixir-autogen, elixir-format
msgid "Select"
msgstr "Markieren"
@@ -221,9 +221,9 @@ msgstr ""
msgid "add an ammo type first"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:80
+#: lib/cannery_web/components/move_ammo_group_component.ex:78
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr ""
@@ -233,13 +233,13 @@ msgstr ""
msgid "Set Unlimited"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:89
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:87
#: lib/cannery_web/live/range_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Stage for range"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:88
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:86
#: lib/cannery_web/live/range_live/index.html.heex:37
#, elixir-autogen, elixir-format
msgid "Unstage from range"
@@ -289,7 +289,7 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:161
+#: lib/cannery_web/live/ammo_group_live/show.ex:160
#: lib/cannery_web/live/range_live/index.html.heex:155
#, elixir-autogen, elixir-format
msgid "Delete shot record of %{shot_group_count} shots"
@@ -313,18 +313,12 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
-#, elixir-autogen, elixir-format
-msgid "Edit ammo group of %{ammo_group_count} bullets"
-msgstr ""
-
#: lib/cannery_web/live/invite_live/index.html.heex:46
#, elixir-autogen, elixir-format
msgid "Edit invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:146
+#: lib/cannery_web/live/ammo_group_live/show.ex:145
#, elixir-autogen, elixir-format
msgid "Edit shot group of %{shot_group_count} shots"
msgstr ""
@@ -357,17 +351,23 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
-msgid "Clone ammo group of %{ammo_group_count} bullets"
+msgid "Clone ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format, fuzzy
-msgid "Delete ammo group of %{ammo_group_count} bullets"
+msgid "Delete ammo group of %{pack_count} bullets"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
-msgid "View ammo group of %{ammo_group_count} bullets"
+msgid "View ammo group of %{pack_count} bullets"
msgstr ""
diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po
index f7a58ded..3fe720de 100644
--- a/priv/gettext/de/LC_MESSAGES/default.po
+++ b/priv/gettext/de/LC_MESSAGES/default.po
@@ -38,7 +38,7 @@ msgstr "Admins:"
msgid "Ammo"
msgstr "Munition"
-#: lib/cannery_web/components/ammo_group_table_component.ex:96
+#: lib/cannery_web/components/ammo_group_table_component.ex:95
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Ammo type"
@@ -90,8 +90,8 @@ msgstr "Patrone"
msgid "Case material"
msgstr "Gehäusematerial"
-#: lib/cannery_web/components/ammo_group_table_component.ex:74
-#: lib/cannery_web/components/move_ammo_group_component.ex:67
+#: lib/cannery_web/components/ammo_group_table_component.ex:73
+#: lib/cannery_web/components/move_ammo_group_component.ex:65
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:59
#, elixir-autogen, elixir-format
msgid "Container"
@@ -111,7 +111,7 @@ msgstr "Behälter"
msgid "Corrosive"
msgstr "Korrosiv"
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:28
#, elixir-autogen, elixir-format
msgid "Count"
@@ -196,7 +196,7 @@ msgid "Keep me logged in for 60 days"
msgstr "Für 60 Tage eingeloggt bleiben"
#: lib/cannery_web/components/container_table_component.ex:47
-#: lib/cannery_web/components/move_ammo_group_component.ex:69
+#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/container_live/form_component.html.heex:47
#, elixir-autogen, elixir-format
msgid "Location"
@@ -293,13 +293,13 @@ msgstr "Keine Tags"
#: lib/cannery_web/components/add_shot_group_component.html.heex:38
#: lib/cannery_web/components/shot_group_table_component.ex:43
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:50
-#: lib/cannery_web/live/ammo_group_live/show.ex:92
+#: lib/cannery_web/live/ammo_group_live/show.ex:91
#: lib/cannery_web/live/range_live/form_component.html.heex:30
#, elixir-autogen, elixir-format
msgid "Notes"
msgstr "Bemerkungen"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:29
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:26
#: lib/cannery_web/live/ammo_group_live/show.html.heex:24
#, elixir-autogen, elixir-format
msgid "Notes:"
@@ -316,13 +316,13 @@ msgstr "Auf dem Bücherregal"
msgid "Pressure"
msgstr "Druck"
-#: lib/cannery_web/components/ammo_group_table_component.ex:82
+#: lib/cannery_web/components/ammo_group_table_component.ex:81
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:35
#, elixir-autogen, elixir-format
msgid "Price paid"
msgstr "Kaufpreis"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:44
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:41
#, elixir-autogen, elixir-format
msgid "Price paid:"
msgstr "Kaufpreis:"
@@ -366,7 +366,7 @@ msgstr "Einfach:"
msgid "Steel"
msgstr "Stahl"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
#, elixir-autogen, elixir-format
msgid "Stored in"
msgstr "Gelagert in"
@@ -402,7 +402,7 @@ msgid "Tracer"
msgstr "Leuchtspur"
#: lib/cannery_web/components/container_table_component.ex:48
-#: lib/cannery_web/components/move_ammo_group_component.ex:68
+#: lib/cannery_web/components/move_ammo_group_component.ex:66
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "Type"
@@ -434,7 +434,7 @@ msgstr "Ihre Daten bleiben bei Ihnen, Punkt"
msgid "No tags for this container"
msgstr "Keine Tags für diesen Behälter"
-#: lib/cannery_web/components/ammo_group_table_component.ex:78
+#: lib/cannery_web/components/ammo_group_table_component.ex:77
#: lib/cannery_web/components/core_components/topbar.html.heex:66
#, elixir-autogen, elixir-format
msgid "Range"
@@ -447,7 +447,7 @@ msgstr "Range Day"
#: lib/cannery_web/components/add_shot_group_component.html.heex:49
#: lib/cannery_web/components/shot_group_table_component.ex:44
-#: lib/cannery_web/live/ammo_group_live/show.ex:93
+#: lib/cannery_web/live/ammo_group_live/show.ex:92
#: lib/cannery_web/live/range_live/form_component.html.heex:41
#, elixir-autogen, elixir-format
msgid "Date"
@@ -493,7 +493,7 @@ msgid "Rounds left"
msgstr "Patronen verbleibend"
#: lib/cannery_web/components/shot_group_table_component.ex:42
-#: lib/cannery_web/live/ammo_group_live/show.ex:91
+#: lib/cannery_web/live/ammo_group_live/show.ex:90
#: lib/cannery_web/live/range_live/index.html.heex:69
#, elixir-autogen, elixir-format
msgid "Rounds shot"
@@ -510,7 +510,7 @@ msgstr "Schießkladde"
msgid "Move ammo"
msgstr "Munition verschieben"
-#: lib/cannery_web/components/move_ammo_group_component.ex:85
+#: lib/cannery_web/components/move_ammo_group_component.ex:83
#, elixir-autogen, elixir-format
msgid "No other containers"
msgstr "Kein weiterer Behälter"
@@ -520,11 +520,11 @@ msgstr "Kein weiterer Behälter"
msgid "Shot log"
msgstr "Schießkladde"
-#: lib/cannery_web/components/ammo_group_table_component.ex:164
-#: lib/cannery_web/components/ammo_group_table_component.ex:247
+#: lib/cannery_web/components/ammo_group_table_component.ex:163
+#: lib/cannery_web/components/ammo_group_table_component.ex:246
#: lib/cannery_web/components/ammo_type_table_component.ex:261
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:45
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:50
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:42
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:47
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:42
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
@@ -614,15 +614,15 @@ msgstr "Editiere %{name} Tags"
msgid "Rounds:"
msgstr "Patronen:"
-#: lib/cannery_web/components/ammo_group_table_component.ex:161
-#: lib/cannery_web/components/ammo_group_table_component.ex:243
+#: lib/cannery_web/components/ammo_group_table_component.ex:160
+#: lib/cannery_web/components/ammo_group_table_component.ex:242
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr "Keine Preisinformationen"
-#: lib/cannery_web/components/ammo_group_table_component.ex:84
+#: lib/cannery_web/components/ammo_group_table_component.ex:83
#, elixir-autogen, elixir-format
msgid "% left"
msgstr "% verbleibend"
@@ -647,7 +647,7 @@ msgstr "Ursprüngliche Anzahl:"
msgid "Percentage left:"
msgstr "Prozent verbleibend:"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:126
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:121
#, elixir-autogen, elixir-format
msgid "Rounds used"
msgstr "Patronen verbraucht"
@@ -762,7 +762,7 @@ msgstr "Keine Munitionsgruppe in diesem Behälter"
msgid "Show Ammo"
msgstr "Zeige Munitionsarten"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:118
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
#, elixir-autogen, elixir-format, fuzzy
msgid "This ammo is not in a container"
msgstr "Diese Munitionsgruppe ist nicht in einem Behälter"
@@ -790,7 +790,7 @@ msgstr ""
msgid "Leave \"Uses left\" blank to make invite unlimited"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:54
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:51
#, elixir-autogen, elixir-format, fuzzy
msgid "Container:"
msgstr "Behälter"
@@ -802,13 +802,13 @@ msgstr "Behälter"
msgid "Show used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:202
+#: lib/cannery_web/components/ammo_group_table_component.ex:201
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""
-#: lib/cannery_web/live/range_live/index.ex:153
+#: lib/cannery_web/live/range_live/index.ex:152
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds shot: %{count}"
msgstr "Patronen abgefeuert"
@@ -989,28 +989,28 @@ msgstr ""
msgid "Edit %{ammo_type_name}"
msgstr "%{name} bearbeiten"
-#: lib/cannery_web/components/ammo_group_table_component.ex:251
+#: lib/cannery_web/components/ammo_group_table_component.ex:250
#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:17
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:81
+#: lib/cannery_web/components/ammo_group_table_component.ex:80
#, elixir-autogen, elixir-format
msgid "CPR"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:49
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:46
#, elixir-autogen, elixir-format
msgid "CPR:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:88
+#: lib/cannery_web/components/ammo_group_table_component.ex:87
#, elixir-autogen, elixir-format, fuzzy
msgid "Original Count"
msgstr "Ursprüngliche Anzahl:"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:24
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:21
#, elixir-autogen, elixir-format, fuzzy
msgid "Original Count:"
msgstr "Ursprüngliche Anzahl:"
@@ -1020,28 +1020,28 @@ msgstr "Ursprüngliche Anzahl:"
msgid "Home"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:64
+#: lib/cannery_web/components/ammo_group_table_component.ex:63
#, elixir-autogen, elixir-format
msgid "Last used on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:39
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:36
#, elixir-autogen, elixir-format
msgid "Last used on:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:182
+#: lib/cannery_web/components/ammo_group_table_component.ex:181
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:69
+#: lib/cannery_web/components/ammo_group_table_component.ex:68
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:42
#, elixir-autogen, elixir-format
msgid "Purchased on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:34
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:31
#: lib/cannery_web/live/ammo_group_live/show.html.heex:30
#, elixir-autogen, elixir-format
msgid "Purchased on:"
@@ -1218,12 +1218,12 @@ msgstr ""
msgid "Really great weather"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:60
+#: lib/cannery_web/components/ammo_group_table_component.ex:59
#: lib/cannery_web/components/ammo_type_table_component.ex:100
#: lib/cannery_web/components/container_table_component.ex:67
-#: lib/cannery_web/components/move_ammo_group_component.ex:70
+#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/components/shot_group_table_component.ex:45
-#: lib/cannery_web/live/ammo_group_live/show.ex:94
+#: lib/cannery_web/live/ammo_group_live/show.ex:93
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""
@@ -1238,7 +1238,7 @@ msgstr ""
msgid "Log out"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#, elixir-autogen, elixir-format
msgid "Current Count"
msgstr ""
diff --git a/priv/gettext/de/LC_MESSAGES/errors.po b/priv/gettext/de/LC_MESSAGES/errors.po
index 09935a63..3410531f 100644
--- a/priv/gettext/de/LC_MESSAGES/errors.po
+++ b/priv/gettext/de/LC_MESSAGES/errors.po
@@ -161,12 +161,12 @@ msgstr ""
msgid "Tag could not be removed"
msgstr "Tag konnte nicht gelöscht werden"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:160
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:159
#, elixir-autogen, elixir-format
msgid "Could not parse number of copies"
msgstr "Konnte die Anzahl der Kopien nicht verstehen"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:150
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:149
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
@@ -203,7 +203,7 @@ msgstr ""
msgid "Ammo left must be at least 0"
msgstr ""
-#: lib/cannery/activity_log/shot_group.ex:122
+#: lib/cannery/activity_log/shot_group.ex:119
#, elixir-autogen, elixir-format, fuzzy
msgid "Count can be at most %{count} shots"
msgstr "Anzahl muss weniger als %{count} betragen"
diff --git a/priv/gettext/de/LC_MESSAGES/prompts.po b/priv/gettext/de/LC_MESSAGES/prompts.po
index a545d6a0..d6141760 100644
--- a/priv/gettext/de/LC_MESSAGES/prompts.po
+++ b/priv/gettext/de/LC_MESSAGES/prompts.po
@@ -74,7 +74,7 @@ msgid "Are you sure you want to delete %{name}?"
msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:72
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
msgstr "Sind Sie sicher, dass sie diese Munition löschen möchten?"
@@ -176,13 +176,13 @@ msgstr "Schüsse erfolgreich dokumentiert"
msgid "Are you sure you want to unstage this ammo?"
msgstr "Sind sie sicher, dass Sie diese Munition demarkieren möchten?"
-#: lib/cannery_web/live/ammo_group_live/show.ex:159
+#: lib/cannery_web/live/ammo_group_live/show.ex:158
#: lib/cannery_web/live/range_live/index.html.heex:152
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?"
msgstr "Sind sie sicher, dass sie die Schießkladde löschen möchten?"
-#: lib/cannery_web/live/ammo_group_live/show.ex:81
+#: lib/cannery_web/live/ammo_group_live/show.ex:80
#: lib/cannery_web/live/range_live/index.ex:79
#, elixir-autogen, elixir-format
msgid "Shot records deleted succesfully"
@@ -198,7 +198,7 @@ msgstr "Schießkladde erfolgreich aktualisiert"
msgid "%{email} confirmed successfully."
msgstr "%{email} erfolgreich bestätigt."
-#: lib/cannery_web/components/move_ammo_group_component.ex:54
+#: lib/cannery_web/components/move_ammo_group_component.ex:52
#, elixir-autogen, elixir-format
msgid "Ammo moved to %{name} successfully"
msgstr "Munition erfolgreich zu %{name} verschoben"
@@ -240,17 +240,17 @@ msgstr "Spracheinstellung gespeichert."
msgid "Ammo deleted succesfully"
msgstr "Munitionsgruppe erfolgreich gelöscht"
-#: lib/cannery_web/live/range_live/index.ex:93
+#: lib/cannery_web/live/range_live/index.ex:92
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo unstaged succesfully"
msgstr "Munition erfolgreich demarkiert"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:126
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:125
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo updated successfully"
msgstr "Munitionsgruppe erfolgreich aktualisiert"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:185
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:184
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot
index 4c34fdf2..1194a61f 100644
--- a/priv/gettext/default.pot
+++ b/priv/gettext/default.pot
@@ -34,7 +34,7 @@ msgstr ""
msgid "Ammo"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:96
+#: lib/cannery_web/components/ammo_group_table_component.ex:95
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Ammo type"
@@ -86,8 +86,8 @@ msgstr ""
msgid "Case material"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:74
-#: lib/cannery_web/components/move_ammo_group_component.ex:67
+#: lib/cannery_web/components/ammo_group_table_component.ex:73
+#: lib/cannery_web/components/move_ammo_group_component.ex:65
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:59
#, elixir-autogen, elixir-format
msgid "Container"
@@ -107,7 +107,7 @@ msgstr ""
msgid "Corrosive"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:28
#, elixir-autogen, elixir-format
msgid "Count"
@@ -192,7 +192,7 @@ msgid "Keep me logged in for 60 days"
msgstr ""
#: lib/cannery_web/components/container_table_component.ex:47
-#: lib/cannery_web/components/move_ammo_group_component.ex:69
+#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/container_live/form_component.html.heex:47
#, elixir-autogen, elixir-format
msgid "Location"
@@ -289,13 +289,13 @@ msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:38
#: lib/cannery_web/components/shot_group_table_component.ex:43
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:50
-#: lib/cannery_web/live/ammo_group_live/show.ex:92
+#: lib/cannery_web/live/ammo_group_live/show.ex:91
#: lib/cannery_web/live/range_live/form_component.html.heex:30
#, elixir-autogen, elixir-format
msgid "Notes"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:29
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:26
#: lib/cannery_web/live/ammo_group_live/show.html.heex:24
#, elixir-autogen, elixir-format
msgid "Notes:"
@@ -312,13 +312,13 @@ msgstr ""
msgid "Pressure"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:82
+#: lib/cannery_web/components/ammo_group_table_component.ex:81
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:35
#, elixir-autogen, elixir-format
msgid "Price paid"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:44
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:41
#, elixir-autogen, elixir-format
msgid "Price paid:"
msgstr ""
@@ -360,7 +360,7 @@ msgstr ""
msgid "Steel"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
#, elixir-autogen, elixir-format
msgid "Stored in"
msgstr ""
@@ -396,7 +396,7 @@ msgid "Tracer"
msgstr ""
#: lib/cannery_web/components/container_table_component.ex:48
-#: lib/cannery_web/components/move_ammo_group_component.ex:68
+#: lib/cannery_web/components/move_ammo_group_component.ex:66
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "Type"
@@ -428,7 +428,7 @@ msgstr ""
msgid "No tags for this container"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:78
+#: lib/cannery_web/components/ammo_group_table_component.ex:77
#: lib/cannery_web/components/core_components/topbar.html.heex:66
#, elixir-autogen, elixir-format
msgid "Range"
@@ -441,7 +441,7 @@ msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:49
#: lib/cannery_web/components/shot_group_table_component.ex:44
-#: lib/cannery_web/live/ammo_group_live/show.ex:93
+#: lib/cannery_web/live/ammo_group_live/show.ex:92
#: lib/cannery_web/live/range_live/form_component.html.heex:41
#, elixir-autogen, elixir-format
msgid "Date"
@@ -487,7 +487,7 @@ msgid "Rounds left"
msgstr ""
#: lib/cannery_web/components/shot_group_table_component.ex:42
-#: lib/cannery_web/live/ammo_group_live/show.ex:91
+#: lib/cannery_web/live/ammo_group_live/show.ex:90
#: lib/cannery_web/live/range_live/index.html.heex:69
#, elixir-autogen, elixir-format
msgid "Rounds shot"
@@ -504,7 +504,7 @@ msgstr ""
msgid "Move ammo"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:85
+#: lib/cannery_web/components/move_ammo_group_component.ex:83
#, elixir-autogen, elixir-format
msgid "No other containers"
msgstr ""
@@ -514,11 +514,11 @@ msgstr ""
msgid "Shot log"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:164
-#: lib/cannery_web/components/ammo_group_table_component.ex:247
+#: lib/cannery_web/components/ammo_group_table_component.ex:163
+#: lib/cannery_web/components/ammo_group_table_component.ex:246
#: lib/cannery_web/components/ammo_type_table_component.ex:261
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:45
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:50
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:42
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:47
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:42
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
@@ -608,15 +608,15 @@ msgstr ""
msgid "Rounds:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:161
-#: lib/cannery_web/components/ammo_group_table_component.ex:243
+#: lib/cannery_web/components/ammo_group_table_component.ex:160
+#: lib/cannery_web/components/ammo_group_table_component.ex:242
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:84
+#: lib/cannery_web/components/ammo_group_table_component.ex:83
#, elixir-autogen, elixir-format
msgid "% left"
msgstr ""
@@ -641,7 +641,7 @@ msgstr ""
msgid "Percentage left:"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:126
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:121
#, elixir-autogen, elixir-format
msgid "Rounds used"
msgstr ""
@@ -756,7 +756,7 @@ msgstr ""
msgid "Show Ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:118
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
#, elixir-autogen, elixir-format
msgid "This ammo is not in a container"
msgstr ""
@@ -784,7 +784,7 @@ msgstr ""
msgid "Leave \"Uses left\" blank to make invite unlimited"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:54
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:51
#, elixir-autogen, elixir-format
msgid "Container:"
msgstr ""
@@ -796,13 +796,13 @@ msgstr ""
msgid "Show used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:202
+#: lib/cannery_web/components/ammo_group_table_component.ex:201
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""
-#: lib/cannery_web/live/range_live/index.ex:153
+#: lib/cannery_web/live/range_live/index.ex:152
#, elixir-autogen, elixir-format
msgid "Rounds shot: %{count}"
msgstr ""
@@ -983,28 +983,28 @@ msgstr ""
msgid "Edit %{ammo_type_name}"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:251
+#: lib/cannery_web/components/ammo_group_table_component.ex:250
#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:17
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:81
+#: lib/cannery_web/components/ammo_group_table_component.ex:80
#, elixir-autogen, elixir-format
msgid "CPR"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:49
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:46
#, elixir-autogen, elixir-format
msgid "CPR:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:88
+#: lib/cannery_web/components/ammo_group_table_component.ex:87
#, elixir-autogen, elixir-format
msgid "Original Count"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:24
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:21
#, elixir-autogen, elixir-format
msgid "Original Count:"
msgstr ""
@@ -1014,28 +1014,28 @@ msgstr ""
msgid "Home"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:64
+#: lib/cannery_web/components/ammo_group_table_component.ex:63
#, elixir-autogen, elixir-format
msgid "Last used on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:39
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:36
#, elixir-autogen, elixir-format
msgid "Last used on:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:182
+#: lib/cannery_web/components/ammo_group_table_component.ex:181
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:69
+#: lib/cannery_web/components/ammo_group_table_component.ex:68
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:42
#, elixir-autogen, elixir-format
msgid "Purchased on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:34
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:31
#: lib/cannery_web/live/ammo_group_live/show.html.heex:30
#, elixir-autogen, elixir-format
msgid "Purchased on:"
@@ -1201,12 +1201,12 @@ msgstr ""
msgid "Really great weather"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:60
+#: lib/cannery_web/components/ammo_group_table_component.ex:59
#: lib/cannery_web/components/ammo_type_table_component.ex:100
#: lib/cannery_web/components/container_table_component.ex:67
-#: lib/cannery_web/components/move_ammo_group_component.ex:70
+#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/components/shot_group_table_component.ex:45
-#: lib/cannery_web/live/ammo_group_live/show.ex:94
+#: lib/cannery_web/live/ammo_group_live/show.ex:93
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""
@@ -1221,7 +1221,7 @@ msgstr ""
msgid "Log out"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#, elixir-autogen, elixir-format
msgid "Current Count"
msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/actions.po b/priv/gettext/en/LC_MESSAGES/actions.po
index 47ca3b8e..9c19952c 100644
--- a/priv/gettext/en/LC_MESSAGES/actions.po
+++ b/priv/gettext/en/LC_MESSAGES/actions.po
@@ -157,18 +157,18 @@ msgid "Why not get some ready to shoot?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:98
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:90
+#: lib/cannery_web/components/move_ammo_group_component.ex:88
#, elixir-autogen, elixir-format
msgid "Add another container!"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:126
+#: lib/cannery_web/components/move_ammo_group_component.ex:124
#, elixir-autogen, elixir-format
msgid "Select"
msgstr ""
@@ -208,9 +208,9 @@ msgstr ""
msgid "add an ammo type first"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:80
+#: lib/cannery_web/components/move_ammo_group_component.ex:78
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr ""
@@ -220,13 +220,13 @@ msgstr ""
msgid "Set Unlimited"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:89
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:87
#: lib/cannery_web/live/range_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Stage for range"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:88
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:86
#: lib/cannery_web/live/range_live/index.html.heex:37
#, elixir-autogen, elixir-format
msgid "Unstage from range"
@@ -276,7 +276,7 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:161
+#: lib/cannery_web/live/ammo_group_live/show.ex:160
#: lib/cannery_web/live/range_live/index.html.heex:155
#, elixir-autogen, elixir-format
msgid "Delete shot record of %{shot_group_count} shots"
@@ -300,18 +300,12 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
-#, elixir-autogen, elixir-format
-msgid "Edit ammo group of %{ammo_group_count} bullets"
-msgstr ""
-
#: lib/cannery_web/live/invite_live/index.html.heex:46
#, elixir-autogen, elixir-format
msgid "Edit invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:146
+#: lib/cannery_web/live/ammo_group_live/show.ex:145
#, elixir-autogen, elixir-format
msgid "Edit shot group of %{shot_group_count} shots"
msgstr ""
@@ -344,17 +338,23 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
-msgid "Clone ammo group of %{ammo_group_count} bullets"
+msgid "Clone ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format, fuzzy
-msgid "Delete ammo group of %{ammo_group_count} bullets"
+msgid "Delete ammo group of %{pack_count} bullets"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
-msgid "View ammo group of %{ammo_group_count} bullets"
+msgid "View ammo group of %{pack_count} bullets"
msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po
index 89d499fd..629ebc61 100644
--- a/priv/gettext/en/LC_MESSAGES/default.po
+++ b/priv/gettext/en/LC_MESSAGES/default.po
@@ -34,7 +34,7 @@ msgstr ""
msgid "Ammo"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:96
+#: lib/cannery_web/components/ammo_group_table_component.ex:95
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Ammo type"
@@ -86,8 +86,8 @@ msgstr ""
msgid "Case material"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:74
-#: lib/cannery_web/components/move_ammo_group_component.ex:67
+#: lib/cannery_web/components/ammo_group_table_component.ex:73
+#: lib/cannery_web/components/move_ammo_group_component.ex:65
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:59
#, elixir-autogen, elixir-format
msgid "Container"
@@ -107,7 +107,7 @@ msgstr ""
msgid "Corrosive"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:28
#, elixir-autogen, elixir-format
msgid "Count"
@@ -192,7 +192,7 @@ msgid "Keep me logged in for 60 days"
msgstr ""
#: lib/cannery_web/components/container_table_component.ex:47
-#: lib/cannery_web/components/move_ammo_group_component.ex:69
+#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/container_live/form_component.html.heex:47
#, elixir-autogen, elixir-format
msgid "Location"
@@ -289,13 +289,13 @@ msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:38
#: lib/cannery_web/components/shot_group_table_component.ex:43
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:50
-#: lib/cannery_web/live/ammo_group_live/show.ex:92
+#: lib/cannery_web/live/ammo_group_live/show.ex:91
#: lib/cannery_web/live/range_live/form_component.html.heex:30
#, elixir-autogen, elixir-format
msgid "Notes"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:29
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:26
#: lib/cannery_web/live/ammo_group_live/show.html.heex:24
#, elixir-autogen, elixir-format
msgid "Notes:"
@@ -312,13 +312,13 @@ msgstr ""
msgid "Pressure"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:82
+#: lib/cannery_web/components/ammo_group_table_component.ex:81
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:35
#, elixir-autogen, elixir-format
msgid "Price paid"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:44
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:41
#, elixir-autogen, elixir-format
msgid "Price paid:"
msgstr ""
@@ -360,7 +360,7 @@ msgstr ""
msgid "Steel"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
#, elixir-autogen, elixir-format
msgid "Stored in"
msgstr ""
@@ -396,7 +396,7 @@ msgid "Tracer"
msgstr ""
#: lib/cannery_web/components/container_table_component.ex:48
-#: lib/cannery_web/components/move_ammo_group_component.ex:68
+#: lib/cannery_web/components/move_ammo_group_component.ex:66
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "Type"
@@ -428,7 +428,7 @@ msgstr ""
msgid "No tags for this container"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:78
+#: lib/cannery_web/components/ammo_group_table_component.ex:77
#: lib/cannery_web/components/core_components/topbar.html.heex:66
#, elixir-autogen, elixir-format
msgid "Range"
@@ -441,7 +441,7 @@ msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:49
#: lib/cannery_web/components/shot_group_table_component.ex:44
-#: lib/cannery_web/live/ammo_group_live/show.ex:93
+#: lib/cannery_web/live/ammo_group_live/show.ex:92
#: lib/cannery_web/live/range_live/form_component.html.heex:41
#, elixir-autogen, elixir-format
msgid "Date"
@@ -487,7 +487,7 @@ msgid "Rounds left"
msgstr ""
#: lib/cannery_web/components/shot_group_table_component.ex:42
-#: lib/cannery_web/live/ammo_group_live/show.ex:91
+#: lib/cannery_web/live/ammo_group_live/show.ex:90
#: lib/cannery_web/live/range_live/index.html.heex:69
#, elixir-autogen, elixir-format
msgid "Rounds shot"
@@ -504,7 +504,7 @@ msgstr ""
msgid "Move ammo"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:85
+#: lib/cannery_web/components/move_ammo_group_component.ex:83
#, elixir-autogen, elixir-format
msgid "No other containers"
msgstr ""
@@ -514,11 +514,11 @@ msgstr ""
msgid "Shot log"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:164
-#: lib/cannery_web/components/ammo_group_table_component.ex:247
+#: lib/cannery_web/components/ammo_group_table_component.ex:163
+#: lib/cannery_web/components/ammo_group_table_component.ex:246
#: lib/cannery_web/components/ammo_type_table_component.ex:261
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:45
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:50
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:42
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:47
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:42
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
@@ -608,15 +608,15 @@ msgstr ""
msgid "Rounds:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:161
-#: lib/cannery_web/components/ammo_group_table_component.ex:243
+#: lib/cannery_web/components/ammo_group_table_component.ex:160
+#: lib/cannery_web/components/ammo_group_table_component.ex:242
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:84
+#: lib/cannery_web/components/ammo_group_table_component.ex:83
#, elixir-autogen, elixir-format
msgid "% left"
msgstr ""
@@ -641,7 +641,7 @@ msgstr ""
msgid "Percentage left:"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:126
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:121
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds used"
msgstr ""
@@ -756,7 +756,7 @@ msgstr ""
msgid "Show Ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:118
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
#, elixir-autogen, elixir-format, fuzzy
msgid "This ammo is not in a container"
msgstr ""
@@ -784,7 +784,7 @@ msgstr ""
msgid "Leave \"Uses left\" blank to make invite unlimited"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:54
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:51
#, elixir-autogen, elixir-format, fuzzy
msgid "Container:"
msgstr ""
@@ -796,13 +796,13 @@ msgstr ""
msgid "Show used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:202
+#: lib/cannery_web/components/ammo_group_table_component.ex:201
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""
-#: lib/cannery_web/live/range_live/index.ex:153
+#: lib/cannery_web/live/range_live/index.ex:152
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds shot: %{count}"
msgstr ""
@@ -983,28 +983,28 @@ msgstr ""
msgid "Edit %{ammo_type_name}"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:251
+#: lib/cannery_web/components/ammo_group_table_component.ex:250
#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:17
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:81
+#: lib/cannery_web/components/ammo_group_table_component.ex:80
#, elixir-autogen, elixir-format
msgid "CPR"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:49
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:46
#, elixir-autogen, elixir-format
msgid "CPR:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:88
+#: lib/cannery_web/components/ammo_group_table_component.ex:87
#, elixir-autogen, elixir-format, fuzzy
msgid "Original Count"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:24
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:21
#, elixir-autogen, elixir-format, fuzzy
msgid "Original Count:"
msgstr ""
@@ -1014,28 +1014,28 @@ msgstr ""
msgid "Home"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:64
+#: lib/cannery_web/components/ammo_group_table_component.ex:63
#, elixir-autogen, elixir-format
msgid "Last used on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:39
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:36
#, elixir-autogen, elixir-format
msgid "Last used on:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:182
+#: lib/cannery_web/components/ammo_group_table_component.ex:181
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:69
+#: lib/cannery_web/components/ammo_group_table_component.ex:68
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:42
#, elixir-autogen, elixir-format
msgid "Purchased on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:34
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:31
#: lib/cannery_web/live/ammo_group_live/show.html.heex:30
#, elixir-autogen, elixir-format
msgid "Purchased on:"
@@ -1201,12 +1201,12 @@ msgstr ""
msgid "Really great weather"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:60
+#: lib/cannery_web/components/ammo_group_table_component.ex:59
#: lib/cannery_web/components/ammo_type_table_component.ex:100
#: lib/cannery_web/components/container_table_component.ex:67
-#: lib/cannery_web/components/move_ammo_group_component.ex:70
+#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/components/shot_group_table_component.ex:45
-#: lib/cannery_web/live/ammo_group_live/show.ex:94
+#: lib/cannery_web/live/ammo_group_live/show.ex:93
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""
@@ -1221,7 +1221,7 @@ msgstr ""
msgid "Log out"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#, elixir-autogen, elixir-format
msgid "Current Count"
msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/errors.po b/priv/gettext/en/LC_MESSAGES/errors.po
index 7f39a48c..ed1c913a 100644
--- a/priv/gettext/en/LC_MESSAGES/errors.po
+++ b/priv/gettext/en/LC_MESSAGES/errors.po
@@ -146,12 +146,12 @@ msgstr ""
msgid "Tag could not be removed"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:160
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:159
#, elixir-autogen, elixir-format
msgid "Could not parse number of copies"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:150
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:149
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
@@ -186,7 +186,7 @@ msgstr ""
msgid "Ammo left must be at least 0"
msgstr ""
-#: lib/cannery/activity_log/shot_group.ex:122
+#: lib/cannery/activity_log/shot_group.ex:119
#, elixir-autogen, elixir-format, fuzzy
msgid "Count can be at most %{count} shots"
msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/prompts.po b/priv/gettext/en/LC_MESSAGES/prompts.po
index c6df360e..245509a9 100644
--- a/priv/gettext/en/LC_MESSAGES/prompts.po
+++ b/priv/gettext/en/LC_MESSAGES/prompts.po
@@ -59,7 +59,7 @@ msgid "Are you sure you want to delete %{name}?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:72
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
msgstr ""
@@ -155,13 +155,13 @@ msgstr ""
msgid "Are you sure you want to unstage this ammo?"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:159
+#: lib/cannery_web/live/ammo_group_live/show.ex:158
#: lib/cannery_web/live/range_live/index.html.heex:152
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:81
+#: lib/cannery_web/live/ammo_group_live/show.ex:80
#: lib/cannery_web/live/range_live/index.ex:79
#, elixir-autogen, elixir-format
msgid "Shot records deleted succesfully"
@@ -177,7 +177,7 @@ msgstr ""
msgid "%{email} confirmed successfully."
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:54
+#: lib/cannery_web/components/move_ammo_group_component.ex:52
#, elixir-autogen, elixir-format
msgid "Ammo moved to %{name} successfully"
msgstr ""
@@ -219,17 +219,17 @@ msgstr ""
msgid "Ammo deleted succesfully"
msgstr ""
-#: lib/cannery_web/live/range_live/index.ex:93
+#: lib/cannery_web/live/range_live/index.ex:92
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo unstaged succesfully"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:126
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:125
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo updated successfully"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:185
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:184
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
diff --git a/priv/gettext/errors.pot b/priv/gettext/errors.pot
index 0c61b4e4..6383d781 100644
--- a/priv/gettext/errors.pot
+++ b/priv/gettext/errors.pot
@@ -145,12 +145,12 @@ msgstr ""
msgid "Tag could not be removed"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:160
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:159
#, elixir-autogen, elixir-format
msgid "Could not parse number of copies"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:150
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:149
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
@@ -185,7 +185,7 @@ msgstr ""
msgid "Ammo left must be at least 0"
msgstr ""
-#: lib/cannery/activity_log/shot_group.ex:122
+#: lib/cannery/activity_log/shot_group.ex:119
#, elixir-autogen, elixir-format
msgid "Count can be at most %{count} shots"
msgstr ""
diff --git a/priv/gettext/es/LC_MESSAGES/actions.po b/priv/gettext/es/LC_MESSAGES/actions.po
index a4602f62..a2fb2f0e 100644
--- a/priv/gettext/es/LC_MESSAGES/actions.po
+++ b/priv/gettext/es/LC_MESSAGES/actions.po
@@ -170,18 +170,18 @@ msgid "Why not get some ready to shoot?"
msgstr "¿Por qué no preparar parte para disparar?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:98
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr "Tiros récord"
-#: lib/cannery_web/components/move_ammo_group_component.ex:90
+#: lib/cannery_web/components/move_ammo_group_component.ex:88
#, elixir-autogen, elixir-format
msgid "Add another container!"
msgstr "¡Añade otro contenedor!"
-#: lib/cannery_web/components/move_ammo_group_component.ex:126
+#: lib/cannery_web/components/move_ammo_group_component.ex:124
#, elixir-autogen, elixir-format
msgid "Select"
msgstr "Seleccionar"
@@ -221,9 +221,9 @@ msgstr "Ver en Catalogo"
msgid "add an ammo type first"
msgstr "añade primero un tipo de munición"
-#: lib/cannery_web/components/move_ammo_group_component.ex:80
+#: lib/cannery_web/components/move_ammo_group_component.ex:78
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr "Mover munición"
@@ -233,13 +233,13 @@ msgstr "Mover munición"
msgid "Set Unlimited"
msgstr "Activar ilimitados"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:89
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:87
#: lib/cannery_web/live/range_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Stage for range"
msgstr "Preparar para el campo de tiro"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:88
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:86
#: lib/cannery_web/live/range_live/index.html.heex:37
#, elixir-autogen, elixir-format
msgid "Unstage from range"
@@ -289,7 +289,7 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:161
+#: lib/cannery_web/live/ammo_group_live/show.ex:160
#: lib/cannery_web/live/range_live/index.html.heex:155
#, elixir-autogen, elixir-format
msgid "Delete shot record of %{shot_group_count} shots"
@@ -313,18 +313,12 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
-#, elixir-autogen, elixir-format
-msgid "Edit ammo group of %{ammo_group_count} bullets"
-msgstr ""
-
#: lib/cannery_web/live/invite_live/index.html.heex:46
#, elixir-autogen, elixir-format
msgid "Edit invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:146
+#: lib/cannery_web/live/ammo_group_live/show.ex:145
#, elixir-autogen, elixir-format
msgid "Edit shot group of %{shot_group_count} shots"
msgstr ""
@@ -357,17 +351,23 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
-msgid "Clone ammo group of %{ammo_group_count} bullets"
+msgid "Clone ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format, fuzzy
-msgid "Delete ammo group of %{ammo_group_count} bullets"
+msgid "Delete ammo group of %{pack_count} bullets"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
-msgid "View ammo group of %{ammo_group_count} bullets"
+msgid "View ammo group of %{pack_count} bullets"
msgstr ""
diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po
index 993eee9d..12e4c09c 100644
--- a/priv/gettext/es/LC_MESSAGES/default.po
+++ b/priv/gettext/es/LC_MESSAGES/default.po
@@ -38,7 +38,7 @@ msgstr "Aministradores:"
msgid "Ammo"
msgstr "Munición"
-#: lib/cannery_web/components/ammo_group_table_component.ex:96
+#: lib/cannery_web/components/ammo_group_table_component.ex:95
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Ammo type"
@@ -90,8 +90,8 @@ msgstr "Cartucho"
msgid "Case material"
msgstr "Material del casquillo"
-#: lib/cannery_web/components/ammo_group_table_component.ex:74
-#: lib/cannery_web/components/move_ammo_group_component.ex:67
+#: lib/cannery_web/components/ammo_group_table_component.ex:73
+#: lib/cannery_web/components/move_ammo_group_component.ex:65
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:59
#, elixir-autogen, elixir-format
msgid "Container"
@@ -111,7 +111,7 @@ msgstr "Contenedores"
msgid "Corrosive"
msgstr "Corrosiva"
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:28
#, elixir-autogen, elixir-format
msgid "Count"
@@ -196,7 +196,7 @@ msgid "Keep me logged in for 60 days"
msgstr "Mantener registrado durante 60 dÃas"
#: lib/cannery_web/components/container_table_component.ex:47
-#: lib/cannery_web/components/move_ammo_group_component.ex:69
+#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/container_live/form_component.html.heex:47
#, elixir-autogen, elixir-format
msgid "Location"
@@ -293,13 +293,13 @@ msgstr "Sin etiquetas"
#: lib/cannery_web/components/add_shot_group_component.html.heex:38
#: lib/cannery_web/components/shot_group_table_component.ex:43
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:50
-#: lib/cannery_web/live/ammo_group_live/show.ex:92
+#: lib/cannery_web/live/ammo_group_live/show.ex:91
#: lib/cannery_web/live/range_live/form_component.html.heex:30
#, elixir-autogen, elixir-format
msgid "Notes"
msgstr "Notas"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:29
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:26
#: lib/cannery_web/live/ammo_group_live/show.html.heex:24
#, elixir-autogen, elixir-format
msgid "Notes:"
@@ -316,13 +316,13 @@ msgstr "En la estanterÃa"
msgid "Pressure"
msgstr "Presión"
-#: lib/cannery_web/components/ammo_group_table_component.ex:82
+#: lib/cannery_web/components/ammo_group_table_component.ex:81
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:35
#, elixir-autogen, elixir-format
msgid "Price paid"
msgstr "Precio pagado"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:44
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:41
#, elixir-autogen, elixir-format
msgid "Price paid:"
msgstr "Precio pagado:"
@@ -366,7 +366,7 @@ msgstr "Simple:"
msgid "Steel"
msgstr "Acero"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
#, elixir-autogen, elixir-format
msgid "Stored in"
msgstr "Guardado en"
@@ -403,7 +403,7 @@ msgid "Tracer"
msgstr "Trazadora"
#: lib/cannery_web/components/container_table_component.ex:48
-#: lib/cannery_web/components/move_ammo_group_component.ex:68
+#: lib/cannery_web/components/move_ammo_group_component.ex:66
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "Type"
@@ -435,7 +435,7 @@ msgstr "Tus datos se quedan contigo, sin excepciones"
msgid "No tags for this container"
msgstr "Contenedor sin etiquetas"
-#: lib/cannery_web/components/ammo_group_table_component.ex:78
+#: lib/cannery_web/components/ammo_group_table_component.ex:77
#: lib/cannery_web/components/core_components/topbar.html.heex:66
#, elixir-autogen, elixir-format
msgid "Range"
@@ -448,7 +448,7 @@ msgstr "DÃa de disparar"
#: lib/cannery_web/components/add_shot_group_component.html.heex:49
#: lib/cannery_web/components/shot_group_table_component.ex:44
-#: lib/cannery_web/live/ammo_group_live/show.ex:93
+#: lib/cannery_web/live/ammo_group_live/show.ex:92
#: lib/cannery_web/live/range_live/form_component.html.heex:41
#, elixir-autogen, elixir-format
msgid "Date"
@@ -494,7 +494,7 @@ msgid "Rounds left"
msgstr "Balas restantes"
#: lib/cannery_web/components/shot_group_table_component.ex:42
-#: lib/cannery_web/live/ammo_group_live/show.ex:91
+#: lib/cannery_web/live/ammo_group_live/show.ex:90
#: lib/cannery_web/live/range_live/index.html.heex:69
#, elixir-autogen, elixir-format
msgid "Rounds shot"
@@ -511,7 +511,7 @@ msgstr "Récords de Tiro"
msgid "Move ammo"
msgstr "Mover munición"
-#: lib/cannery_web/components/move_ammo_group_component.ex:85
+#: lib/cannery_web/components/move_ammo_group_component.ex:83
#, elixir-autogen, elixir-format
msgid "No other containers"
msgstr "No hay otros contenedores"
@@ -521,11 +521,11 @@ msgstr "No hay otros contenedores"
msgid "Shot log"
msgstr "Registro de tiros"
-#: lib/cannery_web/components/ammo_group_table_component.ex:164
-#: lib/cannery_web/components/ammo_group_table_component.ex:247
+#: lib/cannery_web/components/ammo_group_table_component.ex:163
+#: lib/cannery_web/components/ammo_group_table_component.ex:246
#: lib/cannery_web/components/ammo_type_table_component.ex:261
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:45
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:50
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:42
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:47
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:42
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
@@ -615,15 +615,15 @@ msgstr "Editar etiquetas de %{name}"
msgid "Rounds:"
msgstr "Balas:"
-#: lib/cannery_web/components/ammo_group_table_component.ex:161
-#: lib/cannery_web/components/ammo_group_table_component.ex:243
+#: lib/cannery_web/components/ammo_group_table_component.ex:160
+#: lib/cannery_web/components/ammo_group_table_component.ex:242
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr "No hay información de coste"
-#: lib/cannery_web/components/ammo_group_table_component.ex:84
+#: lib/cannery_web/components/ammo_group_table_component.ex:83
#, elixir-autogen, elixir-format
msgid "% left"
msgstr "% restantes"
@@ -648,7 +648,7 @@ msgstr "Cantidad original:"
msgid "Percentage left:"
msgstr "Pocentaje restante:"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:126
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:121
#, elixir-autogen, elixir-format
msgid "Rounds used"
msgstr "Balas usadas"
@@ -763,7 +763,7 @@ msgstr "No hay munición en este contenedor"
msgid "Show Ammo"
msgstr "Mostrar Munición"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:118
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
#, elixir-autogen, elixir-format
msgid "This ammo is not in a container"
msgstr "Esta munición no está en un contenedor"
@@ -792,7 +792,7 @@ msgid "Leave \"Uses left\" blank to make invite unlimited"
msgstr ""
"Deje \"Usos restantes\" en blanco para hacer las invitaciónes ilimitadas"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:54
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:51
#, elixir-autogen, elixir-format
msgid "Container:"
msgstr "Contenedor:"
@@ -804,13 +804,13 @@ msgstr "Contenedor:"
msgid "Show used"
msgstr "Mostrar usadas"
-#: lib/cannery_web/components/ammo_group_table_component.ex:202
+#: lib/cannery_web/components/ammo_group_table_component.ex:201
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr "%{percentage}%"
-#: lib/cannery_web/live/range_live/index.ex:153
+#: lib/cannery_web/live/range_live/index.ex:152
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds shot: %{count}"
msgstr "Balas disparadas: %{count}"
@@ -991,28 +991,28 @@ msgstr ""
msgid "Edit %{ammo_type_name}"
msgstr "Editar %{ammo_type_name}"
-#: lib/cannery_web/components/ammo_group_table_component.ex:251
+#: lib/cannery_web/components/ammo_group_table_component.ex:250
#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:17
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr "Vacio"
-#: lib/cannery_web/components/ammo_group_table_component.ex:81
+#: lib/cannery_web/components/ammo_group_table_component.ex:80
#, elixir-autogen, elixir-format
msgid "CPR"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:49
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:46
#, elixir-autogen, elixir-format
msgid "CPR:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:88
+#: lib/cannery_web/components/ammo_group_table_component.ex:87
#, elixir-autogen, elixir-format
msgid "Original Count"
msgstr "Cantidad Original"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:24
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:21
#, elixir-autogen, elixir-format
msgid "Original Count:"
msgstr "Cantidad Original:"
@@ -1022,28 +1022,28 @@ msgstr "Cantidad Original:"
msgid "Home"
msgstr "Menu principal"
-#: lib/cannery_web/components/ammo_group_table_component.ex:64
+#: lib/cannery_web/components/ammo_group_table_component.ex:63
#, elixir-autogen, elixir-format
msgid "Last used on"
msgstr "Usada por última vez en"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:39
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:36
#, elixir-autogen, elixir-format
msgid "Last used on:"
msgstr "Usada por última vez en:"
-#: lib/cannery_web/components/ammo_group_table_component.ex:182
+#: lib/cannery_web/components/ammo_group_table_component.ex:181
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr "Nunca usada"
-#: lib/cannery_web/components/ammo_group_table_component.ex:69
+#: lib/cannery_web/components/ammo_group_table_component.ex:68
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:42
#, elixir-autogen, elixir-format
msgid "Purchased on"
msgstr "Comprada en"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:34
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:31
#: lib/cannery_web/live/ammo_group_live/show.html.heex:30
#, elixir-autogen, elixir-format
msgid "Purchased on:"
@@ -1220,12 +1220,12 @@ msgstr ""
msgid "Really great weather"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:60
+#: lib/cannery_web/components/ammo_group_table_component.ex:59
#: lib/cannery_web/components/ammo_type_table_component.ex:100
#: lib/cannery_web/components/container_table_component.ex:67
-#: lib/cannery_web/components/move_ammo_group_component.ex:70
+#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/components/shot_group_table_component.ex:45
-#: lib/cannery_web/live/ammo_group_live/show.ex:94
+#: lib/cannery_web/live/ammo_group_live/show.ex:93
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""
@@ -1240,7 +1240,7 @@ msgstr ""
msgid "Log out"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#, elixir-autogen, elixir-format
msgid "Current Count"
msgstr ""
diff --git a/priv/gettext/es/LC_MESSAGES/errors.po b/priv/gettext/es/LC_MESSAGES/errors.po
index dab288f4..ec1a957c 100644
--- a/priv/gettext/es/LC_MESSAGES/errors.po
+++ b/priv/gettext/es/LC_MESSAGES/errors.po
@@ -161,12 +161,12 @@ msgstr "Debe confirmar su cuenta e iniciar sesión para acceder a esta página."
msgid "Tag could not be removed"
msgstr "La etiqueta no pudo ser eliminada"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:160
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:159
#, elixir-autogen, elixir-format
msgid "Could not parse number of copies"
msgstr "No se ha podido procesar el número de copias"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:150
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:149
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr "Número inválido de copias, debe ser entre 1 y %{max}. Fue %{multiplier"
@@ -201,7 +201,7 @@ msgstr ""
msgid "Ammo left must be at least 0"
msgstr ""
-#: lib/cannery/activity_log/shot_group.ex:122
+#: lib/cannery/activity_log/shot_group.ex:119
#, elixir-autogen, elixir-format, fuzzy
msgid "Count can be at most %{count} shots"
msgstr "El recuento debe ser menos de %{count}"
diff --git a/priv/gettext/es/LC_MESSAGES/prompts.po b/priv/gettext/es/LC_MESSAGES/prompts.po
index 2fc3ecf6..fd01423f 100644
--- a/priv/gettext/es/LC_MESSAGES/prompts.po
+++ b/priv/gettext/es/LC_MESSAGES/prompts.po
@@ -74,7 +74,7 @@ msgid "Are you sure you want to delete %{name}?"
msgstr "Está seguro que desea eliminar %{name}?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:72
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
msgstr "Está seguro que desea eliminar esta munición?"
@@ -175,13 +175,13 @@ msgstr "Tiros registrados exitosamente"
msgid "Are you sure you want to unstage this ammo?"
msgstr "Está seguro que desea desmontar esta munición?"
-#: lib/cannery_web/live/ammo_group_live/show.ex:159
+#: lib/cannery_web/live/ammo_group_live/show.ex:158
#: lib/cannery_web/live/range_live/index.html.heex:152
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?"
msgstr "¿Está segure que quiere borrar este récord de disparos?"
-#: lib/cannery_web/live/ammo_group_live/show.ex:81
+#: lib/cannery_web/live/ammo_group_live/show.ex:80
#: lib/cannery_web/live/range_live/index.ex:79
#, elixir-autogen, elixir-format
msgid "Shot records deleted succesfully"
@@ -197,7 +197,7 @@ msgstr "Récord de disparos actualizado exitosamente"
msgid "%{email} confirmed successfully."
msgstr "%{email} confirmado exitosamente."
-#: lib/cannery_web/components/move_ammo_group_component.ex:54
+#: lib/cannery_web/components/move_ammo_group_component.ex:52
#, elixir-autogen, elixir-format
msgid "Ammo moved to %{name} successfully"
msgstr "Munición movida a %{name} exitosamente"
@@ -239,17 +239,17 @@ msgstr "Idioma cambiado exitosamente."
msgid "Ammo deleted succesfully"
msgstr "Munición borrada exitosamente"
-#: lib/cannery_web/live/range_live/index.ex:93
+#: lib/cannery_web/live/range_live/index.ex:92
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo unstaged succesfully"
msgstr "Munición descargada exitosamente"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:126
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:125
#, elixir-autogen, elixir-format
msgid "Ammo updated successfully"
msgstr "Munición actualizada exitosamente"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:185
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:184
#, elixir-autogen, elixir-format
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
diff --git a/priv/gettext/fr/LC_MESSAGES/actions.po b/priv/gettext/fr/LC_MESSAGES/actions.po
index ac6e4980..833acd66 100644
--- a/priv/gettext/fr/LC_MESSAGES/actions.po
+++ b/priv/gettext/fr/LC_MESSAGES/actions.po
@@ -170,18 +170,18 @@ msgid "Why not get some ready to shoot?"
msgstr "Pourquoi pas en préparer pour tirer ?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:98
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr "Enregistrer des tirs"
-#: lib/cannery_web/components/move_ammo_group_component.ex:90
+#: lib/cannery_web/components/move_ammo_group_component.ex:88
#, elixir-autogen, elixir-format
msgid "Add another container!"
msgstr "Ajoutez un autre conteneur !"
-#: lib/cannery_web/components/move_ammo_group_component.ex:126
+#: lib/cannery_web/components/move_ammo_group_component.ex:124
#, elixir-autogen, elixir-format
msgid "Select"
msgstr "Sélectionner"
@@ -221,9 +221,9 @@ msgstr "Voir en catalogue"
msgid "add an ammo type first"
msgstr "Ajoutez d'abord un type de munitions"
-#: lib/cannery_web/components/move_ammo_group_component.ex:80
+#: lib/cannery_web/components/move_ammo_group_component.ex:78
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr ""
@@ -233,13 +233,13 @@ msgstr ""
msgid "Set Unlimited"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:89
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:87
#: lib/cannery_web/live/range_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Stage for range"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:88
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:86
#: lib/cannery_web/live/range_live/index.html.heex:37
#, elixir-autogen, elixir-format
msgid "Unstage from range"
@@ -289,7 +289,7 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:161
+#: lib/cannery_web/live/ammo_group_live/show.ex:160
#: lib/cannery_web/live/range_live/index.html.heex:155
#, elixir-autogen, elixir-format
msgid "Delete shot record of %{shot_group_count} shots"
@@ -313,18 +313,12 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
-#, elixir-autogen, elixir-format
-msgid "Edit ammo group of %{ammo_group_count} bullets"
-msgstr ""
-
#: lib/cannery_web/live/invite_live/index.html.heex:46
#, elixir-autogen, elixir-format
msgid "Edit invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:146
+#: lib/cannery_web/live/ammo_group_live/show.ex:145
#, elixir-autogen, elixir-format
msgid "Edit shot group of %{shot_group_count} shots"
msgstr ""
@@ -357,17 +351,23 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
-msgid "Clone ammo group of %{ammo_group_count} bullets"
+msgid "Clone ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format, fuzzy
-msgid "Delete ammo group of %{ammo_group_count} bullets"
+msgid "Delete ammo group of %{pack_count} bullets"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
-msgid "View ammo group of %{ammo_group_count} bullets"
+msgid "View ammo group of %{pack_count} bullets"
msgstr ""
diff --git a/priv/gettext/fr/LC_MESSAGES/default.po b/priv/gettext/fr/LC_MESSAGES/default.po
index b4bf3b7e..fe117093 100644
--- a/priv/gettext/fr/LC_MESSAGES/default.po
+++ b/priv/gettext/fr/LC_MESSAGES/default.po
@@ -38,7 +38,7 @@ msgstr "Administrateur·ices :"
msgid "Ammo"
msgstr "Munition"
-#: lib/cannery_web/components/ammo_group_table_component.ex:96
+#: lib/cannery_web/components/ammo_group_table_component.ex:95
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Ammo type"
@@ -90,8 +90,8 @@ msgstr "Cartouche"
msgid "Case material"
msgstr "Matériau de la caisse"
-#: lib/cannery_web/components/ammo_group_table_component.ex:74
-#: lib/cannery_web/components/move_ammo_group_component.ex:67
+#: lib/cannery_web/components/ammo_group_table_component.ex:73
+#: lib/cannery_web/components/move_ammo_group_component.ex:65
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:59
#, elixir-autogen, elixir-format
msgid "Container"
@@ -111,7 +111,7 @@ msgstr "Conteneurs"
msgid "Corrosive"
msgstr "Corrosive"
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:28
#, elixir-autogen, elixir-format
msgid "Count"
@@ -196,7 +196,7 @@ msgid "Keep me logged in for 60 days"
msgstr "Me garder authentifié durant 60 jours"
#: lib/cannery_web/components/container_table_component.ex:47
-#: lib/cannery_web/components/move_ammo_group_component.ex:69
+#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/container_live/form_component.html.heex:47
#, elixir-autogen, elixir-format
msgid "Location"
@@ -293,13 +293,13 @@ msgstr "Aucun tag"
#: lib/cannery_web/components/add_shot_group_component.html.heex:38
#: lib/cannery_web/components/shot_group_table_component.ex:43
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:50
-#: lib/cannery_web/live/ammo_group_live/show.ex:92
+#: lib/cannery_web/live/ammo_group_live/show.ex:91
#: lib/cannery_web/live/range_live/form_component.html.heex:30
#, elixir-autogen, elixir-format
msgid "Notes"
msgstr "Notes"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:29
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:26
#: lib/cannery_web/live/ammo_group_live/show.html.heex:24
#, elixir-autogen, elixir-format
msgid "Notes:"
@@ -316,13 +316,13 @@ msgstr "Sur l’étagère"
msgid "Pressure"
msgstr "Pression"
-#: lib/cannery_web/components/ammo_group_table_component.ex:82
+#: lib/cannery_web/components/ammo_group_table_component.ex:81
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:35
#, elixir-autogen, elixir-format
msgid "Price paid"
msgstr "Prix payé"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:44
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:41
#, elixir-autogen, elixir-format
msgid "Price paid:"
msgstr "Prix payé :"
@@ -366,7 +366,7 @@ msgstr "Simple :"
msgid "Steel"
msgstr "Acier"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
#, elixir-autogen, elixir-format
msgid "Stored in"
msgstr "Est stocké dans"
@@ -404,7 +404,7 @@ msgid "Tracer"
msgstr "Traceuse"
#: lib/cannery_web/components/container_table_component.ex:48
-#: lib/cannery_web/components/move_ammo_group_component.ex:68
+#: lib/cannery_web/components/move_ammo_group_component.ex:66
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "Type"
@@ -436,7 +436,7 @@ msgstr "Vos données restent avec vous, point final"
msgid "No tags for this container"
msgstr "Aucun tag pour ce conteneur"
-#: lib/cannery_web/components/ammo_group_table_component.ex:78
+#: lib/cannery_web/components/ammo_group_table_component.ex:77
#: lib/cannery_web/components/core_components/topbar.html.heex:66
#, elixir-autogen, elixir-format
msgid "Range"
@@ -449,7 +449,7 @@ msgstr "Journée de stand"
#: lib/cannery_web/components/add_shot_group_component.html.heex:49
#: lib/cannery_web/components/shot_group_table_component.ex:44
-#: lib/cannery_web/live/ammo_group_live/show.ex:93
+#: lib/cannery_web/live/ammo_group_live/show.ex:92
#: lib/cannery_web/live/range_live/form_component.html.heex:41
#, elixir-autogen, elixir-format
msgid "Date"
@@ -495,7 +495,7 @@ msgid "Rounds left"
msgstr "Cartouches restantes"
#: lib/cannery_web/components/shot_group_table_component.ex:42
-#: lib/cannery_web/live/ammo_group_live/show.ex:91
+#: lib/cannery_web/live/ammo_group_live/show.ex:90
#: lib/cannery_web/live/range_live/index.html.heex:69
#, elixir-autogen, elixir-format
msgid "Rounds shot"
@@ -512,7 +512,7 @@ msgstr "Enregistrements de tir"
msgid "Move ammo"
msgstr "Déplacer munition"
-#: lib/cannery_web/components/move_ammo_group_component.ex:85
+#: lib/cannery_web/components/move_ammo_group_component.ex:83
#, elixir-autogen, elixir-format
msgid "No other containers"
msgstr "Aucun autre conteneur"
@@ -522,11 +522,11 @@ msgstr "Aucun autre conteneur"
msgid "Shot log"
msgstr "Évènements de tir"
-#: lib/cannery_web/components/ammo_group_table_component.ex:164
-#: lib/cannery_web/components/ammo_group_table_component.ex:247
+#: lib/cannery_web/components/ammo_group_table_component.ex:163
+#: lib/cannery_web/components/ammo_group_table_component.ex:246
#: lib/cannery_web/components/ammo_type_table_component.ex:261
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:45
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:50
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:42
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:47
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:42
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
@@ -616,15 +616,15 @@ msgstr "Éditer les tags de %{name}"
msgid "Rounds:"
msgstr "Cartouches :"
-#: lib/cannery_web/components/ammo_group_table_component.ex:161
-#: lib/cannery_web/components/ammo_group_table_component.ex:243
+#: lib/cannery_web/components/ammo_group_table_component.ex:160
+#: lib/cannery_web/components/ammo_group_table_component.ex:242
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr "Aucune information de prix"
-#: lib/cannery_web/components/ammo_group_table_component.ex:84
+#: lib/cannery_web/components/ammo_group_table_component.ex:83
#, elixir-autogen, elixir-format
msgid "% left"
msgstr "% restante"
@@ -649,7 +649,7 @@ msgstr "Nombre original :"
msgid "Percentage left:"
msgstr "Pourcentage restant :"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:126
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:121
#, elixir-autogen, elixir-format
msgid "Rounds used"
msgstr "Cartouches utilisées"
@@ -764,7 +764,7 @@ msgstr "Aucun groupe de munition pour ce conteneur"
msgid "Show Ammo"
msgstr "Montrer le type de munition"
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:118
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
#, elixir-autogen, elixir-format, fuzzy
msgid "This ammo is not in a container"
msgstr "Ce groupe de munition n’est pas dans un conteneur"
@@ -793,7 +793,7 @@ msgid "Leave \"Uses left\" blank to make invite unlimited"
msgstr ""
"Laissez \"Utilisations restantes\" vide pour rendre l'invitation illimitée"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:54
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:51
#, elixir-autogen, elixir-format, fuzzy
msgid "Container:"
msgstr "Conteneur"
@@ -805,13 +805,13 @@ msgstr "Conteneur"
msgid "Show used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:202
+#: lib/cannery_web/components/ammo_group_table_component.ex:201
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""
-#: lib/cannery_web/live/range_live/index.ex:153
+#: lib/cannery_web/live/range_live/index.ex:152
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds shot: %{count}"
msgstr "Cartouches tirées"
@@ -992,28 +992,28 @@ msgstr ""
msgid "Edit %{ammo_type_name}"
msgstr "Éditer %{name}"
-#: lib/cannery_web/components/ammo_group_table_component.ex:251
+#: lib/cannery_web/components/ammo_group_table_component.ex:250
#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:17
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:81
+#: lib/cannery_web/components/ammo_group_table_component.ex:80
#, elixir-autogen, elixir-format
msgid "CPR"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:49
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:46
#, elixir-autogen, elixir-format
msgid "CPR:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:88
+#: lib/cannery_web/components/ammo_group_table_component.ex:87
#, elixir-autogen, elixir-format, fuzzy
msgid "Original Count"
msgstr "Nombre original :"
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:24
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:21
#, elixir-autogen, elixir-format, fuzzy
msgid "Original Count:"
msgstr "Nombre original :"
@@ -1023,28 +1023,28 @@ msgstr "Nombre original :"
msgid "Home"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:64
+#: lib/cannery_web/components/ammo_group_table_component.ex:63
#, elixir-autogen, elixir-format
msgid "Last used on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:39
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:36
#, elixir-autogen, elixir-format
msgid "Last used on:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:182
+#: lib/cannery_web/components/ammo_group_table_component.ex:181
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:69
+#: lib/cannery_web/components/ammo_group_table_component.ex:68
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:42
#, elixir-autogen, elixir-format
msgid "Purchased on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:34
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:31
#: lib/cannery_web/live/ammo_group_live/show.html.heex:30
#, elixir-autogen, elixir-format
msgid "Purchased on:"
@@ -1221,12 +1221,12 @@ msgstr ""
msgid "Really great weather"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:60
+#: lib/cannery_web/components/ammo_group_table_component.ex:59
#: lib/cannery_web/components/ammo_type_table_component.ex:100
#: lib/cannery_web/components/container_table_component.ex:67
-#: lib/cannery_web/components/move_ammo_group_component.ex:70
+#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/components/shot_group_table_component.ex:45
-#: lib/cannery_web/live/ammo_group_live/show.ex:94
+#: lib/cannery_web/live/ammo_group_live/show.ex:93
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""
@@ -1241,7 +1241,7 @@ msgstr ""
msgid "Log out"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#, elixir-autogen, elixir-format
msgid "Current Count"
msgstr ""
diff --git a/priv/gettext/fr/LC_MESSAGES/errors.po b/priv/gettext/fr/LC_MESSAGES/errors.po
index 26976d70..b33145e4 100644
--- a/priv/gettext/fr/LC_MESSAGES/errors.po
+++ b/priv/gettext/fr/LC_MESSAGES/errors.po
@@ -162,12 +162,12 @@ msgstr ""
msgid "Tag could not be removed"
msgstr "Le tag n’a pas pu être retiré"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:160
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:159
#, elixir-autogen, elixir-format
msgid "Could not parse number of copies"
msgstr "Impossible d'analyser le nombre de copies"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:150
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:149
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr "Nombre de copies invalide, doit être 1 et %{max}. Été %{multiplier}"
@@ -202,7 +202,7 @@ msgstr ""
msgid "Ammo left must be at least 0"
msgstr ""
-#: lib/cannery/activity_log/shot_group.ex:122
+#: lib/cannery/activity_log/shot_group.ex:119
#, elixir-autogen, elixir-format, fuzzy
msgid "Count can be at most %{count} shots"
msgstr "La quantité doit être inférieur à %{count}"
diff --git a/priv/gettext/fr/LC_MESSAGES/prompts.po b/priv/gettext/fr/LC_MESSAGES/prompts.po
index 3fb340fb..51f58cb7 100644
--- a/priv/gettext/fr/LC_MESSAGES/prompts.po
+++ b/priv/gettext/fr/LC_MESSAGES/prompts.po
@@ -75,7 +75,7 @@ msgid "Are you sure you want to delete %{name}?"
msgstr "Êtes-vous certain·e de supprimer %{name} ?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:72
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
msgstr "Êtes-vous certain·e de supprimer cette munition ?"
@@ -177,13 +177,13 @@ msgstr "Tirs enregistré avec succès"
msgid "Are you sure you want to unstage this ammo?"
msgstr "Êtes-vous certain·e de vouloir désélectionner cette munition ?"
-#: lib/cannery_web/live/ammo_group_live/show.ex:159
+#: lib/cannery_web/live/ammo_group_live/show.ex:158
#: lib/cannery_web/live/range_live/index.html.heex:152
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?"
msgstr "Êtes-vous certain·e de vouloir supprimer cet enregistrement de tir ?"
-#: lib/cannery_web/live/ammo_group_live/show.ex:81
+#: lib/cannery_web/live/ammo_group_live/show.ex:80
#: lib/cannery_web/live/range_live/index.ex:79
#, elixir-autogen, elixir-format
msgid "Shot records deleted succesfully"
@@ -199,7 +199,7 @@ msgstr "Enregistrements de tir mis à jour avec succès"
msgid "%{email} confirmed successfully."
msgstr "%{email} confirmé avec succès."
-#: lib/cannery_web/components/move_ammo_group_component.ex:54
+#: lib/cannery_web/components/move_ammo_group_component.ex:52
#, elixir-autogen, elixir-format
msgid "Ammo moved to %{name} successfully"
msgstr "Munition déplacée à %{name} avec succès"
@@ -241,17 +241,17 @@ msgstr "Langue mise à jour avec succès."
msgid "Ammo deleted succesfully"
msgstr "Groupe de munition supprimé avec succès"
-#: lib/cannery_web/live/range_live/index.ex:93
+#: lib/cannery_web/live/range_live/index.ex:92
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo unstaged succesfully"
msgstr "Groupe de munition désélectionner avec succès"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:126
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:125
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo updated successfully"
msgstr "Groupe de munition mis à jour avec succès"
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:185
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:184
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
diff --git a/priv/gettext/ga/LC_MESSAGES/actions.po b/priv/gettext/ga/LC_MESSAGES/actions.po
index 63797bf9..ebfcac91 100644
--- a/priv/gettext/ga/LC_MESSAGES/actions.po
+++ b/priv/gettext/ga/LC_MESSAGES/actions.po
@@ -168,18 +168,18 @@ msgid "Why not get some ready to shoot?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:98
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:90
+#: lib/cannery_web/components/move_ammo_group_component.ex:88
#, elixir-autogen, elixir-format
msgid "Add another container!"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:126
+#: lib/cannery_web/components/move_ammo_group_component.ex:124
#, elixir-autogen, elixir-format
msgid "Select"
msgstr ""
@@ -219,9 +219,9 @@ msgstr ""
msgid "add an ammo type first"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:80
+#: lib/cannery_web/components/move_ammo_group_component.ex:78
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr ""
@@ -231,13 +231,13 @@ msgstr ""
msgid "Set Unlimited"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:89
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:87
#: lib/cannery_web/live/range_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Stage for range"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:88
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:86
#: lib/cannery_web/live/range_live/index.html.heex:37
#, elixir-autogen, elixir-format
msgid "Unstage from range"
@@ -287,7 +287,7 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:161
+#: lib/cannery_web/live/ammo_group_live/show.ex:160
#: lib/cannery_web/live/range_live/index.html.heex:155
#, elixir-autogen, elixir-format
msgid "Delete shot record of %{shot_group_count} shots"
@@ -311,18 +311,12 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
-#, elixir-autogen, elixir-format
-msgid "Edit ammo group of %{ammo_group_count} bullets"
-msgstr ""
-
#: lib/cannery_web/live/invite_live/index.html.heex:46
#, elixir-autogen, elixir-format
msgid "Edit invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:146
+#: lib/cannery_web/live/ammo_group_live/show.ex:145
#, elixir-autogen, elixir-format
msgid "Edit shot group of %{shot_group_count} shots"
msgstr ""
@@ -355,17 +349,23 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
-msgid "Clone ammo group of %{ammo_group_count} bullets"
+msgid "Clone ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format, fuzzy
-msgid "Delete ammo group of %{ammo_group_count} bullets"
+msgid "Delete ammo group of %{pack_count} bullets"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit ammo group of %{pack_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
-msgid "View ammo group of %{ammo_group_count} bullets"
+msgid "View ammo group of %{pack_count} bullets"
msgstr ""
diff --git a/priv/gettext/ga/LC_MESSAGES/default.po b/priv/gettext/ga/LC_MESSAGES/default.po
index c0d96091..48cbf9ae 100644
--- a/priv/gettext/ga/LC_MESSAGES/default.po
+++ b/priv/gettext/ga/LC_MESSAGES/default.po
@@ -36,7 +36,7 @@ msgstr ""
msgid "Ammo"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:96
+#: lib/cannery_web/components/ammo_group_table_component.ex:95
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Ammo type"
@@ -88,8 +88,8 @@ msgstr ""
msgid "Case material"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:74
-#: lib/cannery_web/components/move_ammo_group_component.ex:67
+#: lib/cannery_web/components/ammo_group_table_component.ex:73
+#: lib/cannery_web/components/move_ammo_group_component.ex:65
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:59
#, elixir-autogen, elixir-format
msgid "Container"
@@ -109,7 +109,7 @@ msgstr ""
msgid "Corrosive"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:28
#, elixir-autogen, elixir-format
msgid "Count"
@@ -194,7 +194,7 @@ msgid "Keep me logged in for 60 days"
msgstr ""
#: lib/cannery_web/components/container_table_component.ex:47
-#: lib/cannery_web/components/move_ammo_group_component.ex:69
+#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/container_live/form_component.html.heex:47
#, elixir-autogen, elixir-format
msgid "Location"
@@ -291,13 +291,13 @@ msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:38
#: lib/cannery_web/components/shot_group_table_component.ex:43
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:50
-#: lib/cannery_web/live/ammo_group_live/show.ex:92
+#: lib/cannery_web/live/ammo_group_live/show.ex:91
#: lib/cannery_web/live/range_live/form_component.html.heex:30
#, elixir-autogen, elixir-format
msgid "Notes"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:29
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:26
#: lib/cannery_web/live/ammo_group_live/show.html.heex:24
#, elixir-autogen, elixir-format
msgid "Notes:"
@@ -314,13 +314,13 @@ msgstr ""
msgid "Pressure"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:82
+#: lib/cannery_web/components/ammo_group_table_component.ex:81
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:35
#, elixir-autogen, elixir-format
msgid "Price paid"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:44
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:41
#, elixir-autogen, elixir-format
msgid "Price paid:"
msgstr ""
@@ -362,7 +362,7 @@ msgstr ""
msgid "Steel"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
#, elixir-autogen, elixir-format
msgid "Stored in"
msgstr ""
@@ -398,7 +398,7 @@ msgid "Tracer"
msgstr ""
#: lib/cannery_web/components/container_table_component.ex:48
-#: lib/cannery_web/components/move_ammo_group_component.ex:68
+#: lib/cannery_web/components/move_ammo_group_component.ex:66
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#, elixir-autogen, elixir-format
msgid "Type"
@@ -430,7 +430,7 @@ msgstr ""
msgid "No tags for this container"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:78
+#: lib/cannery_web/components/ammo_group_table_component.ex:77
#: lib/cannery_web/components/core_components/topbar.html.heex:66
#, elixir-autogen, elixir-format
msgid "Range"
@@ -443,7 +443,7 @@ msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:49
#: lib/cannery_web/components/shot_group_table_component.ex:44
-#: lib/cannery_web/live/ammo_group_live/show.ex:93
+#: lib/cannery_web/live/ammo_group_live/show.ex:92
#: lib/cannery_web/live/range_live/form_component.html.heex:41
#, elixir-autogen, elixir-format
msgid "Date"
@@ -489,7 +489,7 @@ msgid "Rounds left"
msgstr ""
#: lib/cannery_web/components/shot_group_table_component.ex:42
-#: lib/cannery_web/live/ammo_group_live/show.ex:91
+#: lib/cannery_web/live/ammo_group_live/show.ex:90
#: lib/cannery_web/live/range_live/index.html.heex:69
#, elixir-autogen, elixir-format
msgid "Rounds shot"
@@ -506,7 +506,7 @@ msgstr ""
msgid "Move ammo"
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:85
+#: lib/cannery_web/components/move_ammo_group_component.ex:83
#, elixir-autogen, elixir-format
msgid "No other containers"
msgstr ""
@@ -516,11 +516,11 @@ msgstr ""
msgid "Shot log"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:164
-#: lib/cannery_web/components/ammo_group_table_component.ex:247
+#: lib/cannery_web/components/ammo_group_table_component.ex:163
+#: lib/cannery_web/components/ammo_group_table_component.ex:246
#: lib/cannery_web/components/ammo_type_table_component.ex:261
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:45
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:50
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:42
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:47
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:42
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
@@ -610,15 +610,15 @@ msgstr ""
msgid "Rounds:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:161
-#: lib/cannery_web/components/ammo_group_table_component.ex:243
+#: lib/cannery_web/components/ammo_group_table_component.ex:160
+#: lib/cannery_web/components/ammo_group_table_component.ex:242
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:84
+#: lib/cannery_web/components/ammo_group_table_component.ex:83
#, elixir-autogen, elixir-format
msgid "% left"
msgstr ""
@@ -643,7 +643,7 @@ msgstr ""
msgid "Percentage left:"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:126
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:121
#, elixir-autogen, elixir-format
msgid "Rounds used"
msgstr ""
@@ -758,7 +758,7 @@ msgstr ""
msgid "Show Ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:118
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:113
#, elixir-autogen, elixir-format
msgid "This ammo is not in a container"
msgstr ""
@@ -786,7 +786,7 @@ msgstr ""
msgid "Leave \"Uses left\" blank to make invite unlimited"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:54
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:51
#, elixir-autogen, elixir-format
msgid "Container:"
msgstr ""
@@ -798,13 +798,13 @@ msgstr ""
msgid "Show used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:202
+#: lib/cannery_web/components/ammo_group_table_component.ex:201
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""
-#: lib/cannery_web/live/range_live/index.ex:153
+#: lib/cannery_web/live/range_live/index.ex:152
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds shot: %{count}"
msgstr ""
@@ -985,28 +985,28 @@ msgstr ""
msgid "Edit %{ammo_type_name}"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:251
+#: lib/cannery_web/components/ammo_group_table_component.ex:250
#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:17
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:81
+#: lib/cannery_web/components/ammo_group_table_component.ex:80
#, elixir-autogen, elixir-format
msgid "CPR"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:49
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:46
#, elixir-autogen, elixir-format
msgid "CPR:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:88
+#: lib/cannery_web/components/ammo_group_table_component.ex:87
#, elixir-autogen, elixir-format, fuzzy
msgid "Original Count"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:24
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:21
#, elixir-autogen, elixir-format, fuzzy
msgid "Original Count:"
msgstr ""
@@ -1016,28 +1016,28 @@ msgstr ""
msgid "Home"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:64
+#: lib/cannery_web/components/ammo_group_table_component.ex:63
#, elixir-autogen, elixir-format
msgid "Last used on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:39
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:36
#, elixir-autogen, elixir-format
msgid "Last used on:"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:182
+#: lib/cannery_web/components/ammo_group_table_component.ex:181
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:69
+#: lib/cannery_web/components/ammo_group_table_component.ex:68
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:42
#, elixir-autogen, elixir-format
msgid "Purchased on"
msgstr ""
-#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:34
+#: lib/cannery_web/components/core_components/ammo_group_card.html.heex:31
#: lib/cannery_web/live/ammo_group_live/show.html.heex:30
#, elixir-autogen, elixir-format
msgid "Purchased on:"
@@ -1212,12 +1212,12 @@ msgstr ""
msgid "Really great weather"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:60
+#: lib/cannery_web/components/ammo_group_table_component.ex:59
#: lib/cannery_web/components/ammo_type_table_component.ex:100
#: lib/cannery_web/components/container_table_component.ex:67
-#: lib/cannery_web/components/move_ammo_group_component.ex:70
+#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/components/shot_group_table_component.ex:45
-#: lib/cannery_web/live/ammo_group_live/show.ex:94
+#: lib/cannery_web/live/ammo_group_live/show.ex:93
#, elixir-autogen, elixir-format
msgid "Actions"
msgstr ""
@@ -1232,7 +1232,7 @@ msgstr ""
msgid "Log out"
msgstr ""
-#: lib/cannery_web/components/ammo_group_table_component.ex:92
+#: lib/cannery_web/components/ammo_group_table_component.ex:91
#, elixir-autogen, elixir-format
msgid "Current Count"
msgstr ""
diff --git a/priv/gettext/ga/LC_MESSAGES/errors.po b/priv/gettext/ga/LC_MESSAGES/errors.po
index e9e54ca7..b304507e 100644
--- a/priv/gettext/ga/LC_MESSAGES/errors.po
+++ b/priv/gettext/ga/LC_MESSAGES/errors.po
@@ -161,12 +161,12 @@ msgstr ""
msgid "Tag could not be removed"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:160
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:159
#, elixir-autogen, elixir-format
msgid "Could not parse number of copies"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:150
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:149
#, elixir-autogen, elixir-format
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
@@ -201,7 +201,7 @@ msgstr ""
msgid "Ammo left must be at least 0"
msgstr ""
-#: lib/cannery/activity_log/shot_group.ex:122
+#: lib/cannery/activity_log/shot_group.ex:119
#, elixir-autogen, elixir-format, fuzzy
msgid "Count can be at most %{count} shots"
msgstr ""
diff --git a/priv/gettext/ga/LC_MESSAGES/prompts.po b/priv/gettext/ga/LC_MESSAGES/prompts.po
index c2f22b25..e0a05657 100644
--- a/priv/gettext/ga/LC_MESSAGES/prompts.po
+++ b/priv/gettext/ga/LC_MESSAGES/prompts.po
@@ -70,7 +70,7 @@ msgid "Are you sure you want to delete %{name}?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:72
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
msgstr ""
@@ -166,13 +166,13 @@ msgstr ""
msgid "Are you sure you want to unstage this ammo?"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:159
+#: lib/cannery_web/live/ammo_group_live/show.ex:158
#: lib/cannery_web/live/range_live/index.html.heex:152
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:81
+#: lib/cannery_web/live/ammo_group_live/show.ex:80
#: lib/cannery_web/live/range_live/index.ex:79
#, elixir-autogen, elixir-format
msgid "Shot records deleted succesfully"
@@ -188,7 +188,7 @@ msgstr ""
msgid "%{email} confirmed successfully."
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:54
+#: lib/cannery_web/components/move_ammo_group_component.ex:52
#, elixir-autogen, elixir-format
msgid "Ammo moved to %{name} successfully"
msgstr ""
@@ -230,17 +230,17 @@ msgstr ""
msgid "Ammo deleted succesfully"
msgstr ""
-#: lib/cannery_web/live/range_live/index.ex:93
+#: lib/cannery_web/live/range_live/index.ex:92
#, elixir-autogen, elixir-format
msgid "Ammo unstaged succesfully"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:126
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:125
#, elixir-autogen, elixir-format
msgid "Ammo updated successfully"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:185
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:184
#, elixir-autogen, elixir-format
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot
index b0645428..cbb58828 100644
--- a/priv/gettext/prompts.pot
+++ b/priv/gettext/prompts.pot
@@ -59,7 +59,7 @@ msgid "Are you sure you want to delete %{name}?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
-#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
+#: lib/cannery_web/live/ammo_group_live/show.html.heex:72
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
msgstr ""
@@ -155,13 +155,13 @@ msgstr ""
msgid "Are you sure you want to unstage this ammo?"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:159
+#: lib/cannery_web/live/ammo_group_live/show.ex:158
#: lib/cannery_web/live/range_live/index.html.heex:152
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this shot record?"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/show.ex:81
+#: lib/cannery_web/live/ammo_group_live/show.ex:80
#: lib/cannery_web/live/range_live/index.ex:79
#, elixir-autogen, elixir-format
msgid "Shot records deleted succesfully"
@@ -177,7 +177,7 @@ msgstr ""
msgid "%{email} confirmed successfully."
msgstr ""
-#: lib/cannery_web/components/move_ammo_group_component.ex:54
+#: lib/cannery_web/components/move_ammo_group_component.ex:52
#, elixir-autogen, elixir-format
msgid "Ammo moved to %{name} successfully"
msgstr ""
@@ -219,17 +219,17 @@ msgstr ""
msgid "Ammo deleted succesfully"
msgstr ""
-#: lib/cannery_web/live/range_live/index.ex:93
+#: lib/cannery_web/live/range_live/index.ex:92
#, elixir-autogen, elixir-format
msgid "Ammo unstaged succesfully"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:126
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:125
#, elixir-autogen, elixir-format
msgid "Ammo updated successfully"
msgstr ""
-#: lib/cannery_web/live/ammo_group_live/form_component.ex:185
+#: lib/cannery_web/live/ammo_group_live/form_component.ex:184
#, elixir-autogen, elixir-format
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
diff --git a/priv/repo/migrations/20230329041109_rename_ammo_groups_to_packs.exs b/priv/repo/migrations/20230329041109_rename_ammo_groups_to_packs.exs
new file mode 100644
index 00000000..840ce4c7
--- /dev/null
+++ b/priv/repo/migrations/20230329041109_rename_ammo_groups_to_packs.exs
@@ -0,0 +1,39 @@
+defmodule Cannery.Repo.Migrations.RenameAmmoGroupsToPacks do
+ use Ecto.Migration
+
+ def up do
+ drop index(:ammo_groups, [:user_id], where: "count = 0", name: :empty_ammo_groups_index)
+ drop index(:ammo_groups, [:user_id, :ammo_type_id])
+ drop index(:ammo_groups, [:user_id, :container_id])
+
+ flush()
+
+ rename table(:ammo_groups), to: table(:packs)
+
+ flush()
+
+ create index(:packs, [:user_id], where: "count = 0", name: :empty_packs_index)
+ create index(:packs, [:user_id, :ammo_type_id])
+ create index(:packs, [:user_id, :container_id])
+
+ rename table(:shot_groups), :ammo_group_id, to: :pack_id
+ end
+
+ def down do
+ drop index(:packs, [:user_id], where: "count = 0", name: :empty_packs_index)
+ drop index(:packs, [:user_id, :ammo_type_id])
+ drop index(:packs, [:user_id, :container_id])
+
+ flush()
+
+ rename table(:packs), to: table(:ammo_groups)
+
+ flush()
+
+ create index(:ammo_groups, [:user_id], where: "count = 0", name: :empty_ammo_groups_index)
+ create index(:ammo_groups, [:user_id, :ammo_type_id])
+ create index(:ammo_groups, [:user_id, :container_id])
+
+ rename table(:shot_groups), :pack_id, to: :ammo_group_id
+ end
+end
diff --git a/test/cannery/activity_log_test.exs b/test/cannery/activity_log_test.exs
index a5806c67..7958d902 100644
--- a/test/cannery/activity_log_test.exs
+++ b/test/cannery/activity_log_test.exs
@@ -15,20 +15,20 @@ defmodule Cannery.ActivityLogTest do
container = container_fixture(current_user)
ammo_type = ammo_type_fixture(current_user)
- {1, [%{id: ammo_group_id} = ammo_group]} =
- ammo_group_fixture(%{count: 25}, ammo_type, container, current_user)
+ {1, [%{id: pack_id} = pack]} =
+ pack_fixture(%{count: 25}, ammo_type, container, current_user)
shot_group =
%{count: 5, date: ~N[2022-02-13 03:17:00], notes: "some notes"}
- |> shot_group_fixture(current_user, ammo_group)
+ |> shot_group_fixture(current_user, pack)
- ammo_group = ammo_group_id |> Ammo.get_ammo_group!(current_user)
+ pack = pack_id |> Ammo.get_pack!(current_user)
[
current_user: current_user,
container: container,
ammo_type: ammo_type,
- ammo_group: ammo_group,
+ pack: pack,
shot_group: shot_group
]
end
@@ -48,11 +48,11 @@ defmodule Cannery.ActivityLogTest do
end
test "create_shot_group/3 with valid data creates a shot_group",
- %{current_user: current_user, ammo_group: ammo_group} do
+ %{current_user: current_user, pack: pack} do
valid_attrs = %{count: 10, date: ~D[2022-02-13], notes: "some notes"}
assert {:ok, %ShotGroup{} = shot_group} =
- ActivityLog.create_shot_group(valid_attrs, current_user, ammo_group)
+ ActivityLog.create_shot_group(valid_attrs, current_user, pack)
assert shot_group.count == 10
assert shot_group.date == ~D[2022-02-13]
@@ -62,46 +62,45 @@ defmodule Cannery.ActivityLogTest do
test "create_shot_group/3 removes corresponding count from ammo group",
%{
current_user: current_user,
- ammo_group: %{id: ammo_group_id, count: org_count} = ammo_group
+ pack: %{id: pack_id, count: org_count} = pack
} do
valid_attrs = %{count: 10, date: ~D[2022-02-13], notes: "some notes"}
assert {:ok, %ShotGroup{} = shot_group} =
- ActivityLog.create_shot_group(valid_attrs, current_user, ammo_group)
+ ActivityLog.create_shot_group(valid_attrs, current_user, pack)
- %{count: new_count} = ammo_group_id |> Ammo.get_ammo_group!(current_user)
+ %{count: new_count} = pack_id |> Ammo.get_pack!(current_user)
assert org_count - shot_group.count == new_count
assert new_count == 10
end
test "create_shot_group/3 does not remove more than ammo group amount",
- %{current_user: current_user, ammo_group: %{id: ammo_group_id} = ammo_group} do
+ %{current_user: current_user, pack: %{id: pack_id} = pack} do
valid_attrs = %{count: 20, date: ~D[2022-02-13], notes: "some notes"}
- assert {:ok, %ShotGroup{}} =
- ActivityLog.create_shot_group(valid_attrs, current_user, ammo_group)
+ assert {:ok, %ShotGroup{}} = ActivityLog.create_shot_group(valid_attrs, current_user, pack)
- ammo_group = ammo_group_id |> Ammo.get_ammo_group!(current_user)
+ pack = pack_id |> Ammo.get_pack!(current_user)
- assert ammo_group.count == 0
+ assert pack.count == 0
assert {:error, %Ecto.Changeset{}} =
- ActivityLog.create_shot_group(%{count: 1}, current_user, ammo_group)
+ ActivityLog.create_shot_group(%{count: 1}, current_user, pack)
end
test "create_shot_group/3 with invalid data returns error changeset",
- %{current_user: current_user, ammo_group: ammo_group} do
+ %{current_user: current_user, pack: pack} do
invalid_params = %{count: nil, date: nil, notes: nil}
assert {:error, %Ecto.Changeset{}} =
- ActivityLog.create_shot_group(invalid_params, current_user, ammo_group)
+ ActivityLog.create_shot_group(invalid_params, current_user, pack)
end
- test "update_shot_group/3 with valid data updates the shot_group and ammo_group",
+ test "update_shot_group/3 with valid data updates the shot_group and pack",
%{
shot_group: shot_group,
- ammo_group: %{id: ammo_group_id},
+ pack: %{id: pack_id},
current_user: current_user
} do
assert {:ok, %ShotGroup{} = shot_group} =
@@ -115,10 +114,10 @@ defmodule Cannery.ActivityLogTest do
current_user
)
- ammo_group = ammo_group_id |> Ammo.get_ammo_group!(current_user)
+ pack = pack_id |> Ammo.get_pack!(current_user)
assert shot_group.count == 10
- assert ammo_group.count == 15
+ assert pack.count == 15
assert shot_group.date == ~D[2022-02-13]
assert shot_group.notes == "some updated notes"
@@ -133,10 +132,10 @@ defmodule Cannery.ActivityLogTest do
current_user
)
- ammo_group = ammo_group_id |> Ammo.get_ammo_group!(current_user)
+ pack = pack_id |> Ammo.get_pack!(current_user)
assert shot_group.count == 25
- assert ammo_group.count == 0
+ assert pack.count == 0
end
test "update_shot_group/3 with invalid data returns error changeset",
@@ -159,10 +158,10 @@ defmodule Cannery.ActivityLogTest do
end
test "delete_shot_group/2 deletes the shot_group and adds value back",
- %{shot_group: shot_group, current_user: current_user, ammo_group: %{id: ammo_group_id}} do
+ %{shot_group: shot_group, current_user: current_user, pack: %{id: pack_id}} do
assert {:ok, %ShotGroup{}} = ActivityLog.delete_shot_group(shot_group, current_user)
- assert %{count: 25} = ammo_group_id |> Ammo.get_ammo_group!(current_user)
+ assert %{count: 25} = pack_id |> Ammo.get_pack!(current_user)
assert_raise Ecto.NoResultsError, fn ->
ActivityLog.get_shot_group!(shot_group.id, current_user)
@@ -170,123 +169,123 @@ defmodule Cannery.ActivityLogTest do
end
test "get_used_count/2 returns accurate used count", %{
- ammo_group: ammo_group,
+ pack: pack,
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- {1, [another_ammo_group]} = ammo_group_fixture(ammo_type, container, current_user)
- assert 0 = another_ammo_group |> ActivityLog.get_used_count(current_user)
- assert 5 = ammo_group |> ActivityLog.get_used_count(current_user)
+ {1, [another_pack]} = pack_fixture(ammo_type, container, current_user)
+ assert 0 = another_pack |> ActivityLog.get_used_count(current_user)
+ assert 5 = pack |> ActivityLog.get_used_count(current_user)
- shot_group_fixture(%{count: 15}, current_user, ammo_group)
- assert 20 = ammo_group |> ActivityLog.get_used_count(current_user)
+ shot_group_fixture(%{count: 15}, current_user, pack)
+ assert 20 = pack |> ActivityLog.get_used_count(current_user)
- shot_group_fixture(%{count: 10}, current_user, ammo_group)
- assert 30 = ammo_group |> ActivityLog.get_used_count(current_user)
+ shot_group_fixture(%{count: 10}, current_user, pack)
+ assert 30 = pack |> ActivityLog.get_used_count(current_user)
- {1, [another_ammo_group]} = ammo_group_fixture(ammo_type, container, current_user)
- assert 0 = another_ammo_group |> ActivityLog.get_used_count(current_user)
+ {1, [another_pack]} = pack_fixture(ammo_type, container, current_user)
+ assert 0 = another_pack |> ActivityLog.get_used_count(current_user)
end
test "get_used_counts/2 returns accurate used counts", %{
- ammo_group: %{id: ammo_group_id} = ammo_group,
+ pack: %{id: pack_id} = pack,
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- {1, [%{id: another_ammo_group_id} = another_ammo_group]} =
- ammo_group_fixture(ammo_type, container, current_user)
+ {1, [%{id: another_pack_id} = another_pack]} =
+ pack_fixture(ammo_type, container, current_user)
- assert %{ammo_group_id => 5} ==
- [ammo_group, another_ammo_group] |> ActivityLog.get_used_counts(current_user)
+ assert %{pack_id => 5} ==
+ [pack, another_pack] |> ActivityLog.get_used_counts(current_user)
- shot_group_fixture(%{count: 5}, current_user, another_ammo_group)
- used_counts = [ammo_group, another_ammo_group] |> ActivityLog.get_used_counts(current_user)
- assert %{^ammo_group_id => 5} = used_counts
- assert %{^another_ammo_group_id => 5} = used_counts
+ shot_group_fixture(%{count: 5}, current_user, another_pack)
+ used_counts = [pack, another_pack] |> ActivityLog.get_used_counts(current_user)
+ assert %{^pack_id => 5} = used_counts
+ assert %{^another_pack_id => 5} = used_counts
- shot_group_fixture(%{count: 15}, current_user, ammo_group)
- used_counts = [ammo_group, another_ammo_group] |> ActivityLog.get_used_counts(current_user)
- assert %{^ammo_group_id => 20} = used_counts
- assert %{^another_ammo_group_id => 5} = used_counts
+ shot_group_fixture(%{count: 15}, current_user, pack)
+ used_counts = [pack, another_pack] |> ActivityLog.get_used_counts(current_user)
+ assert %{^pack_id => 20} = used_counts
+ assert %{^another_pack_id => 5} = used_counts
- shot_group_fixture(%{count: 10}, current_user, ammo_group)
- used_counts = [ammo_group, another_ammo_group] |> ActivityLog.get_used_counts(current_user)
- assert %{^ammo_group_id => 30} = used_counts
- assert %{^another_ammo_group_id => 5} = used_counts
+ shot_group_fixture(%{count: 10}, current_user, pack)
+ used_counts = [pack, another_pack] |> ActivityLog.get_used_counts(current_user)
+ assert %{^pack_id => 30} = used_counts
+ assert %{^another_pack_id => 5} = used_counts
end
test "get_last_used_date/2 returns accurate used count", %{
- ammo_group: ammo_group,
+ pack: pack,
ammo_type: ammo_type,
container: container,
shot_group: %{date: date},
current_user: current_user
} do
- {1, [another_ammo_group]} = ammo_group_fixture(ammo_type, container, current_user)
- assert another_ammo_group |> ActivityLog.get_last_used_date(current_user) |> is_nil()
- assert ^date = ammo_group |> ActivityLog.get_last_used_date(current_user)
+ {1, [another_pack]} = pack_fixture(ammo_type, container, current_user)
+ assert another_pack |> ActivityLog.get_last_used_date(current_user) |> is_nil()
+ assert ^date = pack |> ActivityLog.get_last_used_date(current_user)
- %{date: date} = shot_group_fixture(%{date: ~D[2022-11-10]}, current_user, ammo_group)
- assert ^date = ammo_group |> ActivityLog.get_last_used_date(current_user)
+ %{date: date} = shot_group_fixture(%{date: ~D[2022-11-10]}, current_user, pack)
+ assert ^date = pack |> ActivityLog.get_last_used_date(current_user)
- %{date: date} = shot_group_fixture(%{date: ~D[2022-11-11]}, current_user, ammo_group)
- assert ^date = ammo_group |> ActivityLog.get_last_used_date(current_user)
+ %{date: date} = shot_group_fixture(%{date: ~D[2022-11-11]}, current_user, pack)
+ assert ^date = pack |> ActivityLog.get_last_used_date(current_user)
end
test "get_last_used_dates/2 returns accurate used counts", %{
- ammo_group: %{id: ammo_group_id} = ammo_group,
+ pack: %{id: pack_id} = pack,
ammo_type: ammo_type,
container: container,
shot_group: %{date: date},
current_user: current_user
} do
- {1, [%{id: another_ammo_group_id} = another_ammo_group]} =
- ammo_group_fixture(ammo_type, container, current_user)
+ {1, [%{id: another_pack_id} = another_pack]} =
+ pack_fixture(ammo_type, container, current_user)
# unset date
- assert %{ammo_group_id => date} ==
- [ammo_group, another_ammo_group] |> ActivityLog.get_last_used_dates(current_user)
+ assert %{pack_id => date} ==
+ [pack, another_pack] |> ActivityLog.get_last_used_dates(current_user)
- shot_group_fixture(%{date: ~D[2022-11-09]}, current_user, another_ammo_group)
+ shot_group_fixture(%{date: ~D[2022-11-09]}, current_user, another_pack)
# setting initial date
last_used_shot_groups =
- [ammo_group, another_ammo_group] |> ActivityLog.get_last_used_dates(current_user)
+ [pack, another_pack] |> ActivityLog.get_last_used_dates(current_user)
- assert %{^ammo_group_id => ^date} = last_used_shot_groups
- assert %{^another_ammo_group_id => ~D[2022-11-09]} = last_used_shot_groups
+ assert %{^pack_id => ^date} = last_used_shot_groups
+ assert %{^another_pack_id => ~D[2022-11-09]} = last_used_shot_groups
# setting another date
- shot_group_fixture(%{date: ~D[2022-11-10]}, current_user, ammo_group)
+ shot_group_fixture(%{date: ~D[2022-11-10]}, current_user, pack)
last_used_shot_groups =
- [ammo_group, another_ammo_group] |> ActivityLog.get_last_used_dates(current_user)
+ [pack, another_pack] |> ActivityLog.get_last_used_dates(current_user)
- assert %{^ammo_group_id => ~D[2022-11-10]} = last_used_shot_groups
- assert %{^another_ammo_group_id => ~D[2022-11-09]} = last_used_shot_groups
+ assert %{^pack_id => ~D[2022-11-10]} = last_used_shot_groups
+ assert %{^another_pack_id => ~D[2022-11-09]} = last_used_shot_groups
# setting yet another date
- shot_group_fixture(%{date: ~D[2022-11-11]}, current_user, ammo_group)
+ shot_group_fixture(%{date: ~D[2022-11-11]}, current_user, pack)
last_used_shot_groups =
- [ammo_group, another_ammo_group] |> ActivityLog.get_last_used_dates(current_user)
+ [pack, another_pack] |> ActivityLog.get_last_used_dates(current_user)
- assert %{^ammo_group_id => ~D[2022-11-11]} = last_used_shot_groups
- assert %{^another_ammo_group_id => ~D[2022-11-09]} = last_used_shot_groups
+ assert %{^pack_id => ~D[2022-11-11]} = last_used_shot_groups
+ assert %{^another_pack_id => ~D[2022-11-09]} = last_used_shot_groups
end
test "get_used_count_for_ammo_type/2 gets accurate used round count for ammo type",
- %{ammo_type: ammo_type, ammo_group: ammo_group, current_user: current_user} do
+ %{ammo_type: ammo_type, pack: pack, current_user: current_user} do
another_ammo_type = ammo_type_fixture(current_user)
assert 0 = another_ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user)
assert 5 = ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user)
- shot_group_fixture(%{count: 5}, current_user, ammo_group)
+ shot_group_fixture(%{count: 5}, current_user, pack)
assert 10 = ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user)
- shot_group_fixture(%{count: 1}, current_user, ammo_group)
+ shot_group_fixture(%{count: 1}, current_user, pack)
assert 11 = ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user)
end
@@ -297,14 +296,14 @@ defmodule Cannery.ActivityLogTest do
} do
# testing unused ammo type
%{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
- {1, [ammo_group]} = ammo_group_fixture(another_ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(another_ammo_type, container, current_user)
assert %{ammo_type_id => 5} ==
[ammo_type, another_ammo_type]
|> ActivityLog.get_used_count_for_ammo_types(current_user)
# use generated ammo group
- shot_group_fixture(%{count: 5}, current_user, ammo_group)
+ shot_group_fixture(%{count: 5}, current_user, pack)
used_counts =
[ammo_type, another_ammo_type] |> ActivityLog.get_used_count_for_ammo_types(current_user)
@@ -313,7 +312,7 @@ defmodule Cannery.ActivityLogTest do
assert %{^another_ammo_type_id => 5} = used_counts
# use generated ammo group again
- shot_group_fixture(%{count: 1}, current_user, ammo_group)
+ shot_group_fixture(%{count: 1}, current_user, pack)
used_counts =
[ammo_type, another_ammo_type] |> ActivityLog.get_used_count_for_ammo_types(current_user)
@@ -328,13 +327,13 @@ defmodule Cannery.ActivityLogTest do
current_user = user_fixture()
container = container_fixture(current_user)
ammo_type = ammo_type_fixture(current_user)
- {1, [ammo_group]} = ammo_group_fixture(ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(ammo_type, container, current_user)
[
current_user: current_user,
container: container,
ammo_type: ammo_type,
- ammo_group: ammo_group
+ pack: pack
]
end
@@ -345,21 +344,21 @@ defmodule Cannery.ActivityLogTest do
for class <- ["rifle", "shotgun", "pistol"] do
other_ammo_type = ammo_type_fixture(%{class: class}, other_user)
- {1, [other_ammo_group]} = ammo_group_fixture(other_ammo_type, other_container, other_user)
- shot_group_fixture(other_user, other_ammo_group)
+ {1, [other_pack]} = pack_fixture(other_ammo_type, other_container, other_user)
+ shot_group_fixture(other_user, other_pack)
end
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
- rifle_shot_group = shot_group_fixture(current_user, rifle_ammo_group)
+ {1, [rifle_pack]} = pack_fixture(rifle_ammo_type, container, current_user)
+ rifle_shot_group = shot_group_fixture(current_user, rifle_pack)
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
- shotgun_shot_group = shot_group_fixture(current_user, shotgun_ammo_group)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_ammo_type, container, current_user)
+ shotgun_shot_group = shot_group_fixture(current_user, shotgun_pack)
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
- pistol_shot_group = shot_group_fixture(current_user, pistol_ammo_group)
+ {1, [pistol_pack]} = pack_fixture(pistol_ammo_type, container, current_user)
+ pistol_shot_group = shot_group_fixture(current_user, pistol_pack)
assert [^rifle_shot_group] = ActivityLog.list_shot_groups(:rifle, current_user)
assert [^shotgun_shot_group] = ActivityLog.list_shot_groups(:shotgun, current_user)
@@ -380,32 +379,30 @@ defmodule Cannery.ActivityLogTest do
test "list_shot_groups/3 returns relevant shot_groups for a search", %{
ammo_type: ammo_type,
- ammo_group: ammo_group,
+ pack: pack,
container: container,
current_user: current_user
} do
- shot_group_a = shot_group_fixture(%{notes: "amazing"}, current_user, ammo_group)
+ shot_group_a = shot_group_fixture(%{notes: "amazing"}, current_user, pack)
- {1, [another_ammo_group]} =
- ammo_group_fixture(%{notes: "stupendous"}, ammo_type, container, current_user)
+ {1, [another_pack]} =
+ pack_fixture(%{notes: "stupendous"}, ammo_type, container, current_user)
- shot_group_b = shot_group_fixture(current_user, another_ammo_group)
+ shot_group_b = shot_group_fixture(current_user, another_pack)
another_ammo_type = ammo_type_fixture(%{name: "fabulous ammo"}, current_user)
- {1, [yet_another_ammo_group]} =
- ammo_group_fixture(another_ammo_type, container, current_user)
+ {1, [yet_another_pack]} = pack_fixture(another_ammo_type, container, current_user)
- shot_group_c = shot_group_fixture(current_user, yet_another_ammo_group)
+ shot_group_c = shot_group_fixture(current_user, yet_another_pack)
another_user = user_fixture()
another_container = container_fixture(another_user)
another_ammo_type = ammo_type_fixture(another_user)
- {1, [another_ammo_group]} =
- ammo_group_fixture(another_ammo_type, another_container, another_user)
+ {1, [another_pack]} = pack_fixture(another_ammo_type, another_container, another_user)
- _shouldnt_return = shot_group_fixture(another_user, another_ammo_group)
+ _shouldnt_return = shot_group_fixture(another_user, another_pack)
# notes
assert ActivityLog.list_shot_groups("amazing", :all, current_user) == [shot_group_a]
diff --git a/test/cannery/ammo_test.exs b/test/cannery/ammo_test.exs
index e564e812..9613e88f 100644
--- a/test/cannery/ammo_test.exs
+++ b/test/cannery/ammo_test.exs
@@ -4,7 +4,7 @@ defmodule Cannery.AmmoTest do
"""
use Cannery.DataCase
- alias Cannery.{Ammo, Ammo.AmmoGroup, Ammo.AmmoType, Containers}
+ alias Cannery.{Ammo, Ammo.Pack, Ammo.AmmoType, Containers}
alias Ecto.Changeset
@moduletag :ammo_test
@@ -226,8 +226,8 @@ defmodule Cannery.AmmoTest do
test "get_average_cost_for_ammo_type/2 gets average cost for ammo type",
%{ammo_type: ammo_type, current_user: current_user, container: container} do
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 25.00, count: 1},
ammo_type,
container,
@@ -236,8 +236,8 @@ defmodule Cannery.AmmoTest do
assert 25.0 = Ammo.get_average_cost_for_ammo_type(ammo_type, current_user)
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 25.00, count: 1},
ammo_type,
container,
@@ -246,8 +246,8 @@ defmodule Cannery.AmmoTest do
assert 25.0 = Ammo.get_average_cost_for_ammo_type(ammo_type, current_user)
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 70.00, count: 1},
ammo_type,
container,
@@ -256,8 +256,8 @@ defmodule Cannery.AmmoTest do
assert 40.0 = Ammo.get_average_cost_for_ammo_type(ammo_type, current_user)
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 30.00, count: 1},
ammo_type,
container,
@@ -280,8 +280,8 @@ defmodule Cannery.AmmoTest do
[ammo_type, another_ammo_type]
|> Ammo.get_average_cost_for_ammo_types(current_user)
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 25.00, count: 1},
another_ammo_type,
container,
@@ -292,8 +292,8 @@ defmodule Cannery.AmmoTest do
[ammo_type, another_ammo_type]
|> Ammo.get_average_cost_for_ammo_types(current_user)
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 25.00, count: 1},
ammo_type,
container,
@@ -306,8 +306,8 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 25.0} = average_costs
assert %{^another_ammo_type_id => 25.0} = average_costs
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 25.00, count: 1},
ammo_type,
container,
@@ -320,8 +320,8 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 25.0} = average_costs
assert %{^another_ammo_type_id => 25.0} = average_costs
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 70.00, count: 1},
ammo_type,
container,
@@ -334,8 +334,8 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 40.0} = average_costs
assert %{^another_ammo_type_id => 25.0} = average_costs
- {1, [_ammo_group]} =
- ammo_group_fixture(
+ {1, [_pack]} =
+ pack_fixture(
%{price_paid: 30.00, count: 1},
ammo_type,
container,
@@ -354,19 +354,18 @@ defmodule Cannery.AmmoTest do
another_ammo_type = ammo_type_fixture(current_user)
assert 0 = Ammo.get_round_count_for_ammo_type(another_ammo_type, current_user)
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
assert 1 = Ammo.get_round_count_for_ammo_type(ammo_type, current_user)
- {1, [ammo_group]} = ammo_group_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
assert 51 = Ammo.get_round_count_for_ammo_type(ammo_type, current_user)
- shot_group_fixture(%{count: 26}, current_user, ammo_group)
+ shot_group_fixture(%{count: 26}, current_user, pack)
assert 25 = Ammo.get_round_count_for_ammo_type(ammo_type, current_user)
- shot_group_fixture(%{count: 1}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 1}, current_user, first_pack)
assert 24 = Ammo.get_round_count_for_ammo_type(ammo_type, current_user)
end
@@ -375,16 +374,14 @@ defmodule Cannery.AmmoTest do
current_user: current_user,
container: container
} do
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
assert %{ammo_type_id => 1} ==
[ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
%{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
- {1, [_another_ammo_group]} =
- ammo_group_fixture(%{count: 1}, another_ammo_type, container, current_user)
+ {1, [_another_pack]} = pack_fixture(%{count: 1}, another_ammo_type, container, current_user)
round_counts =
[ammo_type, another_ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
@@ -392,7 +389,7 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 1} = round_counts
assert %{^another_ammo_type_id => 1} = round_counts
- {1, [ammo_group]} = ammo_group_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
round_counts =
[ammo_type, another_ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
@@ -400,7 +397,7 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 51} = round_counts
assert %{^another_ammo_type_id => 1} = round_counts
- shot_group_fixture(%{count: 26}, current_user, ammo_group)
+ shot_group_fixture(%{count: 26}, current_user, pack)
round_counts =
[ammo_type, another_ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
@@ -408,7 +405,7 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 25} = round_counts
assert %{^another_ammo_type_id => 1} = round_counts
- shot_group_fixture(%{count: 1}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 1}, current_user, first_pack)
round_counts =
[ammo_type, another_ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
@@ -421,19 +418,18 @@ defmodule Cannery.AmmoTest do
%{ammo_type: ammo_type, current_user: current_user, container: container} do
assert 0 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
assert 1 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
- {1, [ammo_group]} = ammo_group_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
assert 51 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
- shot_group_fixture(%{count: 26}, current_user, ammo_group)
+ shot_group_fixture(%{count: 26}, current_user, pack)
assert 51 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
- shot_group_fixture(%{count: 1}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 1}, current_user, first_pack)
assert 51 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
end
@@ -445,16 +441,14 @@ defmodule Cannery.AmmoTest do
} do
assert %{} == [ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
assert %{ammo_type_id => 1} ==
[ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
%{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
- {1, [_ammo_group]} =
- ammo_group_fixture(%{count: 1}, another_ammo_type, container, current_user)
+ {1, [_pack]} = pack_fixture(%{count: 1}, another_ammo_type, container, current_user)
historical_counts =
[ammo_type, another_ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
@@ -462,7 +456,7 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 1} = historical_counts
assert %{^another_ammo_type_id => 1} = historical_counts
- {1, [ammo_group]} = ammo_group_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
historical_counts =
[ammo_type, another_ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
@@ -470,7 +464,7 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 51} = historical_counts
assert %{^another_ammo_type_id => 1} = historical_counts
- shot_group_fixture(%{count: 26}, current_user, ammo_group)
+ shot_group_fixture(%{count: 26}, current_user, pack)
historical_counts =
[ammo_type, another_ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
@@ -478,7 +472,7 @@ defmodule Cannery.AmmoTest do
assert %{^ammo_type_id => 51} = historical_counts
assert %{^another_ammo_type_id => 1} = historical_counts
- shot_group_fixture(%{count: 1}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 1}, current_user, first_pack)
historical_counts =
[ammo_type, another_ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
@@ -487,158 +481,151 @@ defmodule Cannery.AmmoTest do
assert %{^another_ammo_type_id => 1} = historical_counts
end
- test "get_used_ammo_groups_count_for_type/2 gets accurate total ammo count for ammo type",
+ test "get_used_packs_count_for_type/2 gets accurate total ammo count for ammo type",
%{ammo_type: ammo_type, current_user: current_user, container: container} do
- assert 0 = Ammo.get_used_ammo_groups_count_for_type(ammo_type, current_user)
+ assert 0 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
- assert 0 = Ammo.get_used_ammo_groups_count_for_type(ammo_type, current_user)
+ assert 0 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
- {1, [ammo_group]} = ammo_group_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
- assert 0 = Ammo.get_used_ammo_groups_count_for_type(ammo_type, current_user)
+ assert 0 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
- shot_group_fixture(%{count: 50}, current_user, ammo_group)
- assert 1 = Ammo.get_used_ammo_groups_count_for_type(ammo_type, current_user)
+ shot_group_fixture(%{count: 50}, current_user, pack)
+ assert 1 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
- shot_group_fixture(%{count: 1}, current_user, first_ammo_group)
- assert 2 = Ammo.get_used_ammo_groups_count_for_type(ammo_type, current_user)
+ shot_group_fixture(%{count: 1}, current_user, first_pack)
+ assert 2 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
end
- test "get_used_ammo_groups_count_for_types/2 gets accurate total ammo counts for ammo types",
+ test "get_used_packs_count_for_types/2 gets accurate total ammo counts for ammo types",
%{
ammo_type: %{id: ammo_type_id} = ammo_type,
current_user: current_user,
container: container
} do
# testing empty ammo type
- assert %{} == [ammo_type] |> Ammo.get_used_ammo_groups_count_for_types(current_user)
+ assert %{} == [ammo_type] |> Ammo.get_used_packs_count_for_types(current_user)
# testing two empty ammo types
%{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
assert %{} ==
[ammo_type, another_ammo_type]
- |> Ammo.get_used_ammo_groups_count_for_types(current_user)
+ |> Ammo.get_used_packs_count_for_types(current_user)
# testing ammo type with ammo group
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
assert %{} ==
[ammo_type, another_ammo_type]
- |> Ammo.get_used_ammo_groups_count_for_types(current_user)
+ |> Ammo.get_used_packs_count_for_types(current_user)
# testing ammo type with used ammo group
- {1, [another_ammo_group]} =
- ammo_group_fixture(%{count: 50}, another_ammo_type, container, current_user)
+ {1, [another_pack]} = pack_fixture(%{count: 50}, another_ammo_type, container, current_user)
- shot_group_fixture(%{count: 50}, current_user, another_ammo_group)
+ shot_group_fixture(%{count: 50}, current_user, another_pack)
assert %{another_ammo_type_id => 1} ==
[ammo_type, another_ammo_type]
- |> Ammo.get_used_ammo_groups_count_for_types(current_user)
+ |> Ammo.get_used_packs_count_for_types(current_user)
# testing two ammo types with zero and one used ammo groups
- {1, [ammo_group]} = ammo_group_fixture(%{count: 50}, ammo_type, container, current_user)
- shot_group_fixture(%{count: 50}, current_user, ammo_group)
+ {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
+ shot_group_fixture(%{count: 50}, current_user, pack)
used_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_used_ammo_groups_count_for_types(current_user)
+ [ammo_type, another_ammo_type] |> Ammo.get_used_packs_count_for_types(current_user)
assert %{^ammo_type_id => 1} = used_counts
assert %{^another_ammo_type_id => 1} = used_counts
# testing two ammo type with one and two used ammo groups
- shot_group_fixture(%{count: 1}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 1}, current_user, first_pack)
used_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_used_ammo_groups_count_for_types(current_user)
+ [ammo_type, another_ammo_type] |> Ammo.get_used_packs_count_for_types(current_user)
assert %{^ammo_type_id => 2} = used_counts
assert %{^another_ammo_type_id => 1} = used_counts
end
- test "get_ammo_groups_count_for_container!/2 gets accurate ammo count for container",
+ test "get_packs_count_for_container!/2 gets accurate ammo count for container",
%{ammo_type: ammo_type, current_user: current_user, container: container} do
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 5}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 5}, ammo_type, container, current_user)
- assert 1 = Ammo.get_ammo_groups_count_for_container!(container, current_user)
+ assert 1 = Ammo.get_packs_count_for_container!(container, current_user)
- {25, _ammo_groups} = ammo_group_fixture(%{count: 5}, 25, ammo_type, container, current_user)
+ {25, _packs} = pack_fixture(%{count: 5}, 25, ammo_type, container, current_user)
- assert 26 = Ammo.get_ammo_groups_count_for_container!(container, current_user)
+ assert 26 = Ammo.get_packs_count_for_container!(container, current_user)
- shot_group_fixture(%{count: 1}, current_user, first_ammo_group)
- assert 26 = Ammo.get_ammo_groups_count_for_container!(container, current_user)
+ shot_group_fixture(%{count: 1}, current_user, first_pack)
+ assert 26 = Ammo.get_packs_count_for_container!(container, current_user)
- shot_group_fixture(%{count: 4}, current_user, first_ammo_group)
- assert 25 = Ammo.get_ammo_groups_count_for_container!(container, current_user)
+ shot_group_fixture(%{count: 4}, current_user, first_pack)
+ assert 25 = Ammo.get_packs_count_for_container!(container, current_user)
end
- test "get_ammo_groups_count_for_containers/2 gets accurate ammo count for containers", %{
+ test "get_packs_count_for_containers/2 gets accurate ammo count for containers", %{
ammo_type: ammo_type,
current_user: current_user,
container: %{id: container_id} = container
} do
%{id: another_container_id} = another_container = container_fixture(current_user)
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 5}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 5}, ammo_type, container, current_user)
- {1, [_first_ammo_group]} =
- ammo_group_fixture(%{count: 5}, ammo_type, another_container, current_user)
+ {1, [_first_pack]} = pack_fixture(%{count: 5}, ammo_type, another_container, current_user)
- ammo_groups_count =
+ packs_count =
[container, another_container]
- |> Ammo.get_ammo_groups_count_for_containers(current_user)
+ |> Ammo.get_packs_count_for_containers(current_user)
- assert %{^container_id => 1} = ammo_groups_count
- assert %{^another_container_id => 1} = ammo_groups_count
+ assert %{^container_id => 1} = packs_count
+ assert %{^another_container_id => 1} = packs_count
- {25, _ammo_groups} = ammo_group_fixture(%{count: 5}, 25, ammo_type, container, current_user)
+ {25, _packs} = pack_fixture(%{count: 5}, 25, ammo_type, container, current_user)
- ammo_groups_count =
+ packs_count =
[container, another_container]
- |> Ammo.get_ammo_groups_count_for_containers(current_user)
+ |> Ammo.get_packs_count_for_containers(current_user)
- assert %{^container_id => 26} = ammo_groups_count
- assert %{^another_container_id => 1} = ammo_groups_count
+ assert %{^container_id => 26} = packs_count
+ assert %{^another_container_id => 1} = packs_count
- shot_group_fixture(%{count: 1}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 1}, current_user, first_pack)
- ammo_groups_count =
+ packs_count =
[container, another_container]
- |> Ammo.get_ammo_groups_count_for_containers(current_user)
+ |> Ammo.get_packs_count_for_containers(current_user)
- assert %{^container_id => 26} = ammo_groups_count
- assert %{^another_container_id => 1} = ammo_groups_count
+ assert %{^container_id => 26} = packs_count
+ assert %{^another_container_id => 1} = packs_count
- shot_group_fixture(%{count: 4}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 4}, current_user, first_pack)
- ammo_groups_count =
+ packs_count =
[container, another_container]
- |> Ammo.get_ammo_groups_count_for_containers(current_user)
+ |> Ammo.get_packs_count_for_containers(current_user)
- assert %{^container_id => 25} = ammo_groups_count
- assert %{^another_container_id => 1} = ammo_groups_count
+ assert %{^container_id => 25} = packs_count
+ assert %{^another_container_id => 1} = packs_count
end
test "get_round_count_for_container!/2 gets accurate total round count for container",
%{ammo_type: ammo_type, current_user: current_user, container: container} do
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 5}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 5}, ammo_type, container, current_user)
assert 5 = Ammo.get_round_count_for_container!(container, current_user)
- {25, _ammo_groups} = ammo_group_fixture(%{count: 5}, 25, ammo_type, container, current_user)
+ {25, _packs} = pack_fixture(%{count: 5}, 25, ammo_type, container, current_user)
assert 130 = Ammo.get_round_count_for_container!(container, current_user)
- shot_group_fixture(%{count: 5}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 5}, current_user, first_pack)
assert 125 = Ammo.get_round_count_for_container!(container, current_user)
end
@@ -650,11 +637,9 @@ defmodule Cannery.AmmoTest do
} do
%{id: another_container_id} = another_container = container_fixture(current_user)
- {1, [first_ammo_group]} =
- ammo_group_fixture(%{count: 5}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 5}, ammo_type, container, current_user)
- {1, [_first_ammo_group]} =
- ammo_group_fixture(%{count: 5}, ammo_type, another_container, current_user)
+ {1, [_first_pack]} = pack_fixture(%{count: 5}, ammo_type, another_container, current_user)
round_counts =
[container, another_container] |> Ammo.get_round_count_for_containers(current_user)
@@ -662,7 +647,7 @@ defmodule Cannery.AmmoTest do
assert %{^container_id => 5} = round_counts
assert %{^another_container_id => 5} = round_counts
- {25, _ammo_groups} = ammo_group_fixture(%{count: 5}, 25, ammo_type, container, current_user)
+ {25, _packs} = pack_fixture(%{count: 5}, 25, ammo_type, container, current_user)
round_counts =
[container, another_container] |> Ammo.get_round_count_for_containers(current_user)
@@ -670,7 +655,7 @@ defmodule Cannery.AmmoTest do
assert %{^container_id => 130} = round_counts
assert %{^another_container_id => 5} = round_counts
- shot_group_fixture(%{count: 5}, current_user, first_ammo_group)
+ shot_group_fixture(%{count: 5}, current_user, first_pack)
round_counts =
[container, another_container] |> Ammo.get_round_count_for_containers(current_user)
@@ -680,7 +665,7 @@ defmodule Cannery.AmmoTest do
end
end
- describe "ammo_groups" do
+ describe "packs" do
@valid_attrs %{
count: 42,
notes: "some notes",
@@ -703,106 +688,105 @@ defmodule Cannery.AmmoTest do
ammo_type = ammo_type_fixture(current_user)
container = container_fixture(current_user)
- {1, [ammo_group]} =
- ammo_group_fixture(%{count: 50, price_paid: 36.1}, ammo_type, container, current_user)
+ {1, [pack]} =
+ pack_fixture(%{count: 50, price_paid: 36.1}, ammo_type, container, current_user)
another_user = user_fixture()
another_ammo_type = ammo_type_fixture(another_user)
another_container = container_fixture(another_user)
- {1, [_shouldnt_show_up]} =
- ammo_group_fixture(another_ammo_type, another_container, another_user)
+ {1, [_shouldnt_show_up]} = pack_fixture(another_ammo_type, another_container, another_user)
[
ammo_type: ammo_type,
- ammo_group: ammo_group,
+ pack: pack,
container: container,
current_user: current_user
]
end
- test "get_ammo_groups_count!/2 returns the correct amount of ammo",
+ test "get_packs_count!/2 returns the correct amount of ammo",
%{ammo_type: ammo_type, container: container, current_user: current_user} do
- assert Ammo.get_ammo_groups_count!(current_user) == 1
+ assert Ammo.get_packs_count!(current_user) == 1
- ammo_group_fixture(ammo_type, container, current_user)
- assert Ammo.get_ammo_groups_count!(current_user) == 2
+ pack_fixture(ammo_type, container, current_user)
+ assert Ammo.get_packs_count!(current_user) == 2
- ammo_group_fixture(ammo_type, container, current_user)
- assert Ammo.get_ammo_groups_count!(current_user) == 3
+ pack_fixture(ammo_type, container, current_user)
+ assert Ammo.get_packs_count!(current_user) == 3
other_user = user_fixture()
- assert Ammo.get_ammo_groups_count!(other_user) == 0
- assert Ammo.get_ammo_groups_count!(other_user, true) == 0
+ assert Ammo.get_packs_count!(other_user) == 0
+ assert Ammo.get_packs_count!(other_user, true) == 0
other_ammo_type = ammo_type_fixture(other_user)
other_container = container_fixture(other_user)
- {1, [another_ammo_group]} =
- ammo_group_fixture(%{count: 30}, other_ammo_type, other_container, other_user)
+ {1, [another_pack]} =
+ pack_fixture(%{count: 30}, other_ammo_type, other_container, other_user)
- shot_group_fixture(%{count: 30}, other_user, another_ammo_group)
- assert Ammo.get_ammo_groups_count!(other_user) == 0
- assert Ammo.get_ammo_groups_count!(other_user, true) == 1
+ shot_group_fixture(%{count: 30}, other_user, another_pack)
+ assert Ammo.get_packs_count!(other_user) == 0
+ assert Ammo.get_packs_count!(other_user, true) == 1
end
- test "list_ammo_groups/4 returns all ammo_groups for a type" do
+ test "list_packs/4 returns all packs for a type" do
current_user = user_fixture()
container = container_fixture(current_user)
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_ammo_type, container, current_user)
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_ammo_type, container, current_user)
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_ammo_type, container, current_user)
- assert [^rifle_ammo_group] = Ammo.list_ammo_groups(nil, :rifle, current_user, false)
- assert [^shotgun_ammo_group] = Ammo.list_ammo_groups(nil, :shotgun, current_user, false)
- assert [^pistol_ammo_group] = Ammo.list_ammo_groups(nil, :pistol, current_user, false)
+ assert [^rifle_pack] = Ammo.list_packs(nil, :rifle, current_user, false)
+ assert [^shotgun_pack] = Ammo.list_packs(nil, :shotgun, current_user, false)
+ assert [^pistol_pack] = Ammo.list_packs(nil, :pistol, current_user, false)
- ammo_groups = Ammo.list_ammo_groups(nil, :all, current_user, false)
- assert Enum.count(ammo_groups) == 3
- assert rifle_ammo_group in ammo_groups
- assert shotgun_ammo_group in ammo_groups
- assert pistol_ammo_group in ammo_groups
+ packs = Ammo.list_packs(nil, :all, current_user, false)
+ assert Enum.count(packs) == 3
+ assert rifle_pack in packs
+ assert shotgun_pack in packs
+ assert pistol_pack in packs
- ammo_groups = Ammo.list_ammo_groups(nil, nil, current_user, false)
- assert Enum.count(ammo_groups) == 3
- assert rifle_ammo_group in ammo_groups
- assert shotgun_ammo_group in ammo_groups
- assert pistol_ammo_group in ammo_groups
+ packs = Ammo.list_packs(nil, nil, current_user, false)
+ assert Enum.count(packs) == 3
+ assert rifle_pack in packs
+ assert shotgun_pack in packs
+ assert pistol_pack in packs
end
- test "list_ammo_groups/4 returns all relevant ammo_groups including used", %{
+ test "list_packs/4 returns all relevant packs including used", %{
ammo_type: ammo_type,
- ammo_group: ammo_group,
+ pack: pack,
container: container,
current_user: current_user
} do
- {1, [%{id: another_ammo_group_id} = another_ammo_group]} =
- ammo_group_fixture(%{count: 30}, ammo_type, container, current_user)
+ {1, [%{id: another_pack_id} = another_pack]} =
+ pack_fixture(%{count: 30}, ammo_type, container, current_user)
- shot_group_fixture(%{count: 30}, current_user, another_ammo_group)
- another_ammo_group = Ammo.get_ammo_group!(another_ammo_group_id, current_user)
+ shot_group_fixture(%{count: 30}, current_user, another_pack)
+ another_pack = Ammo.get_pack!(another_pack_id, current_user)
- assert Ammo.list_ammo_groups(nil, :all, current_user, false) == [ammo_group]
+ assert Ammo.list_packs(nil, :all, current_user, false) == [pack]
- ammo_groups = Ammo.list_ammo_groups(nil, :all, current_user, true)
- assert Enum.count(ammo_groups) == 2
- assert another_ammo_group in ammo_groups
- assert ammo_group in ammo_groups
+ packs = Ammo.list_packs(nil, :all, current_user, true)
+ assert Enum.count(packs) == 2
+ assert another_pack in packs
+ assert pack in packs
end
- test "list_ammo_groups/4 returns relevant ammo groups when searched", %{
+ test "list_packs/4 returns relevant ammo groups when searched", %{
ammo_type: ammo_type,
- ammo_group: ammo_group,
+ pack: pack,
container: container,
current_user: current_user
} do
- {1, [another_ammo_group]} =
+ {1, [another_pack]} =
%{count: 49, notes: "cool ammo group"}
- |> ammo_group_fixture(ammo_type, container, current_user)
+ |> pack_fixture(ammo_type, container, current_user)
another_ammo_type = ammo_type_fixture(%{name: "amazing ammo"}, current_user)
another_container = container_fixture(%{name: "fantastic container"}, current_user)
@@ -810,191 +794,184 @@ defmodule Cannery.AmmoTest do
tag = tag_fixture(%{name: "stupendous tag"}, current_user)
Containers.add_tag!(another_container, tag, current_user)
- {1, [amazing_ammo_group]} =
- ammo_group_fixture(%{count: 48}, another_ammo_type, container, current_user)
+ {1, [amazing_pack]} = pack_fixture(%{count: 48}, another_ammo_type, container, current_user)
- {1, [fantastic_ammo_group]} =
- ammo_group_fixture(%{count: 47}, ammo_type, another_container, current_user)
+ {1, [fantastic_pack]} =
+ pack_fixture(%{count: 47}, ammo_type, another_container, current_user)
- ammo_groups = Ammo.list_ammo_groups(nil, :all, current_user, false)
- assert Enum.count(ammo_groups) == 4
- assert fantastic_ammo_group in ammo_groups
- assert amazing_ammo_group in ammo_groups
- assert another_ammo_group in ammo_groups
- assert ammo_group in ammo_groups
+ packs = Ammo.list_packs(nil, :all, current_user, false)
+ assert Enum.count(packs) == 4
+ assert fantastic_pack in packs
+ assert amazing_pack in packs
+ assert another_pack in packs
+ assert pack in packs
# search works for ammo group attributes
- assert Ammo.list_ammo_groups("cool", :all, current_user, true) == [another_ammo_group]
+ assert Ammo.list_packs("cool", :all, current_user, true) == [another_pack]
# search works for ammo type attributes
- assert Ammo.list_ammo_groups("amazing", :all, current_user, true) == [amazing_ammo_group]
+ assert Ammo.list_packs("amazing", :all, current_user, true) == [amazing_pack]
# search works for container attributes
- assert Ammo.list_ammo_groups("fantastic", :all, current_user, true) ==
- [fantastic_ammo_group]
+ assert Ammo.list_packs("fantastic", :all, current_user, true) ==
+ [fantastic_pack]
# search works for container tag attributes
- assert Ammo.list_ammo_groups("stupendous", :all, current_user, true) ==
- [fantastic_ammo_group]
+ assert Ammo.list_packs("stupendous", :all, current_user, true) ==
+ [fantastic_pack]
- assert Ammo.list_ammo_groups("random", :all, current_user, true) == []
+ assert Ammo.list_packs("random", :all, current_user, true) == []
end
- test "list_ammo_groups_for_type/3 returns all ammo_groups for a type", %{
+ test "list_packs_for_type/3 returns all packs for a type", %{
container: container,
current_user: current_user
} do
ammo_type = ammo_type_fixture(current_user)
- {1, [ammo_group]} = ammo_group_fixture(ammo_type, container, current_user)
- assert [^ammo_group] = Ammo.list_ammo_groups_for_type(ammo_type, current_user)
+ {1, [pack]} = pack_fixture(ammo_type, container, current_user)
+ assert [^pack] = Ammo.list_packs_for_type(ammo_type, current_user)
- shot_group_fixture(current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group.id, current_user)
- assert [] == Ammo.list_ammo_groups_for_type(ammo_type, current_user)
- assert [^ammo_group] = Ammo.list_ammo_groups_for_type(ammo_type, current_user, true)
+ shot_group_fixture(current_user, pack)
+ pack = Ammo.get_pack!(pack.id, current_user)
+ assert [] == Ammo.list_packs_for_type(ammo_type, current_user)
+ assert [^pack] = Ammo.list_packs_for_type(ammo_type, current_user, true)
end
- test "list_ammo_groups_for_container/3 returns all ammo_groups for a container" do
+ test "list_packs_for_container/3 returns all packs for a container" do
current_user = user_fixture()
container = container_fixture(current_user)
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_ammo_type, container, current_user)
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_ammo_type, container, current_user)
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_ammo_type, container, current_user)
another_container = container_fixture(current_user)
- ammo_group_fixture(rifle_ammo_type, another_container, current_user)
- ammo_group_fixture(shotgun_ammo_type, another_container, current_user)
- ammo_group_fixture(pistol_ammo_type, another_container, current_user)
+ pack_fixture(rifle_ammo_type, another_container, current_user)
+ pack_fixture(shotgun_ammo_type, another_container, current_user)
+ pack_fixture(pistol_ammo_type, another_container, current_user)
- assert [^rifle_ammo_group] =
- Ammo.list_ammo_groups_for_container(container, :rifle, current_user)
+ assert [^rifle_pack] = Ammo.list_packs_for_container(container, :rifle, current_user)
- assert [^shotgun_ammo_group] =
- Ammo.list_ammo_groups_for_container(container, :shotgun, current_user)
+ assert [^shotgun_pack] = Ammo.list_packs_for_container(container, :shotgun, current_user)
- assert [^pistol_ammo_group] =
- Ammo.list_ammo_groups_for_container(container, :pistol, current_user)
+ assert [^pistol_pack] = Ammo.list_packs_for_container(container, :pistol, current_user)
- ammo_groups = Ammo.list_ammo_groups_for_container(container, :all, current_user)
- assert Enum.count(ammo_groups) == 3
- assert rifle_ammo_group in ammo_groups
- assert shotgun_ammo_group in ammo_groups
- assert pistol_ammo_group in ammo_groups
+ packs = Ammo.list_packs_for_container(container, :all, current_user)
+ assert Enum.count(packs) == 3
+ assert rifle_pack in packs
+ assert shotgun_pack in packs
+ assert pistol_pack in packs
- ammo_groups = Ammo.list_ammo_groups_for_container(container, nil, current_user)
- assert Enum.count(ammo_groups) == 3
- assert rifle_ammo_group in ammo_groups
- assert shotgun_ammo_group in ammo_groups
- assert pistol_ammo_group in ammo_groups
+ packs = Ammo.list_packs_for_container(container, nil, current_user)
+ assert Enum.count(packs) == 3
+ assert rifle_pack in packs
+ assert shotgun_pack in packs
+ assert pistol_pack in packs
end
- test "get_ammo_groups_count_for_type/2 returns count of ammo_groups for a type", %{
+ test "get_packs_count_for_type/2 returns count of packs for a type", %{
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- assert 1 = Ammo.get_ammo_groups_count_for_type(ammo_type, current_user)
+ assert 1 = Ammo.get_packs_count_for_type(ammo_type, current_user)
another_ammo_type = ammo_type_fixture(current_user)
- assert 0 = Ammo.get_ammo_groups_count_for_type(another_ammo_type, current_user)
+ assert 0 = Ammo.get_packs_count_for_type(another_ammo_type, current_user)
- {5, _ammo_groups} = ammo_group_fixture(%{}, 5, ammo_type, container, current_user)
- assert 6 = Ammo.get_ammo_groups_count_for_type(ammo_type, current_user)
+ {5, _packs} = pack_fixture(%{}, 5, ammo_type, container, current_user)
+ assert 6 = Ammo.get_packs_count_for_type(ammo_type, current_user)
end
- test "get_ammo_groups_count_for_types/2 returns counts of ammo_groups for types", %{
+ test "get_packs_count_for_types/2 returns counts of packs for types", %{
ammo_type: %{id: ammo_type_id} = ammo_type,
container: container,
current_user: current_user
} do
assert %{ammo_type_id => 1} ==
- [ammo_type] |> Ammo.get_ammo_groups_count_for_types(current_user)
+ [ammo_type] |> Ammo.get_packs_count_for_types(current_user)
%{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
assert %{ammo_type_id => 1} ==
[ammo_type, another_ammo_type]
- |> Ammo.get_ammo_groups_count_for_types(current_user)
+ |> Ammo.get_packs_count_for_types(current_user)
- {1, [_ammo_group]} = ammo_group_fixture(another_ammo_type, container, current_user)
+ {1, [_pack]} = pack_fixture(another_ammo_type, container, current_user)
- ammo_groups_count =
- [ammo_type, another_ammo_type] |> Ammo.get_ammo_groups_count_for_types(current_user)
+ packs_count = [ammo_type, another_ammo_type] |> Ammo.get_packs_count_for_types(current_user)
- assert %{^ammo_type_id => 1} = ammo_groups_count
- assert %{^another_ammo_type_id => 1} = ammo_groups_count
+ assert %{^ammo_type_id => 1} = packs_count
+ assert %{^another_ammo_type_id => 1} = packs_count
- {5, _ammo_groups} = ammo_group_fixture(%{}, 5, ammo_type, container, current_user)
+ {5, _packs} = pack_fixture(%{}, 5, ammo_type, container, current_user)
- ammo_groups_count =
- [ammo_type, another_ammo_type] |> Ammo.get_ammo_groups_count_for_types(current_user)
+ packs_count = [ammo_type, another_ammo_type] |> Ammo.get_packs_count_for_types(current_user)
- assert %{^ammo_type_id => 6} = ammo_groups_count
- assert %{^another_ammo_type_id => 1} = ammo_groups_count
+ assert %{^ammo_type_id => 6} = packs_count
+ assert %{^another_ammo_type_id => 1} = packs_count
end
- test "list_staged_ammo_groups/1 returns all ammo_groups that are staged", %{
+ test "list_staged_packs/1 returns all packs that are staged", %{
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- {1, [another_ammo_group]} =
- ammo_group_fixture(%{staged: true}, ammo_type, container, current_user)
+ {1, [another_pack]} = pack_fixture(%{staged: true}, ammo_type, container, current_user)
- assert Ammo.list_staged_ammo_groups(current_user) == [another_ammo_group]
+ assert Ammo.list_staged_packs(current_user) == [another_pack]
end
- test "get_ammo_group!/2 returns the ammo_group with given id",
- %{ammo_group: %{id: ammo_group_id} = ammo_group, current_user: current_user} do
- assert Ammo.get_ammo_group!(ammo_group_id, current_user) == ammo_group
+ test "get_pack!/2 returns the pack with given id",
+ %{pack: %{id: pack_id} = pack, current_user: current_user} do
+ assert Ammo.get_pack!(pack_id, current_user) == pack
end
- test "get_ammo_groups/2 returns the ammo_groups with given id", %{
- ammo_group: %{id: ammo_group_id} = ammo_group,
+ test "get_packs/2 returns the packs with given id", %{
+ pack: %{id: pack_id} = pack,
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- {1, [%{id: another_ammo_group_id} = another_ammo_group]} =
- ammo_group_fixture(ammo_type, container, current_user)
+ {1, [%{id: another_pack_id} = another_pack]} =
+ pack_fixture(ammo_type, container, current_user)
- ammo_groups = Ammo.get_ammo_groups([ammo_group_id, another_ammo_group_id], current_user)
- assert %{^ammo_group_id => ^ammo_group} = ammo_groups
- assert %{^another_ammo_group_id => ^another_ammo_group} = ammo_groups
+ packs = Ammo.get_packs([pack_id, another_pack_id], current_user)
+ assert %{^pack_id => ^pack} = packs
+ assert %{^another_pack_id => ^another_pack} = packs
end
- test "create_ammo_groups/3 with valid data creates a ammo_group", %{
+ test "create_packs/3 with valid data creates a pack", %{
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- assert {:ok, {1, [%AmmoGroup{} = ammo_group]}} =
+ assert {:ok, {1, [%Pack{} = pack]}} =
@valid_attrs
|> Map.merge(%{ammo_type_id: ammo_type.id, container_id: container.id})
- |> Ammo.create_ammo_groups(1, current_user)
+ |> Ammo.create_packs(1, current_user)
- assert ammo_group.count == 42
- assert ammo_group.notes == "some notes"
- assert ammo_group.price_paid == 120.5
+ assert pack.count == 42
+ assert pack.notes == "some notes"
+ assert pack.price_paid == 120.5
end
- test "create_ammo_groups/3 with valid data creates multiple ammo_groups", %{
+ test "create_packs/3 with valid data creates multiple packs", %{
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- assert {:ok, {3, ammo_groups}} =
+ assert {:ok, {3, packs}} =
@valid_attrs
|> Map.merge(%{ammo_type_id: ammo_type.id, container_id: container.id})
- |> Ammo.create_ammo_groups(3, current_user)
+ |> Ammo.create_packs(3, current_user)
- assert [%AmmoGroup{}, %AmmoGroup{}, %AmmoGroup{}] = ammo_groups
+ assert [%Pack{}, %Pack{}, %Pack{}] = packs
- ammo_groups
+ packs
|> Enum.map(fn %{count: count, notes: notes, price_paid: price_paid} ->
assert count == 42
assert notes == "some notes"
@@ -1002,244 +979,236 @@ defmodule Cannery.AmmoTest do
end)
end
- test "create_ammo_groups/3 with invalid data returns error changeset",
+ test "create_packs/3 with invalid data returns error changeset",
%{ammo_type: ammo_type, container: container, current_user: current_user} do
assert {:error, %Changeset{}} =
@invalid_attrs
|> Map.merge(%{ammo_type_id: ammo_type.id, container_id: container.id})
- |> Ammo.create_ammo_groups(1, current_user)
+ |> Ammo.create_packs(1, current_user)
end
- test "update_ammo_group/3 with valid data updates the ammo_group",
- %{ammo_group: ammo_group, current_user: current_user} do
- assert {:ok, %AmmoGroup{} = ammo_group} =
- Ammo.update_ammo_group(ammo_group, @update_attrs, current_user)
+ test "update_pack/3 with valid data updates the pack",
+ %{pack: pack, current_user: current_user} do
+ assert {:ok, %Pack{} = pack} = Ammo.update_pack(pack, @update_attrs, current_user)
- assert ammo_group.count == 43
- assert ammo_group.notes == "some updated notes"
- assert ammo_group.price_paid == 456.7
+ assert pack.count == 43
+ assert pack.notes == "some updated notes"
+ assert pack.price_paid == 456.7
end
- test "update_ammo_group/3 with invalid data returns error changeset",
- %{ammo_group: ammo_group, current_user: current_user} do
- assert {:error, %Changeset{}} =
- Ammo.update_ammo_group(ammo_group, @invalid_attrs, current_user)
+ test "update_pack/3 with invalid data returns error changeset",
+ %{pack: pack, current_user: current_user} do
+ assert {:error, %Changeset{}} = Ammo.update_pack(pack, @invalid_attrs, current_user)
- assert ammo_group == Ammo.get_ammo_group!(ammo_group.id, current_user)
+ assert pack == Ammo.get_pack!(pack.id, current_user)
end
- test "delete_ammo_group/2 deletes the ammo_group",
- %{ammo_group: ammo_group, current_user: current_user} do
- assert {:ok, %AmmoGroup{}} = Ammo.delete_ammo_group(ammo_group, current_user)
- assert_raise KeyError, fn -> Ammo.get_ammo_group!(ammo_group.id, current_user) end
+ test "delete_pack/2 deletes the pack",
+ %{pack: pack, current_user: current_user} do
+ assert {:ok, %Pack{}} = Ammo.delete_pack(pack, current_user)
+ assert_raise KeyError, fn -> Ammo.get_pack!(pack.id, current_user) end
end
test "get_percentage_remaining/2 gets accurate total round count",
- %{ammo_group: %{id: ammo_group_id} = ammo_group, current_user: current_user} do
- assert 100 = ammo_group |> Ammo.get_percentage_remaining(current_user)
+ %{pack: %{id: pack_id} = pack, current_user: current_user} do
+ assert 100 = pack |> Ammo.get_percentage_remaining(current_user)
- shot_group_fixture(%{count: 14}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- assert 72 = ammo_group |> Ammo.get_percentage_remaining(current_user)
+ shot_group_fixture(%{count: 14}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ assert 72 = pack |> Ammo.get_percentage_remaining(current_user)
- shot_group_fixture(%{count: 11}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- assert 50 = ammo_group |> Ammo.get_percentage_remaining(current_user)
+ shot_group_fixture(%{count: 11}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ assert 50 = pack |> Ammo.get_percentage_remaining(current_user)
- shot_group_fixture(%{count: 25}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- assert 0 = ammo_group |> Ammo.get_percentage_remaining(current_user)
+ shot_group_fixture(%{count: 25}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ assert 0 = pack |> Ammo.get_percentage_remaining(current_user)
end
test "get_percentages_remaining/2 gets accurate total round count", %{
- ammo_group: %{id: ammo_group_id} = ammo_group,
+ pack: %{id: pack_id} = pack,
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- assert %{ammo_group_id => 100} ==
- [ammo_group] |> Ammo.get_percentages_remaining(current_user)
+ assert %{pack_id => 100} ==
+ [pack] |> Ammo.get_percentages_remaining(current_user)
- {1, [%{id: another_ammo_group_id} = another_ammo_group]} =
+ {1, [%{id: another_pack_id} = another_pack]} =
%{count: 50, price_paid: 36.1}
- |> ammo_group_fixture(ammo_type, container, current_user)
+ |> pack_fixture(ammo_type, container, current_user)
- percentages =
- [ammo_group, another_ammo_group] |> Ammo.get_percentages_remaining(current_user)
+ percentages = [pack, another_pack] |> Ammo.get_percentages_remaining(current_user)
- assert %{^ammo_group_id => 100} = percentages
- assert %{^another_ammo_group_id => 100} = percentages
+ assert %{^pack_id => 100} = percentages
+ assert %{^another_pack_id => 100} = percentages
- shot_group_fixture(%{count: 14}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
+ shot_group_fixture(%{count: 14}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
- percentages =
- [ammo_group, another_ammo_group] |> Ammo.get_percentages_remaining(current_user)
+ percentages = [pack, another_pack] |> Ammo.get_percentages_remaining(current_user)
- assert %{^ammo_group_id => 72} = percentages
- assert %{^another_ammo_group_id => 100} = percentages
+ assert %{^pack_id => 72} = percentages
+ assert %{^another_pack_id => 100} = percentages
- shot_group_fixture(%{count: 11}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
+ shot_group_fixture(%{count: 11}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
- percentages =
- [ammo_group, another_ammo_group] |> Ammo.get_percentages_remaining(current_user)
+ percentages = [pack, another_pack] |> Ammo.get_percentages_remaining(current_user)
- assert %{^ammo_group_id => 50} = percentages
- assert %{^another_ammo_group_id => 100} = percentages
+ assert %{^pack_id => 50} = percentages
+ assert %{^another_pack_id => 100} = percentages
- shot_group_fixture(%{count: 25}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
+ shot_group_fixture(%{count: 25}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
- percentages =
- [ammo_group, another_ammo_group] |> Ammo.get_percentages_remaining(current_user)
+ percentages = [pack, another_pack] |> Ammo.get_percentages_remaining(current_user)
- assert %{^ammo_group_id => 0} = percentages
- assert %{^another_ammo_group_id => 100} = percentages
+ assert %{^pack_id => 0} = percentages
+ assert %{^another_pack_id => 100} = percentages
end
test "get_cpr/2 gets accurate cpr",
%{ammo_type: ammo_type, container: container, current_user: current_user} do
- {1, [ammo_group]} = ammo_group_fixture(%{count: 1}, ammo_type, container, current_user)
- assert ammo_group |> Ammo.get_cpr(current_user) |> is_nil()
+ {1, [pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ assert pack |> Ammo.get_cpr(current_user) |> is_nil()
- {1, [ammo_group]} =
- ammo_group_fixture(
+ {1, [pack]} =
+ pack_fixture(
%{count: 1, price_paid: 1.0},
ammo_type,
container,
current_user
)
- assert 1.0 = ammo_group |> Ammo.get_cpr(current_user)
+ assert 1.0 = pack |> Ammo.get_cpr(current_user)
- {1, [ammo_group]} =
- ammo_group_fixture(
+ {1, [pack]} =
+ pack_fixture(
%{count: 2, price_paid: 3.0},
ammo_type,
container,
current_user
)
- assert 1.5 = ammo_group |> Ammo.get_cpr(current_user)
+ assert 1.5 = pack |> Ammo.get_cpr(current_user)
- {1, [ammo_group]} =
- ammo_group_fixture(
+ {1, [pack]} =
+ pack_fixture(
%{count: 50, price_paid: 36.1},
ammo_type,
container,
current_user
)
- assert 0.722 = ammo_group |> Ammo.get_cpr(current_user)
+ assert 0.722 = pack |> Ammo.get_cpr(current_user)
# with shot group, maintains total
- shot_group_fixture(%{count: 14}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group.id, current_user)
- assert 0.722 = ammo_group |> Ammo.get_cpr(current_user)
+ shot_group_fixture(%{count: 14}, current_user, pack)
+ pack = Ammo.get_pack!(pack.id, current_user)
+ assert 0.722 = pack |> Ammo.get_cpr(current_user)
end
test "get_cprs/2 gets accurate cprs",
%{ammo_type: ammo_type, container: container, current_user: current_user} do
- {1, [ammo_group]} = ammo_group_fixture(%{count: 1}, ammo_type, container, current_user)
- assert %{} == [ammo_group] |> Ammo.get_cprs(current_user)
+ {1, [pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ assert %{} == [pack] |> Ammo.get_cprs(current_user)
- {1, [%{id: ammo_group_id} = ammo_group]} =
- ammo_group_fixture(
+ {1, [%{id: pack_id} = pack]} =
+ pack_fixture(
%{count: 1, price_paid: 1.0},
ammo_type,
container,
current_user
)
- assert %{ammo_group_id => 1.0} == [ammo_group] |> Ammo.get_cprs(current_user)
+ assert %{pack_id => 1.0} == [pack] |> Ammo.get_cprs(current_user)
- {1, [%{id: another_ammo_group_id} = another_ammo_group]} =
- ammo_group_fixture(
+ {1, [%{id: another_pack_id} = another_pack]} =
+ pack_fixture(
%{count: 2, price_paid: 3.0},
ammo_type,
container,
current_user
)
- cprs = [ammo_group, another_ammo_group] |> Ammo.get_cprs(current_user)
- assert %{^ammo_group_id => 1.0} = cprs
- assert %{^another_ammo_group_id => 1.5} = cprs
+ cprs = [pack, another_pack] |> Ammo.get_cprs(current_user)
+ assert %{^pack_id => 1.0} = cprs
+ assert %{^another_pack_id => 1.5} = cprs
- {1, [%{id: yet_another_ammo_group_id} = yet_another_ammo_group]} =
- ammo_group_fixture(
+ {1, [%{id: yet_another_pack_id} = yet_another_pack]} =
+ pack_fixture(
%{count: 50, price_paid: 36.1},
ammo_type,
container,
current_user
)
- cprs =
- [ammo_group, another_ammo_group, yet_another_ammo_group] |> Ammo.get_cprs(current_user)
+ cprs = [pack, another_pack, yet_another_pack] |> Ammo.get_cprs(current_user)
- assert %{^ammo_group_id => 1.0} = cprs
- assert %{^another_ammo_group_id => 1.5} = cprs
- assert %{^yet_another_ammo_group_id => 0.722} = cprs
+ assert %{^pack_id => 1.0} = cprs
+ assert %{^another_pack_id => 1.5} = cprs
+ assert %{^yet_another_pack_id => 0.722} = cprs
# with shot group, maintains total
- shot_group_fixture(%{count: 14}, current_user, yet_another_ammo_group)
- yet_another_ammo_group = Ammo.get_ammo_group!(yet_another_ammo_group.id, current_user)
+ shot_group_fixture(%{count: 14}, current_user, yet_another_pack)
+ yet_another_pack = Ammo.get_pack!(yet_another_pack.id, current_user)
- cprs =
- [ammo_group, another_ammo_group, yet_another_ammo_group] |> Ammo.get_cprs(current_user)
+ cprs = [pack, another_pack, yet_another_pack] |> Ammo.get_cprs(current_user)
- assert %{^ammo_group_id => 1.0} = cprs
- assert %{^another_ammo_group_id => 1.5} = cprs
- assert %{^yet_another_ammo_group_id => 0.722} = cprs
+ assert %{^pack_id => 1.0} = cprs
+ assert %{^another_pack_id => 1.5} = cprs
+ assert %{^yet_another_pack_id => 0.722} = cprs
end
test "get_original_count/2 gets accurate original count",
- %{ammo_group: %{id: ammo_group_id} = ammo_group, current_user: current_user} do
- assert 50 = ammo_group |> Ammo.get_original_count(current_user)
+ %{pack: %{id: pack_id} = pack, current_user: current_user} do
+ assert 50 = pack |> Ammo.get_original_count(current_user)
- shot_group_fixture(%{count: 14}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- assert 50 = ammo_group |> Ammo.get_original_count(current_user)
+ shot_group_fixture(%{count: 14}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ assert 50 = pack |> Ammo.get_original_count(current_user)
- shot_group_fixture(%{count: 11}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- assert 50 = ammo_group |> Ammo.get_original_count(current_user)
+ shot_group_fixture(%{count: 11}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ assert 50 = pack |> Ammo.get_original_count(current_user)
- shot_group_fixture(%{count: 25}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- assert 50 = ammo_group |> Ammo.get_original_count(current_user)
+ shot_group_fixture(%{count: 25}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ assert 50 = pack |> Ammo.get_original_count(current_user)
end
test "get_original_counts/2 gets accurate original counts", %{
- ammo_group: %{id: ammo_group_id} = ammo_group,
+ pack: %{id: pack_id} = pack,
ammo_type: ammo_type,
container: container,
current_user: current_user
} do
- {1, [%{id: another_ammo_group_id} = another_ammo_group]} =
- ammo_group_fixture(%{count: 25}, ammo_type, container, current_user)
+ {1, [%{id: another_pack_id} = another_pack]} =
+ pack_fixture(%{count: 25}, ammo_type, container, current_user)
- original_counts = [ammo_group, another_ammo_group] |> Ammo.get_original_counts(current_user)
- assert %{^ammo_group_id => 50} = original_counts
- assert %{^another_ammo_group_id => 25} = original_counts
+ original_counts = [pack, another_pack] |> Ammo.get_original_counts(current_user)
+ assert %{^pack_id => 50} = original_counts
+ assert %{^another_pack_id => 25} = original_counts
- shot_group_fixture(%{count: 14}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- original_counts = [ammo_group, another_ammo_group] |> Ammo.get_original_counts(current_user)
- assert %{^ammo_group_id => 50} = original_counts
- assert %{^another_ammo_group_id => 25} = original_counts
+ shot_group_fixture(%{count: 14}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ original_counts = [pack, another_pack] |> Ammo.get_original_counts(current_user)
+ assert %{^pack_id => 50} = original_counts
+ assert %{^another_pack_id => 25} = original_counts
- shot_group_fixture(%{count: 11}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- original_counts = [ammo_group, another_ammo_group] |> Ammo.get_original_counts(current_user)
- assert %{^ammo_group_id => 50} = original_counts
- assert %{^another_ammo_group_id => 25} = original_counts
+ shot_group_fixture(%{count: 11}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ original_counts = [pack, another_pack] |> Ammo.get_original_counts(current_user)
+ assert %{^pack_id => 50} = original_counts
+ assert %{^another_pack_id => 25} = original_counts
- shot_group_fixture(%{count: 25}, current_user, ammo_group)
- ammo_group = Ammo.get_ammo_group!(ammo_group_id, current_user)
- original_counts = [ammo_group, another_ammo_group] |> Ammo.get_original_counts(current_user)
- assert %{^ammo_group_id => 50} = original_counts
- assert %{^another_ammo_group_id => 25} = original_counts
+ shot_group_fixture(%{count: 25}, current_user, pack)
+ pack = Ammo.get_pack!(pack_id, current_user)
+ original_counts = [pack, another_pack] |> Ammo.get_original_counts(current_user)
+ assert %{^pack_id => 50} = original_counts
+ assert %{^another_pack_id => 25} = original_counts
end
end
end
diff --git a/test/cannery_web/controllers/export_controller_test.exs b/test/cannery_web/controllers/export_controller_test.exs
index 8cf6af7d..09fb12f7 100644
--- a/test/cannery_web/controllers/export_controller_test.exs
+++ b/test/cannery_web/controllers/export_controller_test.exs
@@ -15,13 +15,13 @@ defmodule CanneryWeb.ExportControllerTest do
container = container_fixture(current_user)
tag = tag_fixture(current_user)
Containers.add_tag!(container, tag, current_user)
- {1, [ammo_group]} = ammo_group_fixture(ammo_type, container, current_user)
- shot_group = shot_group_fixture(current_user, ammo_group)
- ammo_group = ammo_group |> Repo.reload!()
+ {1, [pack]} = pack_fixture(ammo_type, container, current_user)
+ shot_group = shot_group_fixture(current_user, pack)
+ pack = pack |> Repo.reload!()
%{
ammo_type: ammo_type,
- ammo_group: ammo_group,
+ pack: pack,
container: container,
shot_group: shot_group,
tag: tag
@@ -36,24 +36,24 @@ defmodule CanneryWeb.ExportControllerTest do
current_user: current_user,
container: container,
ammo_type: ammo_type,
- ammo_group: ammo_group,
+ pack: pack,
shot_group: shot_group,
tag: tag
} do
conn = get(conn, Routes.export_path(conn, :export, :json))
- ideal_ammo_group = %{
- "ammo_type_id" => ammo_group.ammo_type_id,
- "container_id" => ammo_group.container_id,
- "count" => ammo_group.count,
- "id" => ammo_group.id,
- "notes" => ammo_group.notes,
- "price_paid" => ammo_group.price_paid,
- "staged" => ammo_group.staged,
- "used_count" => ammo_group |> ActivityLog.get_used_count(current_user),
- "original_count" => ammo_group |> Ammo.get_original_count(current_user),
- "cpr" => ammo_group |> Ammo.get_cpr(current_user),
- "percentage_remaining" => ammo_group |> Ammo.get_percentage_remaining(current_user)
+ ideal_pack = %{
+ "ammo_type_id" => pack.ammo_type_id,
+ "container_id" => pack.container_id,
+ "count" => pack.count,
+ "id" => pack.id,
+ "notes" => pack.notes,
+ "price_paid" => pack.price_paid,
+ "staged" => pack.staged,
+ "used_count" => pack |> ActivityLog.get_used_count(current_user),
+ "original_count" => pack |> Ammo.get_original_count(current_user),
+ "cpr" => pack |> Ammo.get_cpr(current_user),
+ "percentage_remaining" => pack |> Ammo.get_percentage_remaining(current_user)
}
ideal_ammo_type = %{
@@ -82,9 +82,8 @@ defmodule CanneryWeb.ExportControllerTest do
"average_cost" => ammo_type |> Ammo.get_average_cost_for_ammo_type(current_user),
"round_count" => ammo_type |> Ammo.get_round_count_for_ammo_type(current_user),
"used_count" => ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user),
- "ammo_group_count" => ammo_type |> Ammo.get_ammo_groups_count_for_type(current_user),
- "total_ammo_group_count" =>
- ammo_type |> Ammo.get_ammo_groups_count_for_type(current_user, true)
+ "pack_count" => ammo_type |> Ammo.get_packs_count_for_type(current_user),
+ "total_pack_count" => ammo_type |> Ammo.get_packs_count_for_type(current_user, true)
}
ideal_container = %{
@@ -101,13 +100,12 @@ defmodule CanneryWeb.ExportControllerTest do
}
],
"type" => container.type,
- "ammo_group_count" =>
- container |> Ammo.get_ammo_groups_count_for_container!(current_user),
+ "pack_count" => container |> Ammo.get_packs_count_for_container!(current_user),
"round_count" => container |> Ammo.get_round_count_for_container!(current_user)
}
ideal_shot_group = %{
- "ammo_group_id" => shot_group.ammo_group_id,
+ "pack_id" => shot_group.pack_id,
"count" => shot_group.count,
"date" => to_string(shot_group.date),
"id" => shot_group.id,
@@ -126,7 +124,7 @@ defmodule CanneryWeb.ExportControllerTest do
}
json_resp = conn |> json_response(200)
- assert %{"ammo_groups" => [^ideal_ammo_group]} = json_resp
+ assert %{"packs" => [^ideal_pack]} = json_resp
assert %{"ammo_types" => [^ideal_ammo_type]} = json_resp
assert %{"containers" => [^ideal_container]} = json_resp
assert %{"shot_groups" => [^ideal_shot_group]} = json_resp
diff --git a/test/cannery_web/live/ammo_group_live_test.exs b/test/cannery_web/live/ammo_group_live_test.exs
index 5dbee809..69171a92 100644
--- a/test/cannery_web/live/ammo_group_live_test.exs
+++ b/test/cannery_web/live/ammo_group_live_test.exs
@@ -1,4 +1,4 @@
-defmodule CanneryWeb.AmmoGroupLiveTest do
+defmodule CanneryWeb.PackLiveTest do
@moduledoc """
Tests ammo group live pages
"""
@@ -7,11 +7,11 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
import Phoenix.LiveViewTest
alias Cannery.{Ammo, Repo}
- @moduletag :ammo_group_live_test
+ @moduletag :pack_live_test
@create_attrs %{count: 42, notes: "some notes", price_paid: 120.5}
@update_attrs %{count: 43, notes: "some updated notes", price_paid: 456.7}
@invalid_attrs %{count: nil, notes: nil, price_paid: nil}
- @ammo_group_create_limit 10_000
+ @pack_create_limit 10_000
@shot_group_create_attrs %{ammo_left: 5, notes: "some notes"}
@shot_group_update_attrs %{
count: 5,
@@ -28,296 +28,294 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
count: 20
}
- defp create_ammo_group(%{current_user: current_user}) do
+ defp create_pack(%{current_user: current_user}) do
ammo_type = ammo_type_fixture(current_user)
container = container_fixture(current_user)
- {1, [ammo_group]} = ammo_group_fixture(@create_attrs, ammo_type, container, current_user)
- [ammo_type: ammo_type, ammo_group: ammo_group, container: container]
+ {1, [pack]} = pack_fixture(@create_attrs, ammo_type, container, current_user)
+ [ammo_type: ammo_type, pack: pack, container: container]
end
- defp create_shot_group(%{current_user: current_user, ammo_group: ammo_group}) do
- shot_group = shot_group_fixture(@shot_group_update_attrs, current_user, ammo_group)
- ammo_group = ammo_group |> Repo.reload!()
- [ammo_group: ammo_group, shot_group: shot_group]
+ defp create_shot_group(%{current_user: current_user, pack: pack}) do
+ shot_group = shot_group_fixture(@shot_group_update_attrs, current_user, pack)
+ pack = pack |> Repo.reload!()
+ [pack: pack, shot_group: shot_group]
end
- defp create_empty_ammo_group(%{
+ defp create_empty_pack(%{
current_user: current_user,
ammo_type: ammo_type,
container: container
}) do
- {1, [ammo_group]} = ammo_group_fixture(@empty_attrs, ammo_type, container, current_user)
- shot_group = shot_group_fixture(@shot_group_attrs, current_user, ammo_group)
- ammo_group = ammo_group |> Repo.reload!()
- [empty_ammo_group: ammo_group, shot_group: shot_group]
+ {1, [pack]} = pack_fixture(@empty_attrs, ammo_type, container, current_user)
+ shot_group = shot_group_fixture(@shot_group_attrs, current_user, pack)
+ pack = pack |> Repo.reload!()
+ [empty_pack: pack, shot_group: shot_group]
end
describe "Index of ammo group" do
- setup [:register_and_log_in_user, :create_ammo_group]
+ setup [:register_and_log_in_user, :create_pack]
- test "lists all ammo_groups", %{conn: conn, ammo_group: ammo_group} do
- {:ok, _index_live, html} = live(conn, Routes.ammo_group_index_path(conn, :index))
- ammo_group = ammo_group |> Repo.preload(:ammo_type)
+ test "lists all packs", %{conn: conn, pack: pack} do
+ {:ok, _index_live, html} = live(conn, Routes.pack_index_path(conn, :index))
+ pack = pack |> Repo.preload(:ammo_type)
assert html =~ "Ammo"
- assert html =~ ammo_group.ammo_type.name
+ assert html =~ pack.ammo_type.name
end
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
rifle_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_ammo_group]} = ammo_group_fixture(rifle_type, container, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_type, container, current_user)
shotgun_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_type, container, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_type, container, current_user)
pistol_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_ammo_group]} = ammo_group_fixture(pistol_type, container, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
- {:ok, index_live, html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ {:ok, index_live, html} = live(conn, Routes.pack_index_path(conn, :index))
assert html =~ "All"
- assert html =~ rifle_ammo_group.ammo_type.name
- assert html =~ shotgun_ammo_group.ammo_type.name
- assert html =~ pistol_ammo_group.ammo_type.name
+ assert html =~ rifle_pack.ammo_type.name
+ assert html =~ shotgun_pack.ammo_type.name
+ assert html =~ pistol_pack.ammo_type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :rifle})
- assert html =~ rifle_ammo_group.ammo_type.name
- refute html =~ shotgun_ammo_group.ammo_type.name
- refute html =~ pistol_ammo_group.ammo_type.name
+ assert html =~ rifle_pack.ammo_type.name
+ refute html =~ shotgun_pack.ammo_type.name
+ refute html =~ pistol_pack.ammo_type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :shotgun})
- refute html =~ rifle_ammo_group.ammo_type.name
- assert html =~ shotgun_ammo_group.ammo_type.name
- refute html =~ pistol_ammo_group.ammo_type.name
+ refute html =~ rifle_pack.ammo_type.name
+ assert html =~ shotgun_pack.ammo_type.name
+ refute html =~ pistol_pack.ammo_type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :pistol})
- refute html =~ rifle_ammo_group.ammo_type.name
- refute html =~ shotgun_ammo_group.ammo_type.name
- assert html =~ pistol_ammo_group.ammo_type.name
+ refute html =~ rifle_pack.ammo_type.name
+ refute html =~ shotgun_pack.ammo_type.name
+ assert html =~ pistol_pack.ammo_type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :all})
- assert html =~ rifle_ammo_group.ammo_type.name
- assert html =~ shotgun_ammo_group.ammo_type.name
- assert html =~ pistol_ammo_group.ammo_type.name
+ assert html =~ rifle_pack.ammo_type.name
+ assert html =~ shotgun_pack.ammo_type.name
+ assert html =~ pistol_pack.ammo_type.name
end
- test "can search for ammo_groups", %{conn: conn, ammo_group: ammo_group} do
- {:ok, index_live, html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "can search for packs", %{conn: conn, pack: pack} do
+ {:ok, index_live, html} = live(conn, Routes.pack_index_path(conn, :index))
- ammo_group = ammo_group |> Repo.preload(:ammo_type)
+ pack = pack |> Repo.preload(:ammo_type)
- assert html =~ ammo_group.ammo_type.name
+ assert html =~ pack.ammo_type.name
assert index_live
|> form(~s/form[phx-change="search"]/)
- |> render_change(search: %{search_term: ammo_group.ammo_type.name}) =~
- ammo_group.ammo_type.name
+ |> render_change(search: %{search_term: pack.ammo_type.name}) =~
+ pack.ammo_type.name
assert_patch(
index_live,
- Routes.ammo_group_index_path(conn, :search, ammo_group.ammo_type.name)
+ Routes.pack_index_path(conn, :search, pack.ammo_type.name)
)
refute index_live
|> form(~s/form[phx-change="search"]/)
|> render_change(search: %{search_term: "something_else"}) =~
- ammo_group.ammo_type.name
+ pack.ammo_type.name
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :search, "something_else"))
+ assert_patch(index_live, Routes.pack_index_path(conn, :search, "something_else"))
assert index_live
|> form(~s/form[phx-change="search"]/)
- |> render_change(search: %{search_term: ""}) =~ ammo_group.ammo_type.name
+ |> render_change(search: %{search_term: ""}) =~ pack.ammo_type.name
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :index))
+ assert_patch(index_live, Routes.pack_index_path(conn, :index))
end
- test "saves a single new ammo_group", %{conn: conn} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "saves a single new pack", %{conn: conn} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
assert index_live |> element("a", "Add Ammo") |> render_click() =~ "Add Ammo"
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :new))
+ assert_patch(index_live, Routes.pack_index_path(conn, :new))
assert index_live
- |> form("#ammo_group-form")
- |> render_change(ammo_group: @invalid_attrs) =~ "can't be blank"
+ |> form("#pack-form")
+ |> render_change(pack: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
index_live
- |> form("#ammo_group-form")
- |> render_submit(ammo_group: @create_attrs)
- |> follow_redirect(conn, Routes.ammo_group_index_path(conn, :index))
+ |> form("#pack-form")
+ |> render_submit(pack: @create_attrs)
+ |> follow_redirect(conn, Routes.pack_index_path(conn, :index))
assert html =~ "Ammo added successfully"
assert html =~ "\n42\n"
end
- test "saves multiple new ammo_groups", %{conn: conn, current_user: current_user} do
+ test "saves multiple new packs", %{conn: conn, current_user: current_user} do
multiplier = 25
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
assert index_live |> element("a", "Add Ammo") |> render_click() =~ "Add Ammo"
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :new))
+ assert_patch(index_live, Routes.pack_index_path(conn, :new))
assert index_live
- |> form("#ammo_group-form")
- |> render_change(ammo_group: @invalid_attrs) =~ "can't be blank"
+ |> form("#pack-form")
+ |> render_change(pack: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
index_live
- |> form("#ammo_group-form")
- |> render_submit(ammo_group: @create_attrs |> Map.put(:multiplier, multiplier))
- |> follow_redirect(conn, Routes.ammo_group_index_path(conn, :index))
+ |> form("#pack-form")
+ |> render_submit(pack: @create_attrs |> Map.put(:multiplier, multiplier))
+ |> follow_redirect(conn, Routes.pack_index_path(conn, :index))
assert html =~ "Ammo added successfully"
- assert Ammo.list_ammo_groups(nil, :all, current_user) |> Enum.count() == multiplier + 1
+ assert Ammo.list_packs(nil, :all, current_user) |> Enum.count() == multiplier + 1
end
- test "does not save invalid number of new ammo_groups", %{conn: conn} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "does not save invalid number of new packs", %{conn: conn} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
assert index_live |> element("a", "Add Ammo") |> render_click() =~ "Add Ammo"
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :new))
+ assert_patch(index_live, Routes.pack_index_path(conn, :new))
assert index_live
- |> form("#ammo_group-form")
- |> render_change(ammo_group: @invalid_attrs) =~ "can't be blank"
+ |> form("#pack-form")
+ |> render_change(pack: @invalid_attrs) =~ "can't be blank"
assert index_live
- |> form("#ammo_group-form")
- |> render_submit(ammo_group: @create_attrs |> Map.put(:multiplier, "0")) =~
- "Invalid number of copies, must be between 1 and #{@ammo_group_create_limit}. Was 0"
+ |> form("#pack-form")
+ |> render_submit(pack: @create_attrs |> Map.put(:multiplier, "0")) =~
+ "Invalid number of copies, must be between 1 and #{@pack_create_limit}. Was 0"
assert index_live
- |> form("#ammo_group-form")
- |> render_submit(
- ammo_group: @create_attrs |> Map.put(:multiplier, @ammo_group_create_limit + 1)
- ) =~
- "Invalid number of copies, must be between 1 and #{@ammo_group_create_limit}. Was #{@ammo_group_create_limit + 1}"
+ |> form("#pack-form")
+ |> render_submit(pack: @create_attrs |> Map.put(:multiplier, @pack_create_limit + 1)) =~
+ "Invalid number of copies, must be between 1 and #{@pack_create_limit}. Was #{@pack_create_limit + 1}"
end
- test "updates ammo_group in listing", %{conn: conn, ammo_group: ammo_group} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "updates pack in listing", %{conn: conn, pack: pack} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
assert index_live
- |> element(~s/a[aria-label="Edit ammo group of #{ammo_group.count} bullets"]/)
+ |> element(~s/a[aria-label="Edit ammo group of #{pack.count} bullets"]/)
|> render_click() =~ "Edit ammo"
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :edit, ammo_group))
+ assert_patch(index_live, Routes.pack_index_path(conn, :edit, pack))
assert index_live
- |> form("#ammo_group-form")
- |> render_change(ammo_group: @invalid_attrs) =~ "can't be blank"
+ |> form("#pack-form")
+ |> render_change(pack: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
index_live
- |> form("#ammo_group-form")
- |> render_submit(ammo_group: @update_attrs)
- |> follow_redirect(conn, Routes.ammo_group_index_path(conn, :index))
+ |> form("#pack-form")
+ |> render_submit(pack: @update_attrs)
+ |> follow_redirect(conn, Routes.pack_index_path(conn, :index))
assert html =~ "Ammo updated successfully"
assert html =~ "\n43\n"
end
- test "clones ammo_group in listing", %{conn: conn, ammo_group: ammo_group} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "clones pack in listing", %{conn: conn, pack: pack} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
html =
index_live
- |> element(~s/a[aria-label="Clone ammo group of #{ammo_group.count} bullets"]/)
+ |> element(~s/a[aria-label="Clone ammo group of #{pack.count} bullets"]/)
|> render_click()
assert html =~ "Add Ammo"
assert html =~ "$#{display_currency(120.5)}"
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :clone, ammo_group))
+ assert_patch(index_live, Routes.pack_index_path(conn, :clone, pack))
{:ok, _index_live, html} =
index_live
- |> form("#ammo_group-form")
+ |> form("#pack-form")
|> render_submit()
- |> follow_redirect(conn, Routes.ammo_group_index_path(conn, :index))
+ |> follow_redirect(conn, Routes.pack_index_path(conn, :index))
assert html =~ "Ammo added successfully"
assert html =~ "\n42\n"
assert html =~ "$#{display_currency(120.5)}"
end
- test "checks validity when cloning", %{conn: conn, ammo_group: ammo_group} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "checks validity when cloning", %{conn: conn, pack: pack} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
html =
index_live
- |> element(~s/a[aria-label="Clone ammo group of #{ammo_group.count} bullets"]/)
+ |> element(~s/a[aria-label="Clone ammo group of #{pack.count} bullets"]/)
|> render_click()
assert html =~ "Add Ammo"
assert html =~ "$#{display_currency(120.5)}"
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :clone, ammo_group))
+ assert_patch(index_live, Routes.pack_index_path(conn, :clone, pack))
assert index_live
- |> form("#ammo_group-form")
- |> render_change(ammo_group: @invalid_attrs) =~ "can't be blank"
+ |> form("#pack-form")
+ |> render_change(pack: @invalid_attrs) =~ "can't be blank"
end
- test "clones ammo_group in listing with updates", %{conn: conn, ammo_group: ammo_group} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "clones pack in listing with updates", %{conn: conn, pack: pack} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
html =
index_live
- |> element(~s/a[aria-label="Clone ammo group of #{ammo_group.count} bullets"]/)
+ |> element(~s/a[aria-label="Clone ammo group of #{pack.count} bullets"]/)
|> render_click()
assert html =~ "Add Ammo"
assert html =~ "$#{display_currency(120.5)}"
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :clone, ammo_group))
+ assert_patch(index_live, Routes.pack_index_path(conn, :clone, pack))
assert index_live
- |> form("#ammo_group-form")
- |> render_change(ammo_group: @invalid_attrs) =~ "can't be blank"
+ |> form("#pack-form")
+ |> render_change(pack: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
index_live
- |> form("#ammo_group-form")
- |> render_submit(ammo_group: @create_attrs |> Map.put(:count, 43))
- |> follow_redirect(conn, Routes.ammo_group_index_path(conn, :index))
+ |> form("#pack-form")
+ |> render_submit(pack: @create_attrs |> Map.put(:count, 43))
+ |> follow_redirect(conn, Routes.pack_index_path(conn, :index))
assert html =~ "Ammo added successfully"
assert html =~ "\n43\n"
assert html =~ "$#{display_currency(120.5)}"
end
- test "deletes ammo_group in listing", %{conn: conn, ammo_group: ammo_group} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "deletes pack in listing", %{conn: conn, pack: pack} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
assert index_live
- |> element(~s/a[aria-label="Delete ammo group of #{ammo_group.count} bullets"]/)
+ |> element(~s/a[aria-label="Delete ammo group of #{pack.count} bullets"]/)
|> render_click()
- refute has_element?(index_live, "#ammo_group-#{ammo_group.id}")
+ refute has_element?(index_live, "#pack-#{pack.id}")
end
- test "saves new shot_group", %{conn: conn, ammo_group: ammo_group} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ test "saves new shot_group", %{conn: conn, pack: pack} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index))
assert index_live |> element("a", "Record shots") |> render_click() =~ "Record shots"
- assert_patch(index_live, Routes.ammo_group_index_path(conn, :add_shot_group, ammo_group))
+ assert_patch(index_live, Routes.pack_index_path(conn, :add_shot_group, pack))
assert index_live
|> form("#shot-group-form")
@@ -327,7 +325,7 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
index_live
|> form("#shot-group-form")
|> render_submit(shot_group: @shot_group_create_attrs)
- |> follow_redirect(conn, Routes.ammo_group_index_path(conn, :index))
+ |> follow_redirect(conn, Routes.pack_index_path(conn, :index))
assert html =~ "Shots recorded successfully"
end
@@ -337,19 +335,19 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
end
describe "Index of empty ammo group" do
- setup [:register_and_log_in_user, :create_ammo_group, :create_empty_ammo_group]
+ setup [:register_and_log_in_user, :create_pack, :create_empty_pack]
test "hides empty ammo groups by default", %{
conn: conn,
- empty_ammo_group: ammo_group,
+ empty_pack: pack,
current_user: current_user
} do
- {:ok, show_live, html} = live(conn, Routes.ammo_group_index_path(conn, :index))
+ {:ok, show_live, html} = live(conn, Routes.pack_index_path(conn, :index))
assert html =~ "Show used"
refute html =~ "$#{display_currency(50.00)}"
- percentage = ammo_group |> Ammo.get_percentage_remaining(current_user)
+ percentage = pack |> Ammo.get_percentage_remaining(current_user)
refute html =~ "\n#{"#{percentage}%"}\n"
html =
@@ -358,49 +356,49 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
|> render_click()
assert html =~ "$#{display_currency(50.00)}"
- percentage = ammo_group |> Ammo.get_percentage_remaining(current_user)
+ percentage = pack |> Ammo.get_percentage_remaining(current_user)
assert html =~ "\n#{"#{percentage}%"}\n"
end
end
describe "Show ammo group" do
- setup [:register_and_log_in_user, :create_ammo_group]
+ setup [:register_and_log_in_user, :create_pack]
- test "displays ammo_group", %{conn: conn, ammo_group: ammo_group} do
- {:ok, _show_live, html} = live(conn, Routes.ammo_group_show_path(conn, :show, ammo_group))
- ammo_group = ammo_group |> Repo.preload(:ammo_type)
+ test "displays pack", %{conn: conn, pack: pack} do
+ {:ok, _show_live, html} = live(conn, Routes.pack_show_path(conn, :show, pack))
+ pack = pack |> Repo.preload(:ammo_type)
assert html =~ "Show Ammo"
- assert html =~ ammo_group.ammo_type.name
+ assert html =~ pack.ammo_type.name
end
- test "updates ammo_group within modal", %{conn: conn, ammo_group: ammo_group} do
- {:ok, show_live, _html} = live(conn, Routes.ammo_group_show_path(conn, :show, ammo_group))
+ test "updates pack within modal", %{conn: conn, pack: pack} do
+ {:ok, show_live, _html} = live(conn, Routes.pack_show_path(conn, :show, pack))
assert show_live
- |> element(~s/a[aria-label="Edit ammo group of #{ammo_group.count} bullets"]/)
+ |> element(~s/a[aria-label="Edit ammo group of #{pack.count} bullets"]/)
|> render_click() =~ "Edit Ammo"
- assert_patch(show_live, Routes.ammo_group_show_path(conn, :edit, ammo_group))
+ assert_patch(show_live, Routes.pack_show_path(conn, :edit, pack))
assert show_live
- |> form("#ammo_group-form")
- |> render_change(ammo_group: @invalid_attrs) =~ "can't be blank"
+ |> form("#pack-form")
+ |> render_change(pack: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
show_live
- |> form("#ammo_group-form")
- |> render_submit(ammo_group: @update_attrs)
- |> follow_redirect(conn, Routes.ammo_group_show_path(conn, :show, ammo_group))
+ |> form("#pack-form")
+ |> render_submit(pack: @update_attrs)
+ |> follow_redirect(conn, Routes.pack_show_path(conn, :show, pack))
assert html =~ "Ammo updated successfully"
assert html =~ "some updated notes"
end
- test "saves new shot_group", %{conn: conn, ammo_group: ammo_group} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_show_path(conn, :show, ammo_group))
+ test "saves new shot_group", %{conn: conn, pack: pack} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_show_path(conn, :show, pack))
assert index_live |> element("a", "Record shots") |> render_click() =~ "Record shots"
- assert_patch(index_live, Routes.ammo_group_show_path(conn, :add_shot_group, ammo_group))
+ assert_patch(index_live, Routes.pack_show_path(conn, :add_shot_group, pack))
assert index_live
|> form("#shot-group-form")
@@ -410,18 +408,18 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
index_live
|> form("#shot-group-form")
|> render_submit(shot_group: @shot_group_create_attrs)
- |> follow_redirect(conn, Routes.ammo_group_show_path(conn, :show, ammo_group))
+ |> follow_redirect(conn, Routes.pack_show_path(conn, :show, pack))
assert html =~ "Shots recorded successfully"
end
end
describe "Show ammo group with shot group" do
- setup [:register_and_log_in_user, :create_ammo_group, :create_shot_group]
+ setup [:register_and_log_in_user, :create_pack, :create_shot_group]
test "updates shot_group in listing",
- %{conn: conn, ammo_group: ammo_group, shot_group: shot_group} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_group_show_path(conn, :edit, ammo_group))
+ %{conn: conn, pack: pack, shot_group: shot_group} do
+ {:ok, index_live, _html} = live(conn, Routes.pack_show_path(conn, :edit, pack))
assert index_live
|> element(~s/a[aria-label="Edit shot group of #{shot_group.count} shots"]/)
@@ -429,7 +427,7 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
assert_patch(
index_live,
- Routes.ammo_group_show_path(conn, :edit_shot_group, ammo_group, shot_group)
+ Routes.pack_show_path(conn, :edit_shot_group, pack, shot_group)
)
assert index_live
@@ -440,16 +438,16 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
index_live
|> form("#shot-group-form")
|> render_submit(shot_group: @shot_group_update_attrs)
- |> follow_redirect(conn, Routes.ammo_group_show_path(conn, :show, ammo_group))
+ |> follow_redirect(conn, Routes.pack_show_path(conn, :show, pack))
assert html =~ "Shot records updated successfully"
assert html =~ "some updated notes"
end
test "deletes shot_group in listing",
- %{conn: conn, ammo_group: ammo_group, shot_group: shot_group} do
+ %{conn: conn, pack: pack, shot_group: shot_group} do
{:ok, index_live, _html} =
- live(conn, Routes.ammo_group_show_path(conn, :edit_shot_group, ammo_group, shot_group))
+ live(conn, Routes.pack_show_path(conn, :edit_shot_group, pack, shot_group))
assert index_live
|> element(~s/a[aria-label="Delete shot record of #{shot_group.count} shots"]/)
diff --git a/test/cannery_web/live/ammo_type_live_test.exs b/test/cannery_web/live/ammo_type_live_test.exs
index bd019061..edd89281 100644
--- a/test/cannery_web/live/ammo_type_live_test.exs
+++ b/test/cannery_web/live/ammo_type_live_test.exs
@@ -33,7 +33,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
name: nil,
grains: nil
}
- @ammo_group_attrs %{
+ @pack_attrs %{
notes: "some ammo group",
count: 20
}
@@ -46,18 +46,18 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
[ammo_type: ammo_type_fixture(@create_attrs, current_user)]
end
- defp create_ammo_group(%{ammo_type: ammo_type, current_user: current_user}) do
+ defp create_pack(%{ammo_type: ammo_type, current_user: current_user}) do
container = container_fixture(current_user)
- {1, [ammo_group]} = ammo_group_fixture(@ammo_group_attrs, ammo_type, container, current_user)
- [ammo_group: ammo_group, container: container]
+ {1, [pack]} = pack_fixture(@pack_attrs, ammo_type, container, current_user)
+ [pack: pack, container: container]
end
- defp create_empty_ammo_group(%{ammo_type: ammo_type, current_user: current_user}) do
+ defp create_empty_pack(%{ammo_type: ammo_type, current_user: current_user}) do
container = container_fixture(current_user)
- {1, [ammo_group]} = ammo_group_fixture(@ammo_group_attrs, ammo_type, container, current_user)
- shot_group = shot_group_fixture(@shot_group_attrs, current_user, ammo_group)
- ammo_group = ammo_group |> Repo.reload!()
- [ammo_group: ammo_group, container: container, shot_group: shot_group]
+ {1, [pack]} = pack_fixture(@pack_attrs, ammo_type, container, current_user)
+ shot_group = shot_group_fixture(@shot_group_attrs, current_user, pack)
+ pack = pack |> Repo.reload!()
+ [pack: pack, container: container, shot_group: shot_group]
end
describe "Index" do
@@ -249,10 +249,10 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
end
describe "Index with ammo group" do
- setup [:register_and_log_in_user, :create_ammo_type, :create_ammo_group]
+ setup [:register_and_log_in_user, :create_ammo_type, :create_pack]
test "shows used ammo groups on toggle",
- %{conn: conn, ammo_group: ammo_group, current_user: current_user} do
+ %{conn: conn, pack: pack, current_user: current_user} do
{:ok, index_live, html} = live(conn, Routes.ammo_type_index_path(conn, :index))
assert html =~ "Show used"
@@ -275,7 +275,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
assert html =~ "\n0\n"
assert html =~ "\n1\n"
- shot_group_fixture(%{count: 5}, current_user, ammo_group)
+ shot_group_fixture(%{count: 5}, current_user, pack)
{:ok, index_live, _html} = live(conn, Routes.ammo_type_index_path(conn, :index))
@@ -328,7 +328,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
end
describe "Show ammo type with ammo group" do
- setup [:register_and_log_in_user, :create_ammo_type, :create_ammo_group]
+ setup [:register_and_log_in_user, :create_ammo_type, :create_pack]
test "displays ammo group", %{
conn: conn,
@@ -357,7 +357,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
end
describe "Show ammo type with empty ammo group" do
- setup [:register_and_log_in_user, :create_ammo_type, :create_empty_ammo_group]
+ setup [:register_and_log_in_user, :create_ammo_type, :create_empty_pack]
test "displays empty ammo groups on toggle",
%{conn: conn, ammo_type: ammo_type, container: %{name: container_name}} do
diff --git a/test/cannery_web/live/container_live_test.exs b/test/cannery_web/live/container_live_test.exs
index 67bc487e..bd1c2418 100644
--- a/test/cannery_web/live/container_live_test.exs
+++ b/test/cannery_web/live/container_live_test.exs
@@ -30,7 +30,7 @@ defmodule CanneryWeb.ContainerLiveTest do
name: "some name",
grains: 120
}
- @ammo_group_attrs %{
+ @pack_attrs %{
notes: "some ammo group",
count: 20
}
@@ -40,11 +40,11 @@ defmodule CanneryWeb.ContainerLiveTest do
[container: container]
end
- defp create_ammo_group(%{container: container, current_user: current_user}) do
+ defp create_pack(%{container: container, current_user: current_user}) do
ammo_type = ammo_type_fixture(@ammo_type_attrs, current_user)
- {1, [ammo_group]} = ammo_group_fixture(@ammo_group_attrs, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(@pack_attrs, ammo_type, container, current_user)
- [ammo_type: ammo_type, ammo_group: ammo_group]
+ [ammo_type: ammo_type, pack: pack]
end
describe "Index" do
@@ -246,60 +246,60 @@ defmodule CanneryWeb.ContainerLiveTest do
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
rifle_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_ammo_group]} = ammo_group_fixture(rifle_type, container, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_type, container, current_user)
shotgun_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_type, container, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_type, container, current_user)
pistol_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_ammo_group]} = ammo_group_fixture(pistol_type, container, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
{:ok, index_live, html} = live(conn, Routes.container_show_path(conn, :show, container))
assert html =~ "All"
- assert html =~ rifle_ammo_group.ammo_type.name
- assert html =~ shotgun_ammo_group.ammo_type.name
- assert html =~ pistol_ammo_group.ammo_type.name
+ assert html =~ rifle_pack.ammo_type.name
+ assert html =~ shotgun_pack.ammo_type.name
+ assert html =~ pistol_pack.ammo_type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :rifle})
- assert html =~ rifle_ammo_group.ammo_type.name
- refute html =~ shotgun_ammo_group.ammo_type.name
- refute html =~ pistol_ammo_group.ammo_type.name
+ assert html =~ rifle_pack.ammo_type.name
+ refute html =~ shotgun_pack.ammo_type.name
+ refute html =~ pistol_pack.ammo_type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :shotgun})
- refute html =~ rifle_ammo_group.ammo_type.name
- assert html =~ shotgun_ammo_group.ammo_type.name
- refute html =~ pistol_ammo_group.ammo_type.name
+ refute html =~ rifle_pack.ammo_type.name
+ assert html =~ shotgun_pack.ammo_type.name
+ refute html =~ pistol_pack.ammo_type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :pistol})
- refute html =~ rifle_ammo_group.ammo_type.name
- refute html =~ shotgun_ammo_group.ammo_type.name
- assert html =~ pistol_ammo_group.ammo_type.name
+ refute html =~ rifle_pack.ammo_type.name
+ refute html =~ shotgun_pack.ammo_type.name
+ assert html =~ pistol_pack.ammo_type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :all})
- assert html =~ rifle_ammo_group.ammo_type.name
- assert html =~ shotgun_ammo_group.ammo_type.name
- assert html =~ pistol_ammo_group.ammo_type.name
+ assert html =~ rifle_pack.ammo_type.name
+ assert html =~ shotgun_pack.ammo_type.name
+ assert html =~ pistol_pack.ammo_type.name
end
end
describe "Show with ammo group" do
- setup [:register_and_log_in_user, :create_container, :create_ammo_group]
+ setup [:register_and_log_in_user, :create_container, :create_pack]
test "displays ammo group",
%{conn: conn, ammo_type: %{name: ammo_type_name}, container: container} do
diff --git a/test/cannery_web/live/range_live_test.exs b/test/cannery_web/live/range_live_test.exs
index 7cca4c01..17199153 100644
--- a/test/cannery_web/live/range_live_test.exs
+++ b/test/cannery_web/live/range_live_test.exs
@@ -16,16 +16,16 @@ defmodule CanneryWeb.RangeLiveTest do
container = container_fixture(%{staged: true}, current_user)
ammo_type = ammo_type_fixture(current_user)
- {1, [ammo_group]} = ammo_group_fixture(%{staged: true}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{staged: true}, ammo_type, container, current_user)
shot_group =
%{count: 5, date: ~N[2022-02-13 03:17:00], notes: "some notes"}
- |> shot_group_fixture(current_user, ammo_group)
+ |> shot_group_fixture(current_user, pack)
[
container: container,
ammo_type: ammo_type,
- ammo_group: ammo_group,
+ pack: pack,
shot_group: shot_group
]
end
@@ -43,21 +43,19 @@ defmodule CanneryWeb.RangeLiveTest do
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_ammo_type, container, current_user)
- rifle_shot_group = shot_group_fixture(%{notes: "group_one"}, current_user, rifle_ammo_group)
+ rifle_shot_group = shot_group_fixture(%{notes: "group_one"}, current_user, rifle_pack)
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_ammo_type, container, current_user)
- shotgun_shot_group =
- shot_group_fixture(%{notes: "group_two"}, current_user, shotgun_ammo_group)
+ shotgun_shot_group = shot_group_fixture(%{notes: "group_two"}, current_user, shotgun_pack)
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_ammo_type, container, current_user)
- pistol_shot_group =
- shot_group_fixture(%{notes: "group_three"}, current_user, pistol_ammo_group)
+ pistol_shot_group = shot_group_fixture(%{notes: "group_three"}, current_user, pistol_pack)
{:ok, index_live, html} = live(conn, Routes.range_index_path(conn, :index))
@@ -128,11 +126,11 @@ defmodule CanneryWeb.RangeLiveTest do
assert_patch(index_live, Routes.range_index_path(conn, :index))
end
- test "saves new shot_group", %{conn: conn, ammo_group: ammo_group} do
+ test "saves new shot_group", %{conn: conn, pack: pack} do
{:ok, index_live, _html} = live(conn, Routes.range_index_path(conn, :index))
assert index_live |> element("a", "Record shots") |> render_click() =~ "Record shots"
- assert_patch(index_live, Routes.range_index_path(conn, :add_shot_group, ammo_group))
+ assert_patch(index_live, Routes.range_index_path(conn, :add_shot_group, pack))
assert index_live
|> form("#shot-group-form")
diff --git a/test/support/fixtures.ex b/test/support/fixtures.ex
index 96cfecbf..35332d3e 100644
--- a/test/support/fixtures.ex
+++ b/test/support/fixtures.ex
@@ -10,7 +10,7 @@ defmodule Cannery.Fixtures do
Accounts.User,
ActivityLog.ShotGroup,
Ammo,
- Ammo.AmmoGroup,
+ Ammo.Pack,
Ammo.AmmoType,
Containers,
Containers.Container,
@@ -71,16 +71,16 @@ defmodule Cannery.Fixtures do
@doc """
Generate a ShotGroup
"""
- @spec shot_group_fixture(User.t(), AmmoGroup.t()) :: ShotGroup.t()
- @spec shot_group_fixture(attrs :: map(), User.t(), AmmoGroup.t()) :: ShotGroup.t()
- def shot_group_fixture(attrs \\ %{}, %User{} = user, %AmmoGroup{} = ammo_group) do
+ @spec shot_group_fixture(User.t(), Pack.t()) :: ShotGroup.t()
+ @spec shot_group_fixture(attrs :: map(), User.t(), Pack.t()) :: ShotGroup.t()
+ def shot_group_fixture(attrs \\ %{}, %User{} = user, %Pack{} = pack) do
attrs
|> Enum.into(%{
count: 20,
date: ~N[2022-02-13 03:17:00],
notes: random_string()
})
- |> Cannery.ActivityLog.create_shot_group(user, ammo_group)
+ |> Cannery.ActivityLog.create_shot_group(user, pack)
|> unwrap_ok_tuple()
end
@@ -109,20 +109,20 @@ defmodule Cannery.Fixtures do
end
@doc """
- Generate a AmmoGroup
+ Generate a Pack
"""
- @spec ammo_group_fixture(AmmoType.t(), Container.t(), User.t()) ::
- {count :: non_neg_integer(), [AmmoGroup.t()]}
- @spec ammo_group_fixture(attrs :: map(), AmmoType.t(), Container.t(), User.t()) ::
- {count :: non_neg_integer(), [AmmoGroup.t()]}
- @spec ammo_group_fixture(
+ @spec pack_fixture(AmmoType.t(), Container.t(), User.t()) ::
+ {count :: non_neg_integer(), [Pack.t()]}
+ @spec pack_fixture(attrs :: map(), AmmoType.t(), Container.t(), User.t()) ::
+ {count :: non_neg_integer(), [Pack.t()]}
+ @spec pack_fixture(
attrs :: map(),
multiplier :: non_neg_integer(),
AmmoType.t(),
Container.t(),
User.t()
- ) :: {count :: non_neg_integer(), [AmmoGroup.t()]}
- def ammo_group_fixture(
+ ) :: {count :: non_neg_integer(), [Pack.t()]}
+ def pack_fixture(
attrs \\ %{},
multiplier \\ 1,
%AmmoType{id: ammo_type_id},
@@ -136,7 +136,7 @@ defmodule Cannery.Fixtures do
count: 20,
purchased_on: Date.utc_today()
})
- |> Ammo.create_ammo_groups(multiplier, user)
+ |> Ammo.create_packs(multiplier, user)
|> unwrap_ok_tuple()
end