# `Humaans.CompensationTypes`
[🔗](https://github.com/sgerrand/ex_humaans/blob/v0.4.2/lib/humaans/compensation_types.ex#L1)

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.

# `delete_response`

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

# `list_response`

```elixir
@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`

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

# `create`

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

# `delete`

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

# `list`

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

# `retrieve`

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

# `update`

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

# `create`

```elixir
@spec create(client :: map(), params :: keyword()) :: response()
```

Creates a new compensation type resource.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `params` - Map of parameters for the new compensation type

## Examples

    client = Humaans.new(access_token: "your_access_token")

    params = %{
      name: "Annual Bonus",
      category: "bonus",
      payFrequency: "once",
      recurring: true
    }

    {:ok, comp_type} = Humaans.CompensationTypes.create(client, params)

# `delete`

```elixir
@spec delete(client :: map(), id :: String.t()) :: delete_response()
```

Deletes a specific compensation type by ID.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `id` - String ID of the compensation type to delete

## Examples

    client = Humaans.new(access_token: "your_access_token")

    {:ok, result} = Humaans.CompensationTypes.delete(client, "type_id")
    # result contains %{id: "type_id", deleted: true}

# `list`

```elixir
@spec list(client :: map(), params :: keyword()) :: list_response()
```

Lists all compensation type resources.

Returns a list of compensation type resources that match the optional filters provided in `params`.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `params` - Optional parameters for filtering the results (default: `%{}`)

## Examples

    client = Humaans.new(access_token: "your_access_token")

    # List all compensation types
    {:ok, types} = Humaans.CompensationTypes.list(client)

    # List with filtering parameters
    {:ok, types} = Humaans.CompensationTypes.list(client, %{limit: 10})

# `retrieve`

```elixir
@spec retrieve(client :: map(), id :: String.t()) :: response()
```

Retrieves a specific compensation type by ID.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `id` - String ID of the compensation type to retrieve

## Examples

    client = Humaans.new(access_token: "your_access_token")

    {:ok, comp_type} = Humaans.CompensationTypes.retrieve(client, "type_id")

# `update`

```elixir
@spec update(client :: map(), id :: String.t(), params :: keyword()) :: response()
```

Updates a specific compensation type by ID.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `id` - String ID of the compensation type to update
  * `params` - Map of parameters to update

## Examples

    client = Humaans.new(access_token: "your_access_token")

    params = %{name: "Quarterly Bonus", payFrequency: "quarterly"}

    {:ok, updated_type} = Humaans.CompensationTypes.update(client, "type_id", params)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
