typespec some models

This commit is contained in:
2021-09-12 19:26:04 -04:00
committed by oliviasculley
parent bd6c05f619
commit f12e71cbe2
3 changed files with 36 additions and 12 deletions

View File

@ -6,9 +6,9 @@ defmodule Cannery.Containers.Container do
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "containers" do
field :name, :string
field :desc, :string
field :location, :string
field :name, :string
field :type, :string
belongs_to :user, Accounts.User
@ -16,6 +16,18 @@ defmodule Cannery.Containers.Container do
timestamps()
end
@type t :: %{
id: Ecto.UUID.t(),
name: String.t(),
desc: String.t(),
location: String.t(),
type: String.t(),
user: Accounts.User.t(),
user_id: Ecto.UUID.t(),
inserted_at: NaiveDateTime.t(),
updated_at: NaiveDateTime.t()
}
@doc false
def changeset(container, attrs) do
container