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

This module provides functions for managing timesheet submission resources in
the Humaans API. Timesheet submissions represent a collection of timesheet
entries for a specific time period that has been submitted for review and
approval.

# `delete_response`

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

# `list_response`

```elixir
@type list_response() ::
  {:ok,
   [
     %Humaans.Resources.TimesheetSubmission{
       changes_requested: term(),
       created_at: term(),
       duration_as_days: term(),
       duration_as_time: term(),
       end_date: term(),
       id: term(),
       person_id: term(),
       reviewed_at: term(),
       reviewed_by: term(),
       start_date: term(),
       status: term(),
       submitted_at: term(),
       updated_at: term()
     }
   ]}
  | {:error, any()}
```

# `response`

```elixir
@type response() ::
  {:ok,
   %Humaans.Resources.TimesheetSubmission{
     changes_requested: term(),
     created_at: term(),
     duration_as_days: term(),
     duration_as_time: term(),
     end_date: term(),
     id: term(),
     person_id: term(),
     reviewed_at: term(),
     reviewed_by: term(),
     start_date: term(),
     status: term(),
     submitted_at: 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 timesheet submission resource.

## Parameters

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

## Examples

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

    params = %{
      personId: "person_id",
      startDate: "2023-01-01",
      endDate: "2023-01-31",
      status: "pending"
    }

    {:ok, submission} = Humaans.TimesheetSubmissions.create(client, params)

# `delete`

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

Deletes a specific timesheet submission by ID.

## Parameters

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

## Examples

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

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

# `list`

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

Lists all timesheet submission resources.

Returns a list of timesheet submission 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 timesheet submissions
    {:ok, submissions} = Humaans.TimesheetSubmissions.list(client)

    # List with filtering parameters
    {:ok, submissions} = Humaans.TimesheetSubmissions.list(client, %{personId: "person_id"})

# `retrieve`

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

Retrieves a specific timesheet submission by ID.

## Parameters

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

## Examples

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

    {:ok, submission} = Humaans.TimesheetSubmissions.retrieve(client, "submission_id")

# `update`

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

Updates a specific timesheet submission by ID.

## Parameters

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

## Examples

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

    params = %{status: "approved"}

    {:ok, updated_submission} = Humaans.TimesheetSubmissions.update(client, "submission_id", params)

---

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