mirror of
https://github.com/ClaperCo/Claper.git
synced 2026-07-09 20:09:55 +02:00
* Add audit log * Update translation files * Improve Audit queries * Improve Audit.Log schema * Make user auth audit logs async * Relax Flop and Flop Phoenix dep specs * Make Flop.validate!/2 call more robust * Improve a11y and UI for audit log live view * Improve audit_logs indexes * Fix formatting * Fix async_log_action and tests * Add remote_ip * Update translation files
24 lines
456 B
Elixir
24 lines
456 B
Elixir
defmodule Claper.AuditFixtures do
|
|
@moduledoc """
|
|
This module defines test helpers for creating
|
|
entities via the `Claper.Audit` context.
|
|
"""
|
|
|
|
@doc """
|
|
Generate a log.
|
|
"""
|
|
def log_fixture(attrs \\ %{}) do
|
|
{:ok, log} =
|
|
attrs
|
|
|> Enum.into(%{
|
|
action: "some action",
|
|
metadata: %{},
|
|
resource_id: 42,
|
|
resource_type: "some resource_type"
|
|
})
|
|
|> Claper.Audit.create_log()
|
|
|
|
log
|
|
end
|
|
end
|