This module provides functions for managing compensation type resources in the Humaans API. Compensation types are used to define different categories of compensation such as salary, bonus, commission, etc.
Summary
Functions
Creates a new compensation_type.
Deletes a specific compensation_type by ID.
Lists all compensation_types.
Retrieves a specific compensation_type by ID.
Updates a specific compensation_type by ID.
Types
Functions
@spec create(client :: map(), params :: map() | keyword()) :: {:ok, Humaans.Resources.CompensationType.t()} | {:error, Humaans.Error.t()}
Creates a new compensation_type.
Parameters
client- Client created withHumaans.new/1params- Map of attributes for the new compensation_type
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{name: "Annual Bonus", baseType: "variable"}
{:ok, compensation_type} = Humaans.CompensationTypes.create(client, params)
@spec delete(client :: map(), id :: String.t()) :: {:ok, %{id: String.t(), deleted: boolean()}} | {:error, Humaans.Error.t()}
Deletes a specific compensation_type by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the compensation_type to delete
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, %{id: "compensation_type_id", deleted: true}} = Humaans.CompensationTypes.delete(client, "compensation_type_id")
@spec list(client :: map(), params :: map() | keyword()) :: {:ok, [Humaans.Resources.CompensationType.t()]} | {:error, Humaans.Error.t()}
Lists all compensation_types.
Returns a list of compensation_types matching the optional filter params.
Parameters
client- Client created withHumaans.new/1params- Optional map of filter parameters (default:%{})
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, compensation_types} = Humaans.CompensationTypes.list(client)
{:ok, compensation_types} = Humaans.CompensationTypes.list(client, %{})
@spec retrieve(client :: map(), id :: String.t()) :: {:ok, Humaans.Resources.CompensationType.t()} | {:error, Humaans.Error.t()}
Retrieves a specific compensation_type by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the compensation_type to retrieve
Examples
client = Humaans.new(access_token: "your_access_token")
{:ok, compensation_type} = Humaans.CompensationTypes.retrieve(client, "compensation_type_id")
@spec update(client :: map(), id :: String.t(), params :: map() | keyword()) :: {:ok, Humaans.Resources.CompensationType.t()} | {:error, Humaans.Error.t()}
Updates a specific compensation_type by ID.
Parameters
client- Client created withHumaans.new/1id- String ID of the compensation_type to updateparams- Map of attributes to update
Examples
client = Humaans.new(access_token: "your_access_token")
params = %{name: "Performance Bonus"}
{:ok, compensation_type} = Humaans.CompensationTypes.update(client, "compensation_type_id", params)