Compare commits

...

22 Commits

Author SHA1 Message Date
f94ef0a2ca fix range page title
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-05 23:36:25 -04:00
7cdb8af690 update dependencies 2023-06-05 23:32:52 -04:00
52c4ab45d5 fix class filter helper functions
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-05 23:17:43 -04:00
a35f43d6df rename Ammo.get_average_cost and Ammo.get_historical_count 2023-06-05 23:17:43 -04:00
9edeb1e803 improve Ammo.get_grouped_round_count 2023-06-05 23:17:43 -04:00
7e55446b3e improve ActivityLog.list_shot_records 2023-06-05 23:17:43 -04:00
9643e9f46d improve Ammo.get_round_count 2023-06-05 23:17:39 -04:00
8466fcd1f9 improve ActivityLog.get_grouped_used_counts 2023-06-05 23:16:47 -04:00
e713a2e108 improve ActivityLog.get_used_count 2023-06-05 23:16:00 -04:00
a8fa321040 use sr for shot record in sql 2023-06-05 23:16:00 -04:00
f0536f3030 improve Ammo.get_grouped_packs_count 2023-06-05 23:15:57 -04:00
a94d2eebf4 improve Ammo.get_packs_count 2023-06-05 23:06:28 -04:00
cfc56519f5 fix user registration controller 2023-06-04 00:07:31 -04:00
e80c2018be improve Ammo.list_packs 2023-06-04 00:00:51 -04:00
71fdd42d96 improve Ammo.list_types 2023-06-03 20:14:20 -04:00
8e99a57994 improve Containers.list_containers 2023-06-03 20:12:06 -04:00
7c42dd8a3a improve Containers.list_tags 2023-06-03 19:54:51 -04:00
79c97d7502 fix error/404 pages not rendering properly 2023-05-12 22:59:53 -04:00
2e488fa26c fix ammo type sql naming issues 2023-05-12 22:22:46 -04:00
2179bd5d86 fix table component ids 2023-05-12 21:55:59 -04:00
49628cb9bb pattern match on user struct in more cases 2023-05-12 21:48:19 -04:00
8a58d53dc1 fix pack sql naming issues 2023-05-12 21:48:04 -04:00
47 changed files with 4540 additions and 13560 deletions

View File

@ -1,3 +1,9 @@
# v0.9.4
- Code quality fixes
- Fix error/404 pages not rendering properly
- Update dependencies
- Fix Range page title
# v0.9.3
- Update dependencies
- Add pack lot number to search

15935
assets/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,10 @@ config :cannery, CanneryWeb.Endpoint,
url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"],
http: [port: String.to_integer(System.get_env("PORT") || "4000")],
secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I",
render_errors: [view: CanneryWeb.ErrorView, accepts: ~w(html json), layout: false],
render_errors: [
formats: [html: CanneryWeb.ErrorHTML, json: CanneryWeb.ErrorJSON],
layout: false
],
pubsub_server: Cannery.PubSub,
live_view: [signing_salt: "zOLgd3lr"]

View File

@ -8,38 +8,49 @@ defmodule Cannery.ActivityLog do
alias Cannery.{Accounts.User, ActivityLog.ShotRecord, Repo}
alias Ecto.{Multi, Queryable}
@type list_shot_records_option ::
{:search, String.t() | nil}
| {:class, Type.class() | :all | nil}
| {:pack_id, Pack.id() | nil}
@type list_shot_records_options :: [list_shot_records_option()]
@doc """
Returns the list of shot_records.
## Examples
iex> list_shot_records(:all, %User{id: 123})
iex> list_shot_records(%User{id: 123})
[%ShotRecord{}, ...]
iex> list_shot_records("cool", :all, %User{id: 123})
iex> list_shot_records(%User{id: 123}, search: "cool")
[%ShotRecord{notes: "My cool shot record"}, ...]
iex> list_shot_records("cool", :rifle, %User{id: 123})
iex> list_shot_records(%User{id: 123}, search: "cool", class: :rifle)
[%ShotRecord{notes: "Shot some rifle rounds"}, ...]
iex> list_shot_records(%User{id: 123}, pack_id: 456)
[%ShotRecord{pack_id: 456}, ...]
"""
@spec list_shot_records(Type.class() | :all, User.t()) :: [ShotRecord.t()]
@spec list_shot_records(search :: nil | String.t(), Type.class() | :all, User.t()) ::
[ShotRecord.t()]
def list_shot_records(search \\ nil, type, %{id: user_id}) do
from(sg in ShotRecord,
as: :sg,
left_join: ag in Pack,
as: :ag,
on: sg.pack_id == ag.id,
left_join: at in Type,
as: :at,
on: ag.type_id == at.id,
where: sg.user_id == ^user_id,
distinct: sg.id
@spec list_shot_records(User.t()) :: [ShotRecord.t()]
@spec list_shot_records(User.t(), list_shot_records_options()) :: [ShotRecord.t()]
def list_shot_records(%User{id: user_id}, opts \\ []) do
from(sr in ShotRecord,
as: :sr,
left_join: p in Pack,
as: :p,
on: sr.pack_id == p.id,
on: p.user_id == ^user_id,
left_join: t in Type,
as: :t,
on: p.type_id == t.id,
on: t.user_id == ^user_id,
where: sr.user_id == ^user_id,
distinct: sr.id
)
|> list_shot_records_search(search)
|> list_shot_records_filter_type(type)
|> list_shot_records_search(Keyword.get(opts, :search))
|> list_shot_records_class(Keyword.get(opts, :class))
|> list_shot_records_pack_id(Keyword.get(opts, :pack_id))
|> Repo.all()
end
@ -52,45 +63,44 @@ defmodule Cannery.ActivityLog do
query
|> where(
[sg: sg, ag: ag, at: at],
[sr: sr, p: p, t: t],
fragment(
"? @@ websearch_to_tsquery('english', ?)",
sg.search,
sr.search,
^trimmed_search
) or
fragment(
"? @@ websearch_to_tsquery('english', ?)",
ag.search,
p.search,
^trimmed_search
) or
fragment(
"? @@ websearch_to_tsquery('english', ?)",
at.search,
t.search,
^trimmed_search
)
)
|> order_by([sg: sg], {
|> order_by([sr: sr], {
:desc,
fragment(
"ts_rank_cd(?, websearch_to_tsquery('english', ?), 4)",
sg.search,
sr.search,
^trimmed_search
)
})
end
@spec list_shot_records_filter_type(Queryable.t(), Type.class() | :all) ::
Queryable.t()
defp list_shot_records_filter_type(query, :rifle),
do: query |> where([at: at], at.class == :rifle)
@spec list_shot_records_class(Queryable.t(), Type.class() | :all | nil) :: Queryable.t()
defp list_shot_records_class(query, class) when class in [:rifle, :pistol, :shotgun],
do: query |> where([t: t], t.class == ^class)
defp list_shot_records_filter_type(query, :pistol),
do: query |> where([at: at], at.class == :pistol)
defp list_shot_records_class(query, _all), do: query
defp list_shot_records_filter_type(query, :shotgun),
do: query |> where([at: at], at.class == :shotgun)
@spec list_shot_records_pack_id(Queryable.t(), Pack.id() | nil) :: Queryable.t()
defp list_shot_records_pack_id(query, pack_id) when pack_id |> is_binary(),
do: query |> where([sr: sr], sr.pack_id == ^pack_id)
defp list_shot_records_filter_type(query, _all), do: query
defp list_shot_records_pack_id(query, _all), do: query
@doc """
Returns a count of shot records.
@ -104,25 +114,13 @@ defmodule Cannery.ActivityLog do
@spec get_shot_record_count!(User.t()) :: integer()
def get_shot_record_count!(%User{id: user_id}) do
Repo.one(
from sg in ShotRecord,
where: sg.user_id == ^user_id,
select: count(sg.id),
from sr in ShotRecord,
where: sr.user_id == ^user_id,
select: count(sr.id),
distinct: true
) || 0
end
@spec list_shot_records_for_pack(Pack.t(), User.t()) :: [ShotRecord.t()]
def list_shot_records_for_pack(
%Pack{id: pack_id, user_id: user_id},
%User{id: user_id}
) do
Repo.all(
from sg in ShotRecord,
where: sg.pack_id == ^pack_id,
where: sg.user_id == ^user_id
)
end
@doc """
Gets a single shot_record.
@ -140,10 +138,10 @@ defmodule Cannery.ActivityLog do
@spec get_shot_record!(ShotRecord.id(), User.t()) :: ShotRecord.t()
def get_shot_record!(id, %User{id: user_id}) do
Repo.one!(
from sg in ShotRecord,
where: sg.id == ^id,
where: sg.user_id == ^user_id,
order_by: sg.date
from sr in ShotRecord,
where: sr.id == ^id,
where: sr.user_id == ^user_id,
order_by: sr.date
)
end
@ -172,9 +170,9 @@ defmodule Cannery.ActivityLog do
fn _repo, %{create_shot_record: %{pack_id: pack_id, user_id: user_id}} ->
pack =
Repo.one(
from ag in Pack,
where: ag.id == ^pack_id,
where: ag.user_id == ^user_id
from p in Pack,
where: p.id == ^pack_id,
where: p.user_id == ^user_id
)
{:ok, pack}
@ -221,7 +219,7 @@ defmodule Cannery.ActivityLog do
|> Multi.run(
:pack,
fn repo, %{update_shot_record: %{pack_id: pack_id, user_id: user_id}} ->
{:ok, repo.one(from ag in Pack, where: ag.id == ^pack_id and ag.user_id == ^user_id)}
{:ok, repo.one(from p in Pack, where: p.id == ^pack_id and p.user_id == ^user_id)}
end
)
|> Multi.update(
@ -266,7 +264,7 @@ defmodule Cannery.ActivityLog do
|> Multi.run(
:pack,
fn repo, %{delete_shot_record: %{pack_id: pack_id, user_id: user_id}} ->
{:ok, repo.one(from ag in Pack, where: ag.id == ^pack_id and ag.user_id == ^user_id)}
{:ok, repo.one(from p in Pack, where: p.id == ^pack_id and p.user_id == ^user_id)}
end
)
|> Multi.update(
@ -287,36 +285,6 @@ defmodule Cannery.ActivityLog do
end
end
@doc """
Returns the number of shot rounds for a pack
"""
@spec get_used_count(Pack.t(), User.t()) :: non_neg_integer()
def get_used_count(%Pack{id: pack_id} = pack, user) do
[pack]
|> get_used_counts(user)
|> Map.get(pack_id, 0)
end
@doc """
Returns the number of shot rounds for multiple packs
"""
@spec get_used_counts([Pack.t()], User.t()) ::
%{optional(Pack.id()) => non_neg_integer()}
def get_used_counts(packs, %User{id: user_id}) do
pack_ids =
packs
|> Enum.map(fn %{id: pack_id} -> pack_id end)
Repo.all(
from sg in ShotRecord,
where: sg.pack_id in ^pack_ids,
where: sg.user_id == ^user_id,
group_by: sg.pack_id,
select: {sg.pack_id, sum(sg.count)}
)
|> Map.new()
end
@doc """
Returns the last entered shot record date for a pack
"""
@ -337,15 +305,18 @@ defmodule Cannery.ActivityLog do
|> Enum.map(fn %Pack{id: pack_id, user_id: ^user_id} -> pack_id end)
Repo.all(
from sg in ShotRecord,
where: sg.pack_id in ^pack_ids,
where: sg.user_id == ^user_id,
group_by: sg.pack_id,
select: {sg.pack_id, max(sg.date)}
from sr in ShotRecord,
where: sr.pack_id in ^pack_ids,
where: sr.user_id == ^user_id,
group_by: sr.pack_id,
select: {sr.pack_id, max(sr.date)}
)
|> Map.new()
end
@type get_used_count_option :: {:pack_id, Pack.id() | nil} | {:type_id, Type.id() | nil}
@type get_used_count_options :: [get_used_count_option()]
@doc """
Gets the total number of rounds shot for a type
@ -353,45 +324,116 @@ defmodule Cannery.ActivityLog do
## Examples
iex> get_used_count_for_type(123, %User{id: 123})
iex> get_used_count(%User{id: 123}, type_id: 123)
35
iex> get_used_count_for_type(456, %User{id: 123})
** (Ecto.NoResultsError)
iex> get_used_count(%User{id: 123}, pack_id: 456)
50
"""
@spec get_used_count_for_type(Type.t(), User.t()) :: non_neg_integer()
def get_used_count_for_type(%Type{id: type_id} = type, user) do
[type]
|> get_used_count_for_types(user)
|> Map.get(type_id, 0)
@spec get_used_count(User.t(), get_used_count_options()) :: non_neg_integer()
def get_used_count(%User{id: user_id}, opts) do
from(sr in ShotRecord,
as: :sr,
left_join: p in Pack,
on: sr.pack_id == p.id,
on: p.user_id == ^user_id,
as: :p,
where: sr.user_id == ^user_id,
where: not (sr.count |> is_nil()),
select: sum(sr.count),
distinct: true
)
|> get_used_count_type_id(Keyword.get(opts, :type_id))
|> get_used_count_pack_id(Keyword.get(opts, :pack_id))
|> Repo.one() || 0
end
@spec get_used_count_pack_id(Queryable.t(), Pack.id() | nil) :: Queryable.t()
defp get_used_count_pack_id(query, pack_id) when pack_id |> is_binary() do
query |> where([sr: sr], sr.pack_id == ^pack_id)
end
defp get_used_count_pack_id(query, _nil), do: query
@spec get_used_count_type_id(Queryable.t(), Type.id() | nil) :: Queryable.t()
defp get_used_count_type_id(query, type_id) when type_id |> is_binary() do
query |> where([p: p], p.type_id == ^type_id)
end
defp get_used_count_type_id(query, _nil), do: query
@type get_grouped_used_counts_option ::
{:packs, [Pack.t()] | nil}
| {:types, [Type.t()] | nil}
| {:group_by, :type_id | :pack_id}
@type get_grouped_used_counts_options :: [get_grouped_used_counts_option()]
@doc """
Gets the total number of rounds shot for multiple types
Gets the total number of rounds shot for multiple types or packs
## Examples
iex> get_used_count_for_types(123, %User{id: 123})
iex> get_grouped_used_counts(
...> %User{id: 123},
...> group_by: :type_id,
...> types: [%Type{id: 456, user_id: 123}]
...> )
35
"""
@spec get_used_count_for_types([Type.t()], User.t()) ::
%{optional(Type.id()) => non_neg_integer()}
def get_used_count_for_types(types, %User{id: user_id}) do
type_ids =
types
|> Enum.map(fn %Type{id: type_id, user_id: ^user_id} -> type_id end)
iex> get_grouped_used_counts(
...> %User{id: 123},
...> group_by: :pack_id,
...> packs: [%Pack{id: 456, user_id: 123}]
...> )
22
Repo.all(
from ag in Pack,
left_join: sg in ShotRecord,
on: ag.id == sg.pack_id,
where: ag.type_id in ^type_ids,
where: not (sg.count |> is_nil()),
group_by: ag.type_id,
select: {ag.type_id, sum(sg.count)}
"""
@spec get_grouped_used_counts(User.t(), get_grouped_used_counts_options()) ::
%{optional(Type.id() | Pack.id()) => non_neg_integer()}
def get_grouped_used_counts(%User{id: user_id}, opts) do
from(p in Pack,
as: :p,
left_join: sr in ShotRecord,
on: p.id == sr.pack_id,
on: p.user_id == ^user_id,
as: :sr,
where: sr.user_id == ^user_id,
where: not (sr.count |> is_nil())
)
|> get_grouped_used_counts_group_by(Keyword.fetch!(opts, :group_by))
|> get_grouped_used_counts_types(Keyword.get(opts, :types))
|> get_grouped_used_counts_packs(Keyword.get(opts, :packs))
|> Repo.all()
|> Map.new()
end
@spec get_grouped_used_counts_group_by(Queryable.t(), :type_id | :pack_id) :: Queryable.t()
defp get_grouped_used_counts_group_by(query, :type_id) do
query
|> group_by([p: p], p.type_id)
|> select([sr: sr, p: p], {p.type_id, sum(sr.count)})
end
defp get_grouped_used_counts_group_by(query, :pack_id) do
query
|> group_by([sr: sr], sr.pack_id)
|> select([sr: sr], {sr.pack_id, sum(sr.count)})
end
@spec get_grouped_used_counts_types(Queryable.t(), [Type.t()] | nil) :: Queryable.t()
defp get_grouped_used_counts_types(query, types) when types |> is_list() do
type_ids = types |> Enum.map(fn %Type{id: type_id} -> type_id end)
query |> where([p: p], p.type_id in ^type_ids)
end
defp get_grouped_used_counts_types(query, _nil), do: query
@spec get_grouped_used_counts_packs(Queryable.t(), [Pack.t()] | nil) :: Queryable.t()
defp get_grouped_used_counts_packs(query, packs) when packs |> is_list() do
pack_ids = packs |> Enum.map(fn %Pack{id: pack_id} -> pack_id end)
query |> where([p: p], p.id in ^pack_ids)
end
defp get_grouped_used_counts_packs(query, _nil), do: query
end

File diff suppressed because it is too large Load Diff

View File

@ -7,10 +7,13 @@ defmodule Cannery.Containers do
import Ecto.Query, warn: false
alias Cannery.{Accounts.User, Ammo.Pack, Repo}
alias Cannery.Containers.{Container, ContainerTag, Tag}
alias Ecto.Changeset
alias Ecto.{Changeset, Queryable}
@container_preloads [:tags]
@type list_containers_option :: {:search, String.t() | nil}
@type list_containers_options :: [list_containers_option()]
@doc """
Returns the list of containers.
@ -19,30 +22,31 @@ defmodule Cannery.Containers do
iex> list_containers(%User{id: 123})
[%Container{}, ...]
iex> list_containers("cool", %User{id: 123})
iex> list_containers(%User{id: 123}, search: "cool")
[%Container{name: "my cool container"}, ...]
"""
@spec list_containers(User.t()) :: [Container.t()]
@spec list_containers(search :: nil | String.t(), User.t()) :: [Container.t()]
def list_containers(search \\ nil, %User{id: user_id}) do
@spec list_containers(User.t(), list_containers_options()) :: [Container.t()]
def list_containers(%User{id: user_id}, opts \\ []) do
from(c in Container,
as: :c,
left_join: t in assoc(c, :tags),
on: c.user_id == t.user_id,
as: :t,
where: c.user_id == ^user_id,
order_by: c.name,
distinct: c.id,
preload: ^@container_preloads
)
|> list_containers_search(search)
|> list_containers_search(Keyword.get(opts, :search))
|> Repo.all()
end
defp list_containers_search(query, nil), do: query
defp list_containers_search(query, ""), do: query
@spec list_containers_search(Queryable.t(), search :: String.t() | nil) :: Queryable.t()
defp list_containers_search(query, search) when search in ["", nil],
do: query |> order_by([c: c], c.name)
defp list_containers_search(query, search) do
defp list_containers_search(query, search) when search |> is_binary() do
trimmed_search = String.trim(search)
query
@ -203,9 +207,9 @@ defmodule Cannery.Containers do
{:ok, Container.t()} | {:error, Container.changeset()}
def delete_container(%Container{user_id: user_id} = container, %User{id: user_id}) do
Repo.one(
from ag in Pack,
where: ag.container_id == ^container.id,
select: count(ag.id)
from p in Pack,
where: p.container_id == ^container.id,
select: count(p.id)
)
|> case do
0 ->
@ -289,6 +293,9 @@ defmodule Cannery.Containers do
# Container Tags
@type list_tags_option :: {:search, String.t() | nil}
@type list_tags_options :: [list_tags_option()]
@doc """
Returns the list of tags.
@ -297,38 +304,42 @@ defmodule Cannery.Containers do
iex> list_tags(%User{id: 123})
[%Tag{}, ...]
iex> list_tags("cool", %User{id: 123})
iex> list_tags(%User{id: 123}, search: "cool")
[%Tag{name: "my cool tag"}, ...]
"""
@spec list_tags(User.t()) :: [Tag.t()]
@spec list_tags(search :: nil | String.t(), User.t()) :: [Tag.t()]
def list_tags(search \\ nil, user)
@spec list_tags(User.t(), list_tags_options()) :: [Tag.t()]
def list_tags(%User{id: user_id}, opts \\ []) do
from(t in Tag, as: :t, where: t.user_id == ^user_id)
|> list_tags_search(Keyword.get(opts, :search))
|> Repo.all()
end
def list_tags(search, %{id: user_id}) when search |> is_nil() or search == "",
do: Repo.all(from t in Tag, where: t.user_id == ^user_id, order_by: t.name)
@spec list_tags_search(Queryable.t(), search :: String.t() | nil) :: Queryable.t()
defp list_tags_search(query, search) when search in ["", nil],
do: query |> order_by([t: t], t.name)
def list_tags(search, %{id: user_id}) when search |> is_binary() do
defp list_tags_search(query, search) when search |> is_binary() do
trimmed_search = String.trim(search)
Repo.all(
from t in Tag,
where: t.user_id == ^user_id,
where:
fragment(
"? @@ websearch_to_tsquery('english', ?)",
t.search,
^trimmed_search
),
order_by: {
:desc,
fragment(
"ts_rank_cd(?, websearch_to_tsquery('english', ?), 4)",
t.search,
^trimmed_search
)
}
query
|> where(
[t: t],
fragment(
"? @@ websearch_to_tsquery('english', ?)",
t.search,
^trimmed_search
)
)
|> order_by([t: t], {
:desc,
fragment(
"ts_rank_cd(?, websearch_to_tsquery('english', ?), 4)",
t.search,
^trimmed_search
)
})
end
@doc """

View File

@ -71,8 +71,10 @@ defmodule CanneryWeb.Components.ContainerTableComponent do
current_user: current_user,
tag_actions: tag_actions,
actions: actions,
pack_count: Ammo.get_packs_count_for_containers(containers, current_user),
round_count: Ammo.get_round_count_for_containers(containers, current_user)
pack_count:
Ammo.get_grouped_packs_count(current_user, containers: containers, group_by: :container_id),
round_count:
Ammo.get_grouped_round_count(current_user, containers: containers, group_by: :container_id)
}
rows =

View File

@ -27,15 +27,15 @@
<%= @container.location %>
</span>
<%= if @container |> Ammo.get_packs_count_for_container!(@current_user) != 0 do %>
<%= if Ammo.get_packs_count(@current_user, container_id: @container.id) != 0 do %>
<span class="rounded-lg title text-lg">
<%= gettext("Packs:") %>
<%= @container |> Ammo.get_packs_count_for_container!(@current_user) %>
<%= Ammo.get_packs_count(@current_user, container_id: @container.id) %>
</span>
<span class="rounded-lg title text-lg">
<%= gettext("Rounds:") %>
<%= @container |> Ammo.get_round_count_for_container!(@current_user) %>
<%= Ammo.get_round_count(@current_user, container_id: @container.id) %>
</span>
<% end %>

View File

@ -89,7 +89,7 @@ defmodule CanneryWeb.Components.MovePackComponent do
<% else %>
<.live_component
module={CanneryWeb.Components.TableComponent}
id="move_pack_table"
id="move-pack-table"
columns={@columns}
rows={@rows}
/>

View File

@ -141,7 +141,12 @@ defmodule CanneryWeb.Components.PackTableComponent do
def render(assigns) do
~H"""
<div id={@id} class="w-full">
<.live_component module={TableComponent} id={"table-#{@id}"} columns={@columns} rows={@rows} />
<.live_component
module={TableComponent}
id={"pack-table-#{@id}"}
columns={@columns}
rows={@rows}
/>
</div>
"""
end

View File

@ -74,7 +74,7 @@ defmodule CanneryWeb.Components.ShotRecordTableComponent do
<div id={@id} class="w-full">
<.live_component
module={CanneryWeb.Components.TableComponent}
id={"table-#{@id}"}
id={"shot-record-table-#{@id}"}
columns={@columns}
rows={@rows}
initial_key={:date}

View File

@ -151,17 +151,25 @@ defmodule CanneryWeb.Components.TypeTableComponent do
)
|> TableComponent.maybe_compose_columns(%{label: gettext("Name"), key: :name, type: :name})
round_counts = types |> Ammo.get_round_count_for_types(current_user)
packs_count = types |> Ammo.get_packs_count_for_types(current_user)
average_costs = types |> Ammo.get_average_cost_for_types(current_user)
round_counts = Ammo.get_grouped_round_count(current_user, types: types, group_by: :type_id)
packs_count = Ammo.get_grouped_packs_count(current_user, types: types, group_by: :type_id)
average_costs = Ammo.get_average_costs(types, current_user)
[used_counts, historical_round_counts, historical_pack_counts, used_pack_counts] =
if show_used do
[
types |> ActivityLog.get_used_count_for_types(current_user),
types |> Ammo.get_historical_count_for_types(current_user),
types |> Ammo.get_packs_count_for_types(current_user, true),
types |> Ammo.get_used_packs_count_for_types(current_user)
ActivityLog.get_grouped_used_counts(current_user, types: types, group_by: :type_id),
Ammo.get_historical_counts(types, current_user),
Ammo.get_grouped_packs_count(current_user,
types: types,
group_by: :type_id,
show_used: true
),
Ammo.get_grouped_packs_count(current_user,
types: types,
group_by: :type_id,
show_used: :only_used
)
]
else
[nil, nil, nil, nil]
@ -192,7 +200,12 @@ defmodule CanneryWeb.Components.TypeTableComponent do
def render(assigns) do
~H"""
<div id={@id} class="w-full">
<.live_component module={TableComponent} id={"table-#{@id}"} columns={@columns} rows={@rows} />
<.live_component
module={TableComponent}
id={"type-table-#{@id}"}
columns={@columns}
rows={@rows}
/>
</div>
"""
end

View File

@ -3,14 +3,18 @@ defmodule CanneryWeb.ExportController do
alias Cannery.{ActivityLog, Ammo, Containers}
def export(%{assigns: %{current_user: current_user}} = conn, %{"mode" => "json"}) do
types = Ammo.list_types(current_user, :all)
used_counts = types |> ActivityLog.get_used_count_for_types(current_user)
round_counts = types |> Ammo.get_round_count_for_types(current_user)
pack_counts = types |> Ammo.get_packs_count_for_types(current_user)
types = Ammo.list_types(current_user)
total_pack_counts = types |> Ammo.get_packs_count_for_types(current_user, true)
used_counts =
ActivityLog.get_grouped_used_counts(current_user, types: types, group_by: :type_id)
average_costs = types |> Ammo.get_average_cost_for_types(current_user)
round_counts = Ammo.get_grouped_round_count(current_user, types: types, group_by: :type_id)
pack_counts = Ammo.get_grouped_packs_count(current_user, types: types, group_by: :type_id)
total_pack_counts =
Ammo.get_grouped_packs_count(current_user, types: types, group_by: :type_id, show_used: true)
average_costs = Ammo.get_average_costs(types, current_user)
types =
types
@ -27,8 +31,11 @@ defmodule CanneryWeb.ExportController do
})
end)
packs = Ammo.list_packs(nil, :all, current_user, true)
used_counts = packs |> ActivityLog.get_used_counts(current_user)
packs = Ammo.list_packs(current_user, show_used: true)
used_counts =
ActivityLog.get_grouped_used_counts(current_user, packs: packs, group_by: :pack_id)
original_counts = packs |> Ammo.get_original_counts(current_user)
cprs = packs |> Ammo.get_cprs(current_user)
percentages_remaining = packs |> Ammo.get_percentages_remaining(current_user)
@ -47,20 +54,17 @@ defmodule CanneryWeb.ExportController do
})
end)
shot_records = ActivityLog.list_shot_records(:all, current_user)
shot_records = ActivityLog.list_shot_records(current_user)
containers =
Containers.list_containers(current_user)
|> Enum.map(fn container ->
pack_count = container |> Ammo.get_packs_count_for_container!(current_user)
round_count = container |> Ammo.get_round_count_for_container!(current_user)
container
|> Jason.encode!()
|> Jason.decode!()
|> Map.merge(%{
"pack_count" => pack_count,
"round_count" => round_count
"pack_count" => Ammo.get_packs_count(current_user, container_id: container.id),
"round_count" => Ammo.get_round_count(current_user, container_id: container.id)
})
end)

View File

@ -71,7 +71,7 @@ defmodule CanneryWeb.UserRegistrationController do
|> redirect(to: ~p"/")
{:error, %Changeset{} = changeset} ->
conn |> render("new.html", changeset: changeset, invite_token: invite_token)
conn |> render(:new, changeset: changeset, invite_token: invite_token)
end
end
end

View File

@ -113,6 +113,6 @@ defmodule CanneryWeb.ContainerLive.Index do
end
defp display_containers(%{assigns: %{search: search, current_user: current_user}} = socket) do
socket |> assign(:containers, Containers.list_containers(search, current_user))
socket |> assign(:containers, Containers.list_containers(current_user, search: search))
end
end

View File

@ -51,7 +51,7 @@
<%= if @view_table do %>
<.live_component
module={CanneryWeb.Components.ContainerTableComponent}
id="containers_index_table"
id="containers-index-table"
action={@live_action}
containers={@containers}
current_user={@current_user}

View File

@ -104,8 +104,10 @@ defmodule CanneryWeb.ContainerLive.Show do
id,
current_user
) do
%{name: container_name} = container = Containers.get_container!(id, current_user)
packs = Ammo.list_packs_for_container(container, class, current_user)
%{id: container_id, name: container_name} =
container = Containers.get_container!(id, current_user)
packs = Ammo.list_packs(current_user, container_id: container_id, class: class)
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)
@ -120,8 +122,8 @@ defmodule CanneryWeb.ContainerLive.Show do
socket
|> assign(
container: container,
round_count: Ammo.get_round_count_for_container!(container, current_user),
packs_count: Ammo.get_packs_count_for_container!(container, current_user),
round_count: Ammo.get_round_count(current_user, container_id: container.id),
packs_count: Ammo.get_packs_count(current_user, container_id: container.id),
packs: packs,
original_counts: original_counts,
cprs: cprs,

View File

@ -120,7 +120,7 @@
<%= if @view_table do %>
<.live_component
module={CanneryWeb.Components.PackTableComponent}
id="type-show-table"
id="pack-show-table"
packs={@packs}
current_user={@current_user}
show_used={false}

View File

@ -26,7 +26,7 @@ defmodule CanneryWeb.PackLive.FormComponent do
socket =
socket
|> assign(:pack_create_limit, @pack_create_limit)
|> assign(:types, Ammo.list_types(current_user, :all))
|> assign(:types, Ammo.list_types(current_user))
|> assign_new(:containers, fn -> Containers.list_containers(current_user) end)
params =

View File

@ -148,8 +148,8 @@ defmodule CanneryWeb.PackLive.Index do
) do
# get total number of packs to determine whether to display onboarding
# prompts
packs_count = Ammo.get_packs_count!(current_user, true)
packs = Ammo.list_packs(search, class, current_user, show_used)
packs_count = Ammo.get_packs_count(current_user, show_used: true)
packs = Ammo.list_packs(current_user, search: search, class: class, show_used: show_used)
types_count = Ammo.get_types_count!(current_user)
containers_count = Containers.get_containers_count!(current_user)

View File

@ -92,7 +92,7 @@ defmodule CanneryWeb.PackLive.Show do
%{label: gettext("Actions"), key: :actions, sortable: false}
]
shot_records = ActivityLog.list_shot_records_for_pack(pack, current_user)
shot_records = ActivityLog.list_shot_records(current_user, pack_id: pack.id)
rows =
shot_records

View File

@ -115,7 +115,7 @@
<.live_component
module={CanneryWeb.Components.TableComponent}
id="pack_shot_records_table"
id="pack-shot-records-table"
columns={@columns}
rows={@rows}
/>

View File

@ -44,7 +44,7 @@ defmodule CanneryWeb.RangeLive.Index do
defp apply_action(socket, :new, _params) do
socket
|> assign(
page_title: gettext("New Shot Records"),
page_title: gettext("Record Shots"),
shot_record: %ShotRecord{}
)
end
@ -52,7 +52,7 @@ defmodule CanneryWeb.RangeLive.Index do
defp apply_action(socket, :index, _params) do
socket
|> assign(
page_title: gettext("Shot Records"),
page_title: gettext("Range"),
search: nil,
shot_record: nil
)
@ -62,7 +62,7 @@ defmodule CanneryWeb.RangeLive.Index do
defp apply_action(socket, :search, %{"search" => search}) do
socket
|> assign(
page_title: gettext("Shot Records"),
page_title: gettext("Range"),
search: search,
shot_record: nil
)
@ -120,8 +120,8 @@ defmodule CanneryWeb.RangeLive.Index do
defp display_shot_records(
%{assigns: %{class: class, search: search, current_user: current_user}} = socket
) do
shot_records = ActivityLog.list_shot_records(search, class, current_user)
packs = Ammo.list_staged_packs(current_user)
shot_records = ActivityLog.list_shot_records(current_user, search: search, class: class)
packs = Ammo.list_packs(current_user, staged: true)
chart_data = shot_records |> get_chart_data_for_shot_record()
original_counts = packs |> Ammo.get_original_counts(current_user)
cprs = packs |> Ammo.get_cprs(current_user)

View File

@ -122,7 +122,7 @@
<% else %>
<.live_component
module={CanneryWeb.Components.ShotRecordTableComponent}
id="shot_records_index_table"
id="shot-records-index-table"
shot_records={@shot_records}
current_user={@current_user}
>

View File

@ -75,6 +75,6 @@ defmodule CanneryWeb.TagLive.Index do
end
defp display_tags(%{assigns: %{search: search, current_user: current_user}} = socket) do
socket |> assign(tags: Containers.list_tags(search, current_user))
socket |> assign(tags: Containers.list_tags(current_user, search: search))
end
end

View File

@ -106,7 +106,7 @@ defmodule CanneryWeb.TypeLive.Index do
) do
socket
|> assign(
types: Ammo.list_types(search, current_user, class),
types: Ammo.list_types(current_user, class: class, search: search),
types_count: Ammo.get_types_count!(current_user)
)
end

View File

@ -74,7 +74,7 @@
<% else %>
<.live_component
module={CanneryWeb.Components.TypeTableComponent}
id="types_index_table"
id="types-index-table"
action={@live_action}
types={@types}
current_user={@current_user}

View File

@ -40,7 +40,7 @@ defmodule CanneryWeb.TypeLive.Show do
defp display_type(
%{assigns: %{live_action: live_action, current_user: current_user, show_used: show_used}} =
socket,
%Type{name: type_name} = type
%Type{id: type_id, name: type_name} = type
) do
custom_fields? =
fields_to_display(type)
@ -54,7 +54,7 @@ defmodule CanneryWeb.TypeLive.Show do
type |> Map.get(field) != default_value
end)
packs = type |> Ammo.list_packs_for_type(current_user, show_used)
packs = Ammo.list_packs(current_user, type_id: type_id, show_used: show_used)
[
original_counts,
@ -66,10 +66,10 @@ defmodule CanneryWeb.TypeLive.Show do
if show_used do
[
packs |> Ammo.get_original_counts(current_user),
type |> Ammo.get_used_packs_count_for_type(current_user),
type |> Ammo.get_packs_count_for_type(current_user, true),
type |> ActivityLog.get_used_count_for_type(current_user),
type |> Ammo.get_historical_count_for_type(current_user)
Ammo.get_packs_count(current_user, type_id: type.id, show_used: :only_used),
Ammo.get_packs_count(current_user, type_id: type.id, show_used: true),
ActivityLog.get_used_count(current_user, type_id: type.id),
Ammo.get_historical_count(type, current_user)
]
else
[nil, nil, nil, nil, nil]
@ -94,12 +94,12 @@ defmodule CanneryWeb.TypeLive.Show do
containers: containers,
cprs: packs |> Ammo.get_cprs(current_user),
last_used_dates: packs |> ActivityLog.get_last_used_dates(current_user),
avg_cost_per_round: type |> Ammo.get_average_cost_for_type(current_user),
rounds: type |> Ammo.get_round_count_for_type(current_user),
avg_cost_per_round: Ammo.get_average_cost(type, current_user),
rounds: Ammo.get_round_count(current_user, type_id: type.id),
original_counts: original_counts,
used_rounds: used_rounds,
historical_round_count: historical_round_count,
packs_count: type |> Ammo.get_packs_count_for_type(current_user),
packs_count: Ammo.get_packs_count(current_user, type_id: type.id),
used_packs_count: used_packs_count,
historical_packs_count: historical_packs_count,
fields_to_display: fields_to_display(type),

View File

@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
def project do
[
app: :cannery,
version: "0.9.3",
version: "0.9.4",
elixir: "1.14.4",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,

View File

@ -1,54 +1,54 @@
%{
"bcrypt_elixir": {:hex, :bcrypt_elixir, "3.0.1", "9be815469e6bfefec40fa74658ecbbe6897acfb57614df1416eeccd4903f602c", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "486bb95efb645d1efc6794c1ddd776a186a9a713abf06f45708a6ce324fb96cf"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"castore": {:hex, :castore, "1.0.1", "240b9edb4e9e94f8f56ab39d8d2d0a57f49e46c56aced8f873892df8ff64ff5a", [:mix], [], "hexpm", "b4951de93c224d44fac71614beabd88b71932d0b1dea80d2f80fb9044e01bbb3"},
"castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"},
"comeonin": {:hex, :comeonin, "5.3.3", "2c564dac95a35650e9b6acfe6d2952083d8a08e4a89b93a481acb552b325892e", [:mix], [], "hexpm", "3e38c9c2cb080828116597ca8807bb482618a315bfafd98c90bc22a821cc84df"},
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
"cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
"db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"},
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
"earmark_parser": {:hex, :earmark_parser, "1.4.31", "a93921cdc6b9b869f519213d5bc79d9e218ba768d7270d46fdcf1c01bacff9e2", [:mix], [], "hexpm", "317d367ee0335ef037a87e46c91a2269fef6306413f731e8ec11fc45a7efd059"},
"earmark_parser": {:hex, :earmark_parser, "1.4.32", "fa739a0ecfa34493de19426681b23f6814573faee95dfd4b4aafe15a7b5b32c6", [:mix], [], "hexpm", "b8b0dd77d60373e77a3d7e8afa598f325e49e8663a51bcc2b88ef41838cca755"},
"ecto": {:hex, :ecto, "3.10.1", "c6757101880e90acc6125b095853176a02da8f1afe056f91f1f90b80c9389822", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2ac4255f1601bdf7ac74c0ed971102c6829dc158719b94bd30041bbad77f87a"},
"ecto_psql_extras": {:hex, :ecto_psql_extras, "0.7.10", "e14d400930f401ca9f541b3349212634e44027d7f919bbb71224d7ac0d0e8acd", [:mix], [{:ecto_sql, "~> 3.4", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.15.7 or ~> 0.16.0", [hex: :postgrex, repo: "hexpm", optional: false]}, {:table_rex, "~> 3.1.1", [hex: :table_rex, repo: "hexpm", optional: false]}], "hexpm", "505e8cd81e4f17c090be0f99e92b1b3f0fd915f98e76965130b8ccfb891e7088"},
"ecto_psql_extras": {:hex, :ecto_psql_extras, "0.7.11", "6e20144c1446dcccfcdb4c142c9d8b7992a90a569b1d5958cbea5458550b25f0", [:mix], [{:ecto_sql, "~> 3.4", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.15.7 or ~> 0.16.0 or ~> 0.17.0", [hex: :postgrex, repo: "hexpm", optional: false]}, {:table_rex, "~> 3.1.1", [hex: :table_rex, repo: "hexpm", optional: false]}], "hexpm", "def61f1f92d4f40d51c80bbae2157212d6c0a459eb604be446e47369cbd40b23"},
"ecto_sql": {:hex, :ecto_sql, "3.10.1", "6ea6b3036a0b0ca94c2a02613fd9f742614b5cfe494c41af2e6571bb034dd94c", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f6a25bdbbd695f12c8171eaff0851fa4c8e72eec1e98c7364402dda9ce11c56b"},
"elixir_make": {:hex, :elixir_make, "0.7.6", "67716309dc5d43e16b5abbd00c01b8df6a0c2ab54a8f595468035a50189f9169", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5a0569756b0f7873a77687800c164cca6dfc03a09418e6fcf853d78991f49940"},
"elixir_make": {:hex, :elixir_make, "0.7.7", "7128c60c2476019ed978210c245badf08b03dbec4f24d05790ef791da11aa17c", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5bc19fff950fad52bbe5f211b12db9ec82c6b34a9647da0c2224b8b8464c7e6c"},
"eqrcode": {:hex, :eqrcode, "0.1.10", "6294fece9d68ad64eef1c3c92cf111cfd6469f4fbf230a2d4cc905a682178f3f", [:mix], [], "hexpm", "da30e373c36a0fd37ab6f58664b16029919896d6c45a68a95cc4d713e81076f1"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"},
"expo": {:hex, :expo, "0.4.1", "1c61d18a5df197dfda38861673d392e642649a9cef7694d2f97a587b2cfb319b", [:mix], [], "hexpm", "2ff7ba7a798c8c543c12550fa0e2cbc81b95d4974c65855d8d15ba7b37a1ce47"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"floki": {:hex, :floki, "0.34.2", "5fad07ef153b3b8ec110b6b155ec3780c4b2c4906297d0b4be1a7162d04a7e02", [:mix], [], "hexpm", "26b9d50f0f01796bc6be611ca815c5e0de034d2128e39cc9702eee6b66a4d1c8"},
"floki": {:hex, :floki, "0.34.3", "5e2dcaec5d7c228ce5b1d3501502e308b2d79eb655e4191751a1fe491c37feac", [:mix], [], "hexpm", "9577440eea5b97924b4bf3c7ea55f7b8b6dce589f9b28b096cc294a8dc342341"},
"gen_smtp": {:hex, :gen_smtp, "1.2.0", "9cfc75c72a8821588b9b9fe947ae5ab2aed95a052b81237e0928633a13276fd3", [:rebar3], [{:ranch, ">= 1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "5ee0375680bca8f20c4d85f58c2894441443a743355430ff33a783fe03296779"},
"gettext": {:hex, :gettext, "0.22.1", "e7942988383c3d9eed4bdc22fc63e712b655ae94a672a27e4900e3d4a2c43581", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "ad105b8dab668ee3f90c0d3d94ba75e9aead27a62495c101d94f2657a190ac5d"},
"gettext": {:hex, :gettext, "0.22.2", "6bfca374de34ecc913a28ba391ca184d88d77810a3e427afa8454a71a51341ac", [:mix], [{:expo, "~> 0.4.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "8a2d389673aea82d7eae387e6a2ccc12660610080ae7beb19452cfdc1ec30f60"},
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"mime": {:hex, :mime, "2.0.3", "3676436d3d1f7b81b5a2d2bd8405f412c677558c81b1c92be58c00562bb59095", [:mix], [], "hexpm", "27a30bf0db44d25eecba73755acf4068cbfe26a4372f9eb3e4ea3a45956bff6b"},
"nimble_parsec": {:hex, :nimble_parsec, "1.3.0", "9e18a119d9efc3370a3ef2a937bf0b24c088d9c4bf0ba9d7c3751d49d347d035", [:mix], [], "hexpm", "7977f183127a7cbe9346981e2f480dc04c55ffddaef746bd58debd566070eef8"},
"oban": {:hex, :oban, "2.15.0", "27b9c2845cdff30c98c8060b11a64318e79bbc1bd32b8dc95fa59a1580a8d90c", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "22e181c540335d1dd5c995be00435927075519207d62b3de32477d95dbf9dfd3"},
"phoenix": {:hex, :phoenix, "1.7.2", "c375ffb482beb4e3d20894f84dd7920442884f5f5b70b9f4528cbe0cedefec63", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.4", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "1ebca94b32b4d0e097ab2444a9742ed8ff3361acad17365e4e6b2e79b4792159"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"},
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
"nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"},
"oban": {:hex, :oban, "2.15.1", "d49803174a4b564b1c90d107363d55a59e9e48aeb472ea364ea45d22a5c56997", [:mix], [{:ecto_sql, "~> 3.6", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, "~> 0.9", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "60be616498db864a8fdd5e013b92f95d2a1d28a3f387c82bf05b35cdcb2af3e1"},
"phoenix": {:hex, :phoenix, "1.7.3", "4d8eca2c020c9ed81a28e7a8c60e0a4f6f9f7f6e12eb91dfd01301eac07424c1", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.4", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "6b1bc308758f95ecf3e0d795389440a2ca88a903e0fda1f921c780918c16d640"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.2", "b21bd01fdeffcfe2fab49e4942aa938b6d3e89e93a480d4aee58085560a0bc0d", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "70242edd4601d50b69273b057ecf7b684644c19ee750989fd555625ae4ce8f5d"},
"phoenix_html": {:hex, :phoenix_html, "3.3.1", "4788757e804a30baac6b3fc9695bf5562465dd3f1da8eb8460ad5b404d9a2178", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "bed1906edd4906a15fd7b412b85b05e521e1f67c9a85418c55999277e553d0d3"},
"phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.7.2", "97cc4ff2dba1ebe504db72cb45098cb8e91f11160528b980bd282cc45c73b29c", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.5", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.18.3", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "0e5fdf063c7a3b620c566a30fcf68b7ee02e5e46fe48ee46a6ec3ba382dc05b7"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.18.18", "1f38fbd7c363723f19aad1a04b5490ff3a178e37daaf6999594d5f34796c47fc", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a5810d0472f3189ede6d2a95bda7f31c6113156b91784a3426cb0ab6a6d85214"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.2", "a4950b63ace57720b0fc1c6da083c53346b36f99021de89595cc4f026288ff51", [:mix], [], "hexpm", "45741676a94c71f9afdfed9d22d49b6856c026ff504db04e3dc03a1d86f8201c"},
"phoenix_template": {:hex, :phoenix_template, "1.0.1", "85f79e3ad1b0180abb43f9725973e3b8c2c3354a87245f91431eec60553ed3ef", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "157dc078f6226334c91cb32c1865bf3911686f8bcd6bcff86736f6253e6993ee"},
"plug": {:hex, :plug, "1.14.2", "cff7d4ec45b4ae176a227acd94a7ab536d9b37b942c8e8fa6dfc0fff98ff4d80", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "842fc50187e13cf4ac3b253d47d9474ed6c296a8732752835ce4a86acdf68d13"},
"plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"},
"plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"},
"postgrex": {:hex, :postgrex, "0.16.5", "fcc4035cc90e23933c5d69a9cd686e329469446ef7abba2cf70f08e2c4b69810", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "edead639dc6e882618c01d8fc891214c481ab9a3788dfe38dd5e37fd1d5fb2e8"},
"postgrex": {:hex, :postgrex, "0.17.1", "01c29fd1205940ee55f7addb8f1dc25618ca63a8817e56fac4f6846fc2cddcbe", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "14b057b488e73be2beee508fb1955d8db90d6485c6466428fe9ccf1d6692a555"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"swoosh": {:hex, :swoosh, "1.9.1", "0a5d7bf9954eb41d7e55525bc0940379982b090abbaef67cd8e1fd2ed7f8ca1a", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "76dffff3ffcab80f249d5937a592eaef7cc49ac6f4cdd27e622868326ed6371e"},
"swoosh": {:hex, :swoosh, "1.11.0", "00b4fff8c08347a47cc5cbe67d64df5aae0607a7a51171944f5b89216e2d62f5", [:mix], [{:cowboy, "~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:ex_aws, "~> 2.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:finch, "~> 0.6", [hex: :finch, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13 or ~> 1.0", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5e7c49b6259e50a5ed756517e23a7f916c0b73eb0752e864b1d83b28e2c204d9"},
"table_rex": {:hex, :table_rex, "3.1.1", "0c67164d1714b5e806d5067c1e96ff098ba7ae79413cc075973e17c38a587caa", [:mix], [], "hexpm", "678a23aba4d670419c23c17790f9dcd635a4a89022040df7d5d772cb21012490"},
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
"telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"},
"telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"},
"websock": {:hex, :websock, "0.5.0", "f6bbce90226121d62a0715bca7c986c5e43de0ccc9475d79c55381d1796368cc", [:mix], [], "hexpm", "b51ac706df8a7a48a2c622ee02d09d68be8c40418698ffa909d73ae207eb5fb8"},
"websock_adapter": {:hex, :websock_adapter, "0.5.0", "cea35d8bbf1a6964e32d4b02ceb561dfb769c04f16d60d743885587e7d2ca55b", [:mix], [{:bandit, "~> 0.6", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "16318b124effab8209b1eb7906c636374f623dc9511a8278ad09c083cea5bb83"},
"websock": {:hex, :websock, "0.5.1", "c496036ce95bc26d08ba086b2a827b212c67e7cabaa1c06473cd26b40ed8cf10", [:mix], [], "hexpm", "b9f785108b81cd457b06e5f5dabe5f65453d86a99118b2c0a515e1e296dc2d2c"},
"websock_adapter": {:hex, :websock_adapter, "0.5.1", "292e6c56724e3457e808e525af0e9bcfa088cc7b9c798218e78658c7f9b85066", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "8e2e1544bfde5f9d0442f9cec2f5235398b224f75c9e06b60557debf64248ec1"},
}

View File

@ -426,6 +426,8 @@ msgstr "Keine Tags für diesen Behälter"
#: lib/cannery_web/components/core_components/topbar.html.heex:48
#: lib/cannery_web/components/pack_table_component.ex:80
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Range"
msgstr "Schießplatz"
@ -459,11 +461,6 @@ msgstr "Keine Munition selektiert"
msgid "Record shots"
msgstr "Schüsse dokumentieren"
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "New Shot Records"
msgstr "Neue Schießkladde"
#: lib/cannery_web/live/range_live/index.html.heex:52
#: lib/cannery_web/live/range_live/index.html.heex:119
#, elixir-autogen, elixir-format
@ -477,12 +474,6 @@ msgstr "Keine Schüsse dokumentiert"
msgid "Rounds shot"
msgstr "Patronen abgefeuert"
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Shot Records"
msgstr "Schießkladde"
#: lib/cannery_web/live/pack_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -500,9 +491,9 @@ msgstr "Schießkladde"
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:273
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -574,13 +565,13 @@ msgid "Reconnecting..."
msgstr "Neu verbinden..."
#: lib/cannery_web/live/container_live/index.ex:28
#: lib/cannery_web/live/container_live/show.ex:116
#: lib/cannery_web/live/container_live/show.ex:118
#, elixir-autogen, elixir-format
msgid "Edit %{name}"
msgstr "%{name} bearbeiten"
#: lib/cannery_web/live/container_live/index.ex:63
#: lib/cannery_web/live/container_live/show.ex:117
#: lib/cannery_web/live/container_live/show.ex:119
#, elixir-autogen, elixir-format
msgid "Edit %{name} tags"
msgstr "Editiere %{name} Tags"
@ -592,9 +583,9 @@ msgstr "Editiere %{name} Tags"
msgid "Rounds:"
msgstr "Patronen:"
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:272
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -657,6 +648,7 @@ msgstr "Passwort zurücksetzen"
#: lib/cannery_web/live/pack_live/show.ex:40
#: lib/cannery_web/live/range_live/index.ex:31
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "Record Shots"
msgstr "Schüsse dokumentieren"
@ -780,7 +772,7 @@ msgstr "Behälter"
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -957,7 +949,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -997,7 +989,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -23,7 +23,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/cannery/containers.ex:220
#: lib/cannery/containers.ex:224
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr "Behälter muss vor dem Löschen leer sein"
@ -170,7 +170,7 @@ msgstr ""
"Ungültige Nummer an Kopien. Muss zwischen 1 and %{max} liegen. War "
"%{multiplier}"
#: lib/cannery/ammo.ex:1121
#: lib/cannery/ammo.ex:974
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""

View File

@ -420,6 +420,8 @@ msgstr ""
#: lib/cannery_web/components/core_components/topbar.html.heex:48
#: lib/cannery_web/components/pack_table_component.ex:80
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Range"
msgstr ""
@ -453,11 +455,6 @@ msgstr ""
msgid "Record shots"
msgstr ""
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "New Shot Records"
msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:52
#: lib/cannery_web/live/range_live/index.html.heex:119
#, elixir-autogen, elixir-format
@ -471,12 +468,6 @@ msgstr ""
msgid "Rounds shot"
msgstr ""
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Shot Records"
msgstr ""
#: lib/cannery_web/live/pack_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -494,9 +485,9 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:273
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -568,13 +559,13 @@ msgid "Reconnecting..."
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:28
#: lib/cannery_web/live/container_live/show.ex:116
#: lib/cannery_web/live/container_live/show.ex:118
#, elixir-autogen, elixir-format
msgid "Edit %{name}"
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:63
#: lib/cannery_web/live/container_live/show.ex:117
#: lib/cannery_web/live/container_live/show.ex:119
#, elixir-autogen, elixir-format
msgid "Edit %{name} tags"
msgstr ""
@ -586,9 +577,9 @@ msgstr ""
msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:272
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -651,6 +642,7 @@ msgstr ""
#: lib/cannery_web/live/pack_live/show.ex:40
#: lib/cannery_web/live/range_live/index.ex:31
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "Record Shots"
msgstr ""
@ -774,7 +766,7 @@ msgstr ""
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -951,7 +943,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -991,7 +983,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -420,6 +420,8 @@ msgstr ""
#: lib/cannery_web/components/core_components/topbar.html.heex:48
#: lib/cannery_web/components/pack_table_component.ex:80
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Range"
msgstr ""
@ -453,11 +455,6 @@ msgstr ""
msgid "Record shots"
msgstr ""
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "New Shot Records"
msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:52
#: lib/cannery_web/live/range_live/index.html.heex:119
#, elixir-autogen, elixir-format
@ -471,12 +468,6 @@ msgstr ""
msgid "Rounds shot"
msgstr ""
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Shot Records"
msgstr ""
#: lib/cannery_web/live/pack_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -494,9 +485,9 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:273
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -568,13 +559,13 @@ msgid "Reconnecting..."
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:28
#: lib/cannery_web/live/container_live/show.ex:116
#: lib/cannery_web/live/container_live/show.ex:118
#, elixir-autogen, elixir-format
msgid "Edit %{name}"
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:63
#: lib/cannery_web/live/container_live/show.ex:117
#: lib/cannery_web/live/container_live/show.ex:119
#, elixir-autogen, elixir-format
msgid "Edit %{name} tags"
msgstr ""
@ -586,9 +577,9 @@ msgstr ""
msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:272
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -651,6 +642,7 @@ msgstr ""
#: lib/cannery_web/live/pack_live/show.ex:40
#: lib/cannery_web/live/range_live/index.ex:31
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format, fuzzy
msgid "Record Shots"
msgstr ""
@ -774,7 +766,7 @@ msgstr ""
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -951,7 +943,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -991,7 +983,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Language: en\n"
#: lib/cannery/containers.ex:220
#: lib/cannery/containers.ex:224
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr ""
@ -153,7 +153,7 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
#: lib/cannery/ammo.ex:1121
#: lib/cannery/ammo.ex:974
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""

View File

@ -10,7 +10,7 @@
msgid ""
msgstr ""
#: lib/cannery/containers.ex:220
#: lib/cannery/containers.ex:224
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr ""
@ -152,7 +152,7 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
#: lib/cannery/ammo.ex:1121
#: lib/cannery/ammo.ex:974
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""

View File

@ -427,6 +427,8 @@ msgstr "Contenedor sin etiquetas"
#: lib/cannery_web/components/core_components/topbar.html.heex:48
#: lib/cannery_web/components/pack_table_component.ex:80
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Range"
msgstr "Campo de tiro"
@ -460,11 +462,6 @@ msgstr "No hay munición preparada"
msgid "Record shots"
msgstr "Tiros récord"
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "New Shot Records"
msgstr "Nuevos Tiros Récord"
#: lib/cannery_web/live/range_live/index.html.heex:52
#: lib/cannery_web/live/range_live/index.html.heex:119
#, elixir-autogen, elixir-format
@ -478,12 +475,6 @@ msgstr "No se han grabado tiros"
msgid "Rounds shot"
msgstr "Balas disparadas"
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Shot Records"
msgstr "Récords de Tiro"
#: lib/cannery_web/live/pack_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -501,9 +492,9 @@ msgstr "Registro de tiros"
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:273
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -575,13 +566,13 @@ msgid "Reconnecting..."
msgstr "Reconectando..."
#: lib/cannery_web/live/container_live/index.ex:28
#: lib/cannery_web/live/container_live/show.ex:116
#: lib/cannery_web/live/container_live/show.ex:118
#, elixir-autogen, elixir-format
msgid "Edit %{name}"
msgstr "Editar %{name}"
#: lib/cannery_web/live/container_live/index.ex:63
#: lib/cannery_web/live/container_live/show.ex:117
#: lib/cannery_web/live/container_live/show.ex:119
#, elixir-autogen, elixir-format
msgid "Edit %{name} tags"
msgstr "Editar etiquetas de %{name}"
@ -593,9 +584,9 @@ msgstr "Editar etiquetas de %{name}"
msgid "Rounds:"
msgstr "Balas:"
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:272
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -658,6 +649,7 @@ msgstr "Reestablecer contraseña"
#: lib/cannery_web/live/pack_live/show.ex:40
#: lib/cannery_web/live/range_live/index.ex:31
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "Record Shots"
msgstr "Tiros Récord"
@ -782,7 +774,7 @@ msgstr "Contenedor:"
msgid "Show used"
msgstr "Mostrar usadas"
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -959,7 +951,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr "Vacio"
@ -999,7 +991,7 @@ msgstr "Usada por última vez en"
msgid "Last used on:"
msgstr "Usada por última vez en:"
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr "Nunca usada"

View File

@ -23,7 +23,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/cannery/containers.ex:220
#: lib/cannery/containers.ex:224
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr "El contenedor debe estar vacío antes de ser borrado"
@ -168,7 +168,7 @@ msgstr "No se ha podido procesar el número de copias"
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"
#: lib/cannery/ammo.ex:1121
#: lib/cannery/ammo.ex:974
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr "Multiplicador inválido"

View File

@ -428,6 +428,8 @@ msgstr "Aucun tag pour ce conteneur"
#: lib/cannery_web/components/core_components/topbar.html.heex:48
#: lib/cannery_web/components/pack_table_component.ex:80
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Range"
msgstr "Portée"
@ -461,11 +463,6 @@ msgstr "Aucune munition sélectionnée"
msgid "Record shots"
msgstr "Tirs enregistrés"
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "New Shot Records"
msgstr "Nouveaux enregistrements de tir"
#: lib/cannery_web/live/range_live/index.html.heex:52
#: lib/cannery_web/live/range_live/index.html.heex:119
#, elixir-autogen, elixir-format
@ -479,12 +476,6 @@ msgstr "Aucun tir enregistré"
msgid "Rounds shot"
msgstr "Cartouches tirées"
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Shot Records"
msgstr "Enregistrements de tir"
#: lib/cannery_web/live/pack_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -502,9 +493,9 @@ msgstr "Évènements de tir"
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:273
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -576,13 +567,13 @@ msgid "Reconnecting..."
msgstr "Reconnexion en cours…"
#: lib/cannery_web/live/container_live/index.ex:28
#: lib/cannery_web/live/container_live/show.ex:116
#: lib/cannery_web/live/container_live/show.ex:118
#, elixir-autogen, elixir-format
msgid "Edit %{name}"
msgstr "Éditer %{name}"
#: lib/cannery_web/live/container_live/index.ex:63
#: lib/cannery_web/live/container_live/show.ex:117
#: lib/cannery_web/live/container_live/show.ex:119
#, elixir-autogen, elixir-format
msgid "Edit %{name} tags"
msgstr "Éditer les tags de %{name}"
@ -594,9 +585,9 @@ msgstr "Éditer les tags de %{name}"
msgid "Rounds:"
msgstr "Cartouches:"
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:272
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -659,6 +650,7 @@ msgstr "Réinitialiser votre mot de passe"
#: lib/cannery_web/live/pack_live/show.ex:40
#: lib/cannery_web/live/range_live/index.ex:31
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "Record Shots"
msgstr "Enregistrer des tirs"
@ -783,7 +775,7 @@ msgstr "Conteneur"
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -960,7 +952,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -1000,7 +992,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -23,7 +23,7 @@ msgstr ""
# # Run "mix gettext.extract" to bring this file up to
# # date. Leave "msgstr"s empty as changing them here has no
# # effect: edit them in PO (.po) files instead.
#: lib/cannery/containers.ex:220
#: lib/cannery/containers.ex:224
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr "Le conteneur doit être vide pour être supprimé"
@ -169,7 +169,7 @@ msgstr "Impossible d'analyser le nombre de copies"
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}"
#: lib/cannery/ammo.ex:1121
#: lib/cannery/ammo.ex:974
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr "Multiplicateur invalide"

View File

@ -422,6 +422,8 @@ msgstr ""
#: lib/cannery_web/components/core_components/topbar.html.heex:48
#: lib/cannery_web/components/pack_table_component.ex:80
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Range"
msgstr ""
@ -455,11 +457,6 @@ msgstr ""
msgid "Record shots"
msgstr ""
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "New Shot Records"
msgstr ""
#: lib/cannery_web/live/range_live/index.html.heex:52
#: lib/cannery_web/live/range_live/index.html.heex:119
#, elixir-autogen, elixir-format
@ -473,12 +470,6 @@ msgstr ""
msgid "Rounds shot"
msgstr ""
#: lib/cannery_web/live/range_live/index.ex:55
#: lib/cannery_web/live/range_live/index.ex:65
#, elixir-autogen, elixir-format
msgid "Shot Records"
msgstr ""
#: lib/cannery_web/live/pack_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -496,9 +487,9 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:42
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:176
#: lib/cannery_web/components/pack_table_component.ex:259
#: lib/cannery_web/components/type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:181
#: lib/cannery_web/components/pack_table_component.ex:264
#: lib/cannery_web/components/type_table_component.ex:273
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#: lib/cannery_web/live/type_live/show.html.heex:150
@ -570,13 +561,13 @@ msgid "Reconnecting..."
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:28
#: lib/cannery_web/live/container_live/show.ex:116
#: lib/cannery_web/live/container_live/show.ex:118
#, elixir-autogen, elixir-format
msgid "Edit %{name}"
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:63
#: lib/cannery_web/live/container_live/show.ex:117
#: lib/cannery_web/live/container_live/show.ex:119
#, elixir-autogen, elixir-format
msgid "Edit %{name} tags"
msgstr ""
@ -588,9 +579,9 @@ msgstr ""
msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:173
#: lib/cannery_web/components/pack_table_component.ex:255
#: lib/cannery_web/components/type_table_component.ex:259
#: lib/cannery_web/components/pack_table_component.ex:178
#: lib/cannery_web/components/pack_table_component.ex:260
#: lib/cannery_web/components/type_table_component.ex:272
#: lib/cannery_web/live/type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -653,6 +644,7 @@ msgstr ""
#: lib/cannery_web/live/pack_live/show.ex:40
#: lib/cannery_web/live/range_live/index.ex:31
#: lib/cannery_web/live/range_live/index.ex:47
#, elixir-autogen, elixir-format
msgid "Record Shots"
msgstr ""
@ -776,7 +768,7 @@ msgstr ""
msgid "Show used"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:214
#: lib/cannery_web/components/pack_table_component.ex:219
#: lib/cannery_web/live/pack_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
@ -953,7 +945,7 @@ msgid "Average CPR"
msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:263
#: lib/cannery_web/components/pack_table_component.ex:268
#, elixir-autogen, elixir-format
msgid "Empty"
msgstr ""
@ -993,7 +985,7 @@ msgstr ""
msgid "Last used on:"
msgstr ""
#: lib/cannery_web/components/pack_table_component.ex:194
#: lib/cannery_web/components/pack_table_component.ex:199
#, elixir-autogen, elixir-format
msgid "Never used"
msgstr ""

View File

@ -24,7 +24,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/cannery/containers.ex:220
#: lib/cannery/containers.ex:224
#, elixir-autogen, elixir-format
msgid "Container must be empty before deleting"
msgstr "Caithfidh an coimeádán a bheidh follamh roimh scriosadh"
@ -168,7 +168,7 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
#: lib/cannery/ammo.ex:1121
#: lib/cannery/ammo.ex:974
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""

View File

@ -188,27 +188,27 @@ defmodule Cannery.ActivityLogTest do
end
end
test "get_used_count/2 returns accurate used count", %{
test "get_used_count/2 returns accurate used count for pack_id", %{
pack: pack,
type: type,
container: container,
current_user: current_user
} do
{1, [another_pack]} = pack_fixture(type, container, current_user)
assert 0 = another_pack |> ActivityLog.get_used_count(current_user)
assert 5 = pack |> ActivityLog.get_used_count(current_user)
assert 0 = ActivityLog.get_used_count(current_user, pack_id: another_pack.id)
assert 5 = ActivityLog.get_used_count(current_user, pack_id: pack.id)
shot_record_fixture(%{count: 15}, current_user, pack)
assert 20 = pack |> ActivityLog.get_used_count(current_user)
assert 20 = ActivityLog.get_used_count(current_user, pack_id: pack.id)
shot_record_fixture(%{count: 10}, current_user, pack)
assert 30 = pack |> ActivityLog.get_used_count(current_user)
assert 30 = ActivityLog.get_used_count(current_user, pack_id: pack.id)
{1, [another_pack]} = pack_fixture(type, container, current_user)
assert 0 = another_pack |> ActivityLog.get_used_count(current_user)
assert 0 = ActivityLog.get_used_count(current_user, pack_id: another_pack.id)
end
test "get_used_counts/2 returns accurate used counts", %{
test "get_grouped_used_counts/2 returns accurate used counts for packs", %{
pack: %{id: pack_id} = pack,
type: type,
container: container,
@ -217,20 +217,41 @@ defmodule Cannery.ActivityLogTest do
{1, [%{id: another_pack_id} = another_pack]} = pack_fixture(type, container, current_user)
assert %{pack_id => 5} ==
[pack, another_pack] |> ActivityLog.get_used_counts(current_user)
ActivityLog.get_grouped_used_counts(current_user,
packs: [pack, another_pack],
group_by: :pack_id
)
shot_record_fixture(%{count: 5}, current_user, another_pack)
used_counts = [pack, another_pack] |> ActivityLog.get_used_counts(current_user)
used_counts =
ActivityLog.get_grouped_used_counts(current_user,
packs: [pack, another_pack],
group_by: :pack_id
)
assert %{^pack_id => 5} = used_counts
assert %{^another_pack_id => 5} = used_counts
shot_record_fixture(%{count: 15}, current_user, pack)
used_counts = [pack, another_pack] |> ActivityLog.get_used_counts(current_user)
used_counts =
ActivityLog.get_grouped_used_counts(current_user,
packs: [pack, another_pack],
group_by: :pack_id
)
assert %{^pack_id => 20} = used_counts
assert %{^another_pack_id => 5} = used_counts
shot_record_fixture(%{count: 10}, current_user, pack)
used_counts = [pack, another_pack] |> ActivityLog.get_used_counts(current_user)
used_counts =
ActivityLog.get_grouped_used_counts(current_user,
packs: [pack, another_pack],
group_by: :pack_id
)
assert %{^pack_id => 30} = used_counts
assert %{^another_pack_id => 5} = used_counts
end
@ -294,17 +315,17 @@ defmodule Cannery.ActivityLogTest do
assert %{^another_pack_id => ~D[2022-11-09]} = last_used_shot_records
end
test "get_used_count_for_type/2 gets accurate used round count for type",
test "get_used_count/2 gets accurate used round count for type_id",
%{type: type, pack: pack, current_user: current_user} do
another_type = type_fixture(current_user)
assert 0 = another_type |> ActivityLog.get_used_count_for_type(current_user)
assert 5 = type |> ActivityLog.get_used_count_for_type(current_user)
assert 0 = ActivityLog.get_used_count(current_user, type_id: another_type.id)
assert 5 = ActivityLog.get_used_count(current_user, type_id: type.id)
shot_record_fixture(%{count: 5}, current_user, pack)
assert 10 = type |> ActivityLog.get_used_count_for_type(current_user)
assert 10 = ActivityLog.get_used_count(current_user, type_id: type.id)
shot_record_fixture(%{count: 1}, current_user, pack)
assert 11 = type |> ActivityLog.get_used_count_for_type(current_user)
assert 11 = ActivityLog.get_used_count(current_user, type_id: type.id)
end
test "get_used_count_for_types/2 gets accurate used round count for types", %{
@ -317,13 +338,19 @@ defmodule Cannery.ActivityLogTest do
{1, [pack]} = pack_fixture(another_type, container, current_user)
assert %{type_id => 5} ==
[type, another_type]
|> ActivityLog.get_used_count_for_types(current_user)
ActivityLog.get_grouped_used_counts(current_user,
types: [type, another_type],
group_by: :type_id
)
# use generated pack
shot_record_fixture(%{count: 5}, current_user, pack)
used_counts = [type, another_type] |> ActivityLog.get_used_count_for_types(current_user)
used_counts =
ActivityLog.get_grouped_used_counts(current_user,
types: [type, another_type],
group_by: :type_id
)
assert %{^type_id => 5} = used_counts
assert %{^another_type_id => 5} = used_counts
@ -331,7 +358,11 @@ defmodule Cannery.ActivityLogTest do
# use generated pack again
shot_record_fixture(%{count: 1}, current_user, pack)
used_counts = [type, another_type] |> ActivityLog.get_used_count_for_types(current_user)
used_counts =
ActivityLog.get_grouped_used_counts(current_user,
types: [type, another_type],
group_by: :type_id
)
assert %{^type_id => 5} = used_counts
assert %{^another_type_id => 6} = used_counts
@ -376,17 +407,17 @@ defmodule Cannery.ActivityLogTest do
{1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
pistol_shot_record = shot_record_fixture(current_user, pistol_pack)
assert [^rifle_shot_record] = ActivityLog.list_shot_records(:rifle, current_user)
assert [^shotgun_shot_record] = ActivityLog.list_shot_records(:shotgun, current_user)
assert [^pistol_shot_record] = ActivityLog.list_shot_records(:pistol, current_user)
assert [^rifle_shot_record] = ActivityLog.list_shot_records(current_user, class: :rifle)
assert [^shotgun_shot_record] = ActivityLog.list_shot_records(current_user, class: :shotgun)
assert [^pistol_shot_record] = ActivityLog.list_shot_records(current_user, class: :pistol)
shot_records = ActivityLog.list_shot_records(:all, current_user)
shot_records = ActivityLog.list_shot_records(current_user, class: :all)
assert Enum.count(shot_records) == 3
assert rifle_shot_record in shot_records
assert shotgun_shot_record in shot_records
assert pistol_shot_record in shot_records
shot_records = ActivityLog.list_shot_records(nil, current_user)
shot_records = ActivityLog.list_shot_records(current_user, class: nil)
assert Enum.count(shot_records) == 3
assert rifle_shot_record in shot_records
assert shotgun_shot_record in shot_records
@ -420,13 +451,13 @@ defmodule Cannery.ActivityLogTest do
_shouldnt_return = shot_record_fixture(another_user, another_pack)
# notes
assert ActivityLog.list_shot_records("amazing", :all, current_user) == [shot_record_a]
assert ActivityLog.list_shot_records(current_user, search: "amazing") == [shot_record_a]
# pack attributes
assert ActivityLog.list_shot_records("stupendous", :all, current_user) == [shot_record_b]
assert ActivityLog.list_shot_records(current_user, search: "stupendous") == [shot_record_b]
# type attributes
assert ActivityLog.list_shot_records("fabulous", :all, current_user) == [shot_record_c]
assert ActivityLog.list_shot_records(current_user, search: "fabulous") == [shot_record_c]
end
end
end

View File

@ -85,7 +85,7 @@ defmodule Cannery.AmmoTest do
pistol_type: pistol_type,
current_user: current_user
} do
results = Ammo.list_types(current_user, :all)
results = Ammo.list_types(current_user, class: :all)
assert results |> Enum.count() == 3
assert rifle_type in results
assert shotgun_type in results
@ -96,21 +96,21 @@ defmodule Cannery.AmmoTest do
rifle_type: rifle_type,
current_user: current_user
} do
assert [^rifle_type] = Ammo.list_types(current_user, :rifle)
assert [^rifle_type] = Ammo.list_types(current_user, class: :rifle)
end
test "list_types/2 returns shotgun types", %{
shotgun_type: shotgun_type,
current_user: current_user
} do
assert [^shotgun_type] = Ammo.list_types(current_user, :shotgun)
assert [^shotgun_type] = Ammo.list_types(current_user, class: :shotgun)
end
test "list_types/2 returns pistol types", %{
pistol_type: pistol_type,
current_user: current_user
} do
assert [^pistol_type] = Ammo.list_types(current_user, :pistol)
assert [^pistol_type] = Ammo.list_types(current_user, class: :pistol)
end
test "list_types/2 returns relevant types for a user", %{
@ -120,22 +120,22 @@ defmodule Cannery.AmmoTest do
current_user: current_user
} do
# name
assert Ammo.list_types("bullet", current_user, :all) == [rifle_type]
assert Ammo.list_types("bullets", current_user, :all) == [rifle_type]
assert Ammo.list_types("hollow", current_user, :all) == [shotgun_type]
assert Ammo.list_types("jacket", current_user, :all) == [pistol_type]
assert Ammo.list_types(current_user, search: "bullet") == [rifle_type]
assert Ammo.list_types(current_user, search: "bullets") == [rifle_type]
assert Ammo.list_types(current_user, search: "hollow") == [shotgun_type]
assert Ammo.list_types(current_user, search: "jacket") == [pistol_type]
# desc
assert Ammo.list_types("pew", current_user, :all) == [rifle_type]
assert Ammo.list_types("brass", current_user, :all) == [pistol_type]
assert Ammo.list_types("shell", current_user, :all) == [pistol_type]
assert Ammo.list_types(current_user, search: "pew") == [rifle_type]
assert Ammo.list_types(current_user, search: "brass") == [pistol_type]
assert Ammo.list_types(current_user, search: "shell") == [pistol_type]
# grains (integer)
assert Ammo.list_types("53453", current_user, :all) == [rifle_type]
assert Ammo.list_types("3234234", current_user, :all) == [shotgun_type]
assert Ammo.list_types(current_user, search: "53453") == [rifle_type]
assert Ammo.list_types(current_user, search: "3234234") == [shotgun_type]
# tracer (boolean)
assert Ammo.list_types("tracer", current_user, :all) == [pistol_type]
assert Ammo.list_types(current_user, search: "tracer") == [pistol_type]
end
end
@ -222,7 +222,7 @@ defmodule Cannery.AmmoTest do
]
end
test "get_average_cost_for_type/2 gets average cost for type",
test "get_average_cost/2 gets average cost for type",
%{type: type, current_user: current_user, container: container} do
{1, [_pack]} =
pack_fixture(
@ -232,7 +232,7 @@ defmodule Cannery.AmmoTest do
current_user
)
assert 25.0 = Ammo.get_average_cost_for_type(type, current_user)
assert 25.0 = Ammo.get_average_cost(type, current_user)
{1, [_pack]} =
pack_fixture(
@ -242,7 +242,7 @@ defmodule Cannery.AmmoTest do
current_user
)
assert 25.0 = Ammo.get_average_cost_for_type(type, current_user)
assert 25.0 = Ammo.get_average_cost(type, current_user)
{1, [_pack]} =
pack_fixture(
@ -252,7 +252,7 @@ defmodule Cannery.AmmoTest do
current_user
)
assert 40.0 = Ammo.get_average_cost_for_type(type, current_user)
assert 40.0 = Ammo.get_average_cost(type, current_user)
{1, [_pack]} =
pack_fixture(
@ -262,21 +262,21 @@ defmodule Cannery.AmmoTest do
current_user
)
assert 37.5 = Ammo.get_average_cost_for_type(type, current_user)
assert 37.5 = Ammo.get_average_cost(type, current_user)
end
test "get_average_cost_for_types/2 gets average costs for types", %{
test "get_average_costs/2 gets average costs for types", %{
type: %{id: type_id} = type,
current_user: current_user,
container: container
} do
assert %{} == [type] |> Ammo.get_average_cost_for_types(current_user)
assert %{} == [type] |> Ammo.get_average_costs(current_user)
%{id: another_type_id} = another_type = type_fixture(current_user)
assert %{} ==
[type, another_type]
|> Ammo.get_average_cost_for_types(current_user)
|> Ammo.get_average_costs(current_user)
{1, [_pack]} =
pack_fixture(
@ -288,7 +288,7 @@ defmodule Cannery.AmmoTest do
assert %{another_type_id => 25.0} ==
[type, another_type]
|> Ammo.get_average_cost_for_types(current_user)
|> Ammo.get_average_costs(current_user)
{1, [_pack]} =
pack_fixture(
@ -298,7 +298,7 @@ defmodule Cannery.AmmoTest do
current_user
)
average_costs = [type, another_type] |> Ammo.get_average_cost_for_types(current_user)
average_costs = [type, another_type] |> Ammo.get_average_costs(current_user)
assert %{^type_id => 25.0} = average_costs
assert %{^another_type_id => 25.0} = average_costs
@ -311,7 +311,7 @@ defmodule Cannery.AmmoTest do
current_user
)
average_costs = [type, another_type] |> Ammo.get_average_cost_for_types(current_user)
average_costs = [type, another_type] |> Ammo.get_average_costs(current_user)
assert %{^type_id => 25.0} = average_costs
assert %{^another_type_id => 25.0} = average_costs
@ -324,7 +324,7 @@ defmodule Cannery.AmmoTest do
current_user
)
average_costs = [type, another_type] |> Ammo.get_average_cost_for_types(current_user)
average_costs = [type, another_type] |> Ammo.get_average_costs(current_user)
assert %{^type_id => 40.0} = average_costs
assert %{^another_type_id => 25.0} = average_costs
@ -337,30 +337,30 @@ defmodule Cannery.AmmoTest do
current_user
)
average_costs = [type, another_type] |> Ammo.get_average_cost_for_types(current_user)
average_costs = [type, another_type] |> Ammo.get_average_costs(current_user)
assert %{^type_id => 37.5} = average_costs
assert %{^another_type_id => 25.0} = average_costs
end
test "get_round_count_for_type/2 gets accurate round count for type",
test "get_round_count/2 gets accurate round count for type",
%{type: type, current_user: current_user, container: container} do
another_type = type_fixture(current_user)
assert 0 = Ammo.get_round_count_for_type(another_type, current_user)
assert 0 = Ammo.get_round_count(current_user, type_id: another_type.id)
{1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert 1 = Ammo.get_round_count_for_type(type, current_user)
assert 1 = Ammo.get_round_count(current_user, type_id: type.id)
{1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
assert 51 = Ammo.get_round_count_for_type(type, current_user)
assert 51 = Ammo.get_round_count(current_user, type_id: type.id)
shot_record_fixture(%{count: 26}, current_user, pack)
assert 25 = Ammo.get_round_count_for_type(type, current_user)
assert 25 = Ammo.get_round_count(current_user, type_id: type.id)
shot_record_fixture(%{count: 1}, current_user, first_pack)
assert 24 = Ammo.get_round_count_for_type(type, current_user)
assert 24 = Ammo.get_round_count(current_user, type_id: type.id)
end
test "get_round_count_for_types/2 gets accurate round counts for types", %{
@ -371,147 +371,158 @@ defmodule Cannery.AmmoTest do
{1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert %{type_id => 1} ==
[type] |> Ammo.get_round_count_for_types(current_user)
Ammo.get_grouped_round_count(current_user, types: [type], group_by: :type_id)
%{id: another_type_id} = another_type = type_fixture(current_user)
{1, [_another_pack]} = pack_fixture(%{count: 1}, another_type, container, current_user)
round_counts = [type, another_type] |> Ammo.get_round_count_for_types(current_user)
round_counts =
Ammo.get_grouped_round_count(current_user, types: [type, another_type], group_by: :type_id)
assert %{^type_id => 1} = round_counts
assert %{^another_type_id => 1} = round_counts
{1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
round_counts = [type, another_type] |> Ammo.get_round_count_for_types(current_user)
round_counts =
Ammo.get_grouped_round_count(current_user, types: [type, another_type], group_by: :type_id)
assert %{^type_id => 51} = round_counts
assert %{^another_type_id => 1} = round_counts
shot_record_fixture(%{count: 26}, current_user, pack)
round_counts = [type, another_type] |> Ammo.get_round_count_for_types(current_user)
round_counts =
Ammo.get_grouped_round_count(current_user, types: [type, another_type], group_by: :type_id)
assert %{^type_id => 25} = round_counts
assert %{^another_type_id => 1} = round_counts
shot_record_fixture(%{count: 1}, current_user, first_pack)
round_counts = [type, another_type] |> Ammo.get_round_count_for_types(current_user)
round_counts =
Ammo.get_grouped_round_count(current_user, types: [type, another_type], group_by: :type_id)
assert %{^type_id => 24} = round_counts
assert %{^another_type_id => 1} = round_counts
end
test "get_historical_count_for_type/2 gets accurate total round count for type",
test "get_historical_count/2 gets accurate total round count for type",
%{type: type, current_user: current_user, container: container} do
assert 0 = Ammo.get_historical_count_for_type(type, current_user)
assert 0 = Ammo.get_historical_count(type, current_user)
{1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert 1 = Ammo.get_historical_count_for_type(type, current_user)
assert 1 = Ammo.get_historical_count(type, current_user)
{1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
assert 51 = Ammo.get_historical_count_for_type(type, current_user)
assert 51 = Ammo.get_historical_count(type, current_user)
shot_record_fixture(%{count: 26}, current_user, pack)
assert 51 = Ammo.get_historical_count_for_type(type, current_user)
assert 51 = Ammo.get_historical_count(type, current_user)
shot_record_fixture(%{count: 1}, current_user, first_pack)
assert 51 = Ammo.get_historical_count_for_type(type, current_user)
assert 51 = Ammo.get_historical_count(type, current_user)
end
test "get_historical_count_for_types/2 gets accurate total round counts for types",
test "get_historical_counts/2 gets accurate total round counts for types",
%{
type: %{id: type_id} = type,
current_user: current_user,
container: container
} do
assert %{} == [type] |> Ammo.get_historical_count_for_types(current_user)
assert %{} == [type] |> Ammo.get_historical_counts(current_user)
{1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert %{type_id => 1} ==
[type] |> Ammo.get_historical_count_for_types(current_user)
[type] |> Ammo.get_historical_counts(current_user)
%{id: another_type_id} = another_type = type_fixture(current_user)
{1, [_pack]} = pack_fixture(%{count: 1}, another_type, container, current_user)
historical_counts =
[type, another_type] |> Ammo.get_historical_count_for_types(current_user)
historical_counts = [type, another_type] |> Ammo.get_historical_counts(current_user)
assert %{^type_id => 1} = historical_counts
assert %{^another_type_id => 1} = historical_counts
{1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
historical_counts =
[type, another_type] |> Ammo.get_historical_count_for_types(current_user)
historical_counts = [type, another_type] |> Ammo.get_historical_counts(current_user)
assert %{^type_id => 51} = historical_counts
assert %{^another_type_id => 1} = historical_counts
shot_record_fixture(%{count: 26}, current_user, pack)
historical_counts =
[type, another_type] |> Ammo.get_historical_count_for_types(current_user)
historical_counts = [type, another_type] |> Ammo.get_historical_counts(current_user)
assert %{^type_id => 51} = historical_counts
assert %{^another_type_id => 1} = historical_counts
shot_record_fixture(%{count: 1}, current_user, first_pack)
historical_counts =
[type, another_type] |> Ammo.get_historical_count_for_types(current_user)
historical_counts = [type, another_type] |> Ammo.get_historical_counts(current_user)
assert %{^type_id => 51} = historical_counts
assert %{^another_type_id => 1} = historical_counts
end
test "get_used_packs_count_for_type/2 gets accurate total ammo count for type",
test "get_packs_count/2 gets accurate total ammo count for type with show_used",
%{type: type, current_user: current_user, container: container} do
assert 0 = Ammo.get_used_packs_count_for_type(type, current_user)
assert 0 = Ammo.get_packs_count(current_user, type_id: type.id, show_used: :only_used)
{1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert 0 = Ammo.get_used_packs_count_for_type(type, current_user)
assert 0 = Ammo.get_packs_count(current_user, type_id: type.id, show_used: :only_used)
{1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
assert 0 = Ammo.get_used_packs_count_for_type(type, current_user)
assert 0 = Ammo.get_packs_count(current_user, type_id: type.id, show_used: :only_used)
shot_record_fixture(%{count: 50}, current_user, pack)
assert 1 = Ammo.get_used_packs_count_for_type(type, current_user)
assert 1 = Ammo.get_packs_count(current_user, type_id: type.id, show_used: :only_used)
shot_record_fixture(%{count: 1}, current_user, first_pack)
assert 2 = Ammo.get_used_packs_count_for_type(type, current_user)
assert 2 = Ammo.get_packs_count(current_user, type_id: type.id, show_used: :only_used)
end
test "get_used_packs_count_for_types/2 gets accurate total ammo counts for types",
test "get_grouped_packs_count/2 gets accurate total ammo counts for types",
%{
type: %{id: type_id} = type,
current_user: current_user,
container: container
} do
# testing empty type
assert %{} == [type] |> Ammo.get_used_packs_count_for_types(current_user)
assert %{} ==
Ammo.get_grouped_packs_count(current_user,
types: [type],
group_by: :type_id,
show_used: :only_used
)
# testing two empty types
%{id: another_type_id} = another_type = type_fixture(current_user)
assert %{} ==
[type, another_type]
|> Ammo.get_used_packs_count_for_types(current_user)
Ammo.get_grouped_packs_count(current_user,
types: [type, another_type],
group_by: :type_id,
show_used: :only_used
)
# testing type with pack
{1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert %{} ==
[type, another_type]
|> Ammo.get_used_packs_count_for_types(current_user)
Ammo.get_grouped_packs_count(current_user,
types: [type, another_type],
group_by: :type_id,
show_used: :only_used
)
# testing type with used pack
{1, [another_pack]} = pack_fixture(%{count: 50}, another_type, container, current_user)
@ -519,14 +530,22 @@ defmodule Cannery.AmmoTest do
shot_record_fixture(%{count: 50}, current_user, another_pack)
assert %{another_type_id => 1} ==
[type, another_type]
|> Ammo.get_used_packs_count_for_types(current_user)
Ammo.get_grouped_packs_count(current_user,
types: [type, another_type],
group_by: :type_id,
show_used: :only_used
)
# testing two types with zero and one used packs
{1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
shot_record_fixture(%{count: 50}, current_user, pack)
used_counts = [type, another_type] |> Ammo.get_used_packs_count_for_types(current_user)
used_counts =
Ammo.get_grouped_packs_count(current_user,
types: [type, another_type],
group_by: :type_id,
show_used: :only_used
)
assert %{^type_id => 1} = used_counts
assert %{^another_type_id => 1} = used_counts
@ -534,30 +553,35 @@ defmodule Cannery.AmmoTest do
# testing two type with one and two used packs
shot_record_fixture(%{count: 1}, current_user, first_pack)
used_counts = [type, another_type] |> Ammo.get_used_packs_count_for_types(current_user)
used_counts =
Ammo.get_grouped_packs_count(current_user,
types: [type, another_type],
group_by: :type_id,
show_used: :only_used
)
assert %{^type_id => 2} = used_counts
assert %{^another_type_id => 1} = used_counts
end
test "get_packs_count_for_container!/2 gets accurate ammo count for container",
test "get_packs_count/2 gets accurate ammo count for container by container_id",
%{type: type, current_user: current_user, container: container} do
{1, [first_pack]} = pack_fixture(%{count: 5}, type, container, current_user)
assert 1 = Ammo.get_packs_count_for_container!(container, current_user)
assert 1 = Ammo.get_packs_count(current_user, container_id: container.id)
{25, _packs} = pack_fixture(%{count: 5}, 25, type, container, current_user)
assert 26 = Ammo.get_packs_count_for_container!(container, current_user)
assert 26 = Ammo.get_packs_count(current_user, container_id: container.id)
shot_record_fixture(%{count: 1}, current_user, first_pack)
assert 26 = Ammo.get_packs_count_for_container!(container, current_user)
assert 26 = Ammo.get_packs_count(current_user, container_id: container.id)
shot_record_fixture(%{count: 4}, current_user, first_pack)
assert 25 = Ammo.get_packs_count_for_container!(container, current_user)
assert 25 = Ammo.get_packs_count(current_user, container_id: container.id)
end
test "get_packs_count_for_containers/2 gets accurate ammo count for containers", %{
test "get_grouped_packs_count/2 gets accurate ammo count for containers", %{
type: type,
current_user: current_user,
container: %{id: container_id} = container
@ -569,8 +593,10 @@ defmodule Cannery.AmmoTest do
{1, [_first_pack]} = pack_fixture(%{count: 5}, type, another_container, current_user)
packs_count =
[container, another_container]
|> Ammo.get_packs_count_for_containers(current_user)
Ammo.get_grouped_packs_count(current_user,
containers: [container, another_container],
group_by: :container_id
)
assert %{^container_id => 1} = packs_count
assert %{^another_container_id => 1} = packs_count
@ -578,8 +604,10 @@ defmodule Cannery.AmmoTest do
{25, _packs} = pack_fixture(%{count: 5}, 25, type, container, current_user)
packs_count =
[container, another_container]
|> Ammo.get_packs_count_for_containers(current_user)
Ammo.get_grouped_packs_count(current_user,
containers: [container, another_container],
group_by: :container_id
)
assert %{^container_id => 26} = packs_count
assert %{^another_container_id => 1} = packs_count
@ -587,8 +615,10 @@ defmodule Cannery.AmmoTest do
shot_record_fixture(%{count: 1}, current_user, first_pack)
packs_count =
[container, another_container]
|> Ammo.get_packs_count_for_containers(current_user)
Ammo.get_grouped_packs_count(current_user,
containers: [container, another_container],
group_by: :container_id
)
assert %{^container_id => 26} = packs_count
assert %{^another_container_id => 1} = packs_count
@ -596,28 +626,30 @@ defmodule Cannery.AmmoTest do
shot_record_fixture(%{count: 4}, current_user, first_pack)
packs_count =
[container, another_container]
|> Ammo.get_packs_count_for_containers(current_user)
Ammo.get_grouped_packs_count(current_user,
containers: [container, another_container],
group_by: :container_id
)
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",
test "get_round_count/2 gets accurate total round count for container_id",
%{type: type, current_user: current_user, container: container} do
{1, [first_pack]} = pack_fixture(%{count: 5}, type, container, current_user)
assert 5 = Ammo.get_round_count_for_container!(container, current_user)
assert 5 = Ammo.get_round_count(current_user, container_id: container.id)
{25, _packs} = pack_fixture(%{count: 5}, 25, type, container, current_user)
assert 130 = Ammo.get_round_count_for_container!(container, current_user)
assert 130 = Ammo.get_round_count(current_user, container_id: container.id)
shot_record_fixture(%{count: 5}, current_user, first_pack)
assert 125 = Ammo.get_round_count_for_container!(container, current_user)
assert 125 = Ammo.get_round_count(current_user, container_id: container.id)
end
test "get_round_count_for_containers/2 gets accurate total round count for containers",
test "get_grouped_round_count/2 gets accurate total round count for containers",
%{
type: type,
current_user: current_user,
@ -630,7 +662,10 @@ defmodule Cannery.AmmoTest do
{1, [_first_pack]} = pack_fixture(%{count: 5}, type, another_container, current_user)
round_counts =
[container, another_container] |> Ammo.get_round_count_for_containers(current_user)
Ammo.get_grouped_round_count(current_user,
containers: [container, another_container],
group_by: :container_id
)
assert %{^container_id => 5} = round_counts
assert %{^another_container_id => 5} = round_counts
@ -638,7 +673,10 @@ defmodule Cannery.AmmoTest do
{25, _packs} = pack_fixture(%{count: 5}, 25, type, container, current_user)
round_counts =
[container, another_container] |> Ammo.get_round_count_for_containers(current_user)
Ammo.get_grouped_round_count(current_user,
containers: [container, another_container],
group_by: :container_id
)
assert %{^container_id => 130} = round_counts
assert %{^another_container_id => 5} = round_counts
@ -646,7 +684,10 @@ defmodule Cannery.AmmoTest do
shot_record_fixture(%{count: 5}, current_user, first_pack)
round_counts =
[container, another_container] |> Ammo.get_round_count_for_containers(current_user)
Ammo.get_grouped_round_count(current_user,
containers: [container, another_container],
group_by: :container_id
)
assert %{^container_id => 125} = round_counts
assert %{^another_container_id => 5} = round_counts
@ -692,19 +733,19 @@ defmodule Cannery.AmmoTest do
]
end
test "get_packs_count!/2 returns the correct amount of ammo",
test "get_packs_count/2 returns the correct amount of ammo",
%{type: type, container: container, current_user: current_user} do
assert Ammo.get_packs_count!(current_user) == 1
assert Ammo.get_packs_count(current_user) == 1
pack_fixture(type, container, current_user)
assert Ammo.get_packs_count!(current_user) == 2
assert Ammo.get_packs_count(current_user) == 2
pack_fixture(type, container, current_user)
assert Ammo.get_packs_count!(current_user) == 3
assert Ammo.get_packs_count(current_user) == 3
other_user = user_fixture()
assert Ammo.get_packs_count!(other_user) == 0
assert Ammo.get_packs_count!(other_user, true) == 0
assert Ammo.get_packs_count(other_user) == 0
assert Ammo.get_packs_count(other_user, show_used: true) == 0
other_type = type_fixture(other_user)
other_container = container_fixture(other_user)
@ -712,11 +753,11 @@ defmodule Cannery.AmmoTest do
{1, [another_pack]} = pack_fixture(%{count: 30}, other_type, other_container, other_user)
shot_record_fixture(%{count: 30}, other_user, another_pack)
assert Ammo.get_packs_count!(other_user) == 0
assert Ammo.get_packs_count!(other_user, true) == 1
assert Ammo.get_packs_count(other_user) == 0
assert Ammo.get_packs_count(other_user, show_used: true) == 1
end
test "list_packs/4 returns all packs for a type" do
test "list_packs/2 returns all packs for a type" do
current_user = user_fixture()
container = container_fixture(current_user)
@ -727,24 +768,24 @@ defmodule Cannery.AmmoTest do
pistol_type = type_fixture(%{class: :pistol}, current_user)
{1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
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)
assert [^rifle_pack] = Ammo.list_packs(current_user, class: :rifle)
assert [^shotgun_pack] = Ammo.list_packs(current_user, class: :shotgun)
assert [^pistol_pack] = Ammo.list_packs(current_user, class: :pistol)
packs = Ammo.list_packs(nil, :all, current_user, false)
packs = Ammo.list_packs(current_user, class: :all)
assert Enum.count(packs) == 3
assert rifle_pack in packs
assert shotgun_pack in packs
assert pistol_pack in packs
packs = Ammo.list_packs(nil, nil, current_user, false)
packs = Ammo.list_packs(current_user)
assert Enum.count(packs) == 3
assert rifle_pack in packs
assert shotgun_pack in packs
assert pistol_pack in packs
end
test "list_packs/4 returns all relevant packs including used", %{
test "list_packs/2 returns all relevant packs including used", %{
type: type,
pack: pack,
container: container,
@ -756,15 +797,15 @@ defmodule Cannery.AmmoTest do
shot_record_fixture(%{count: 30}, current_user, another_pack)
another_pack = Ammo.get_pack!(another_pack_id, current_user)
assert Ammo.list_packs(nil, :all, current_user, false) == [pack]
assert Ammo.list_packs(current_user, show_used: false) == [pack]
packs = Ammo.list_packs(nil, :all, current_user, true)
packs = Ammo.list_packs(current_user, show_used: true)
assert Enum.count(packs) == 2
assert another_pack in packs
assert pack in packs
end
test "list_packs/4 returns relevant packs when searched", %{
test "list_packs/2 returns relevant packs when searched", %{
type: type,
pack: pack,
container: container,
@ -784,7 +825,7 @@ defmodule Cannery.AmmoTest do
{1, [fantastic_pack]} = pack_fixture(%{count: 47}, type, another_container, current_user)
packs = Ammo.list_packs(nil, :all, current_user, false)
packs = Ammo.list_packs(current_user, search: nil)
assert Enum.count(packs) == 4
assert fantastic_pack in packs
assert amazing_pack in packs
@ -792,37 +833,51 @@ defmodule Cannery.AmmoTest do
assert pack in packs
# search works for pack attributes
assert Ammo.list_packs("cool", :all, current_user, true) == [another_pack]
assert Ammo.list_packs(current_user, search: "cool") == [another_pack]
# search works for type attributes
assert Ammo.list_packs("amazing", :all, current_user, true) == [amazing_pack]
assert Ammo.list_packs(current_user, search: "amazing") == [amazing_pack]
# search works for container attributes
assert Ammo.list_packs("fantastic", :all, current_user, true) ==
[fantastic_pack]
assert Ammo.list_packs(current_user, search: "fantastic") == [fantastic_pack]
# search works for container tag attributes
assert Ammo.list_packs("stupendous", :all, current_user, true) ==
[fantastic_pack]
assert Ammo.list_packs("random", :all, current_user, true) == []
assert Ammo.list_packs(current_user, search: "stupendous") == [fantastic_pack]
assert Ammo.list_packs(current_user, search: "random") == []
end
test "list_packs_for_type/3 returns all packs for a type", %{
test "list_packs/2 returns all relevant packs including staged", %{
type: type,
container: container,
pack: unstaged_pack,
current_user: current_user
} do
{1, [staged_pack]} = pack_fixture(%{staged: true}, type, container, current_user)
assert Ammo.list_packs(current_user, staged: false) == [unstaged_pack]
assert Ammo.list_packs(current_user, staged: true) == [staged_pack]
packs = Ammo.list_packs(current_user)
assert Enum.count(packs) == 2
assert unstaged_pack in packs
assert staged_pack in packs
end
test "list_packs/2 returns all relevant packs for a type", %{
container: container,
current_user: current_user
} do
type = type_fixture(current_user)
{1, [pack]} = pack_fixture(type, container, current_user)
assert [^pack] = Ammo.list_packs_for_type(type, current_user)
assert [^pack] = Ammo.list_packs(current_user, type_id: type.id)
shot_record_fixture(current_user, pack)
pack = Ammo.get_pack!(pack.id, current_user)
assert [] == Ammo.list_packs_for_type(type, current_user)
assert [^pack] = Ammo.list_packs_for_type(type, current_user, true)
assert [] == Ammo.list_packs(current_user, type_id: type.id)
assert [^pack] = Ammo.list_packs(current_user, type_id: type.id, show_used: true)
end
test "list_packs_for_container/3 returns all packs for a container" do
test "list_packs/2 returns all relevant packs for a container" do
current_user = user_fixture()
container = container_fixture(current_user)
@ -838,78 +893,75 @@ defmodule Cannery.AmmoTest do
pack_fixture(shotgun_type, another_container, current_user)
pack_fixture(pistol_type, another_container, current_user)
assert [^rifle_pack] = Ammo.list_packs_for_container(container, :rifle, current_user)
assert [^rifle_pack] =
Ammo.list_packs(current_user, container_id: container.id, class: :rifle)
assert [^shotgun_pack] = Ammo.list_packs_for_container(container, :shotgun, current_user)
assert [^shotgun_pack] =
Ammo.list_packs(current_user, container_id: container.id, class: :shotgun)
assert [^pistol_pack] = Ammo.list_packs_for_container(container, :pistol, current_user)
assert [^pistol_pack] =
Ammo.list_packs(current_user, container_id: container.id, class: :pistol)
packs = Ammo.list_packs_for_container(container, :all, current_user)
packs = Ammo.list_packs(current_user, container_id: container.id, class: :all)
assert Enum.count(packs) == 3
assert rifle_pack in packs
assert shotgun_pack in packs
assert pistol_pack in packs
packs = Ammo.list_packs_for_container(container, nil, current_user)
packs = Ammo.list_packs(current_user, container_id: container.id)
assert Enum.count(packs) == 3
assert rifle_pack in packs
assert shotgun_pack in packs
assert pistol_pack in packs
end
test "get_packs_count_for_type/2 returns count of packs for a type", %{
test "get_packs_count/2 with type_id returns count of packs for a type", %{
type: type,
container: container,
current_user: current_user
} do
assert 1 = Ammo.get_packs_count_for_type(type, current_user)
assert 1 = Ammo.get_packs_count(current_user, type_id: type.id)
another_type = type_fixture(current_user)
assert 0 = Ammo.get_packs_count_for_type(another_type, current_user)
assert 0 = Ammo.get_packs_count(current_user, type_id: another_type.id)
{5, _packs} = pack_fixture(%{}, 5, type, container, current_user)
assert 6 = Ammo.get_packs_count_for_type(type, current_user)
assert 6 = Ammo.get_packs_count(current_user, type_id: type.id)
end
test "get_packs_count_for_types/2 returns counts of packs for types", %{
test "get_grouped_packs_count/2 returns counts of packs for types", %{
type: %{id: type_id} = type,
container: container,
current_user: current_user
} do
assert %{type_id => 1} ==
[type] |> Ammo.get_packs_count_for_types(current_user)
Ammo.get_grouped_packs_count(current_user, types: [type], group_by: :type_id)
%{id: another_type_id} = another_type = type_fixture(current_user)
assert %{type_id => 1} ==
[type, another_type]
|> Ammo.get_packs_count_for_types(current_user)
Ammo.get_grouped_packs_count(current_user,
types: [type, another_type],
group_by: :type_id
)
{1, [_pack]} = pack_fixture(another_type, container, current_user)
packs_count = [type, another_type] |> Ammo.get_packs_count_for_types(current_user)
packs_count =
Ammo.get_grouped_packs_count(current_user, types: [type, another_type], group_by: :type_id)
assert %{^type_id => 1} = packs_count
assert %{^another_type_id => 1} = packs_count
{5, _packs} = pack_fixture(%{}, 5, type, container, current_user)
packs_count = [type, another_type] |> Ammo.get_packs_count_for_types(current_user)
packs_count =
Ammo.get_grouped_packs_count(current_user, types: [type, another_type], group_by: :type_id)
assert %{^type_id => 6} = packs_count
assert %{^another_type_id => 1} = packs_count
end
test "list_staged_packs/1 returns all packs that are staged", %{
type: type,
container: container,
current_user: current_user
} do
{1, [another_pack]} = pack_fixture(%{staged: true}, type, container, current_user)
assert Ammo.list_staged_packs(current_user) == [another_pack]
end
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

View File

@ -77,16 +77,16 @@ defmodule Cannery.ContainersTest do
_shouldnt_return = container_fixture(%{name: "another person's container"}, user_fixture())
# attributes
assert Containers.list_containers("cool", current_user) == [container_a]
assert Containers.list_containers("fascinating", current_user) == [container_b]
assert Containers.list_containers("secret", current_user) == [container_c]
assert Containers.list_containers("box", current_user) == [container_d]
assert Containers.list_containers(current_user, search: "cool") == [container_a]
assert Containers.list_containers(current_user, search: "fascinating") == [container_b]
assert Containers.list_containers(current_user, search: "secret") == [container_c]
assert Containers.list_containers(current_user, search: "box") == [container_d]
# tags
assert Containers.list_containers("stupendous", current_user) == [container_c]
assert Containers.list_containers("amazing", current_user) == [container_d]
assert Containers.list_containers(current_user, search: "stupendous") == [container_c]
assert Containers.list_containers(current_user, search: "amazing") == [container_d]
assert Containers.list_containers("asajslkdflskdf", current_user) == []
assert Containers.list_containers(current_user, search: "asajslkdflskdf") == []
end
test "get_container!/2 returns the container with given id",
@ -168,10 +168,10 @@ defmodule Cannery.ContainersTest do
tag_fixture(%{name: "bullet", desc: "pews brass shell"}, user_fixture())
# name
assert Containers.list_tags("bullet", current_user) == [tag_a]
assert Containers.list_tags("bullets", current_user) == [tag_a]
assert Containers.list_tags("hollow", current_user) == [tag_b]
assert Containers.list_tags("hollows", current_user) == [tag_b]
assert Containers.list_tags(current_user, search: "bullet") == [tag_a]
assert Containers.list_tags(current_user, search: "bullets") == [tag_a]
assert Containers.list_tags(current_user, search: "hollow") == [tag_b]
assert Containers.list_tags(current_user, search: "hollows") == [tag_b]
end
test "get_tag!/2 returns the tag with given id", %{tag: tag, current_user: current_user} do

View File

@ -51,7 +51,7 @@ defmodule CanneryWeb.ExportControllerTest do
"price_paid" => pack.price_paid,
"lot_number" => pack.lot_number,
"staged" => pack.staged,
"used_count" => pack |> ActivityLog.get_used_count(current_user),
"used_count" => ActivityLog.get_used_count(current_user, pack_id: pack.id),
"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)
@ -90,11 +90,12 @@ defmodule CanneryWeb.ExportControllerTest do
"load_grains" => type.load_grains,
"shot_charge_weight" => type.shot_charge_weight,
"dram_equivalent" => type.dram_equivalent,
"average_cost" => type |> Ammo.get_average_cost_for_type(current_user),
"round_count" => type |> Ammo.get_round_count_for_type(current_user),
"used_count" => type |> ActivityLog.get_used_count_for_type(current_user),
"pack_count" => type |> Ammo.get_packs_count_for_type(current_user),
"total_pack_count" => type |> Ammo.get_packs_count_for_type(current_user, true)
"average_cost" => Ammo.get_average_cost(type, current_user),
"round_count" => Ammo.get_round_count(current_user, type_id: type.id),
"used_count" => ActivityLog.get_used_count(current_user, type_id: type.id),
"pack_count" => Ammo.get_packs_count(current_user, type_id: type.id),
"total_pack_count" =>
Ammo.get_packs_count(current_user, type_id: type.id, show_used: true)
}
ideal_container = %{
@ -111,8 +112,8 @@ defmodule CanneryWeb.ExportControllerTest do
}
],
"type" => container.type,
"pack_count" => container |> Ammo.get_packs_count_for_container!(current_user),
"round_count" => container |> Ammo.get_round_count_for_container!(current_user)
"pack_count" => Ammo.get_packs_count(current_user, container_id: container.id),
"round_count" => Ammo.get_round_count(current_user, container_id: container.id)
}
ideal_shot_record = %{

View File

@ -177,7 +177,7 @@ defmodule CanneryWeb.PackLiveTest do
|> follow_redirect(conn, ~p"/ammo")
assert html =~ "Ammo added successfully"
assert Ammo.list_packs(nil, :all, current_user) |> Enum.count() == multiplier + 1
assert Ammo.list_packs(current_user) |> Enum.count() == multiplier + 1
end
test "does not save invalid number of new packs", %{conn: conn} do