Humaans.CompensationTypes behaviour (Humaans v0.1.0)

View Source

Handles operations related to bank accounts.

Summary

Types

delete_response()

@type delete_response() :: {:ok, %{id: String.t(), deleted: bool()}} | {:error, any()}

list_response()

@type list_response() ::
  {:ok,
   [
     %Humaans.Resources.CompensationType{
       base_type: term(),
       company_id: term(),
       created_at: term(),
       id: term(),
       name: term(),
       updated_at: term()
     }
   ]}
  | {:error, any()}

response()

@type response() ::
  {:ok,
   %Humaans.Resources.CompensationType{
     base_type: term(),
     company_id: term(),
     created_at: term(),
     id: term(),
     name: term(),
     updated_at: term()
   }}
  | {:error, any()}

Callbacks

create(map)

@callback create(map()) :: {:ok, map()} | {:error, any()}

delete(t)

@callback delete(String.t()) :: {:ok, map()} | {:error, any()}

list(map)

@callback list(map()) :: {:ok, map()} | {:error, any()}

retrieve(t)

@callback retrieve(String.t()) :: {:ok, map()} | {:error, any()}

update(t, map)

@callback update(String.t(), map()) :: {:ok, map()} | {:error, any()}

Functions

create(params)

@spec create(params :: keyword()) :: response()

delete(id)

@spec delete(id :: String.t()) :: delete_response()

list(params \\ %{})

@spec list(params :: keyword()) :: list_response()

retrieve(id)

@spec retrieve(id :: String.t()) :: response()

update(id, params)

@spec update(id :: String.t(), params :: keyword()) :: response()