Refactor and add securities controller

This commit is contained in:
2025-01-28 16:13:39 +01:00
parent 55a5ece466
commit 3df76ec650
16 changed files with 509 additions and 4 deletions

View File

@@ -0,0 +1,25 @@
defmodule Tradex.InstrumentsFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Tradex.Instruments` context.
"""
@doc """
Generate a security.
"""
def security_fixture(attrs \\ %{}) do
{:ok, security} =
attrs
|> Enum.into(%{
expiration_date: ~D[2025-01-27],
isin: "some isin",
name: "some name",
strike_price: "120.5",
ticker: "some ticker",
wkn: "some wkn"
})
|> Tradex.Instruments.create_security()
security
end
end