 defmodule Appointments.Employee do
   use Appointments.Web, :model
 
-  # TODO(krummi): alias Openmaize.DB
+  alias Openmaize.DB
 
   schema "employees" do
+    field :email, :string
     field :name, :string
     field :phone, :string
     field :bio, :string
     field :avatar_url, :string
+    field :role, :string
 
-    # Openmaize stuff
-    field :email, :string
+    # Authentication
     field :password, :string, virtual: true
     field :password_hash, :string
 

    # TODO(krummi): validations
    model
    |> cast(params, @required_fields, @optional_fields)
    |> unique_constraint(:email)
  end
end

    timestamps
  end

  @required_fields ~w(name email role)
  @optional_fields ~w(phone bio avatar_url
                      password_hash
                      confirmation_token confirmation_sent_at confirmed_at
                      reset_token reset_sent_at)

