# `BambooHR.TimeTracking`
[🔗](https://github.com/sgerrand/ex_bamboo_hr/blob/v0.6.0/lib/bamboo_hr/time_tracking.ex#L1)

Functions for interacting with time tracking resources in the BambooHR API.

# `clock_in`

```elixir
@spec clock_in(BambooHR.Client.t(), integer(), map()) :: BambooHR.Client.response()
```

Records a clock-in event for an employee.

## Parameters

  * `client` - Client configuration created with `BambooHR.Client.new/1`
  * `employee_id` - The ID of the employee to clock in
  * `clock_data` - Map containing clock-in details (date, start time, timezone, etc.)

## Examples

    iex> clock_data = %{
    ...>   "date" => "2024-01-15",
    ...>   "start" => "09:00",
    ...>   "timezone" => "America/New_York"
    ...> }
    iex> BambooHR.TimeTracking.clock_in(client, 123, clock_data)
    {:ok, %{"message" => "Successfully clocked in"}}

# `clock_out`

```elixir
@spec clock_out(BambooHR.Client.t(), integer(), map()) :: BambooHR.Client.response()
```

Records a clock-out event for an employee.

## Parameters

  * `client` - Client configuration created with `BambooHR.Client.new/1`
  * `employee_id` - The ID of the employee to clock out
  * `clock_data` - Map containing clock-out details (date, end time, timezone)

## Examples

    iex> clock_data = %{
    ...>   "date" => "2024-01-15",
    ...>   "end" => "17:00",
    ...>   "timezone" => "America/New_York"
    ...> }
    iex> BambooHR.TimeTracking.clock_out(client, 123, clock_data)
    {:ok, %{"message" => "Successfully clocked out"}}

# `get_timesheet_entries`

```elixir
@spec get_timesheet_entries(BambooHR.Client.t(), map()) :: BambooHR.Client.response()
```

Retrieves timesheet entries within a specified date range.

## Parameters

  * `client` - Client configuration created with `BambooHR.Client.new/1`
  * `params` - Map containing query parameters (start, end dates, and optional employee IDs)

## Examples

    iex> params = %{
    ...>   "start" => "2024-01-01",
    ...>   "end" => "2024-01-31",
    ...>   "employeeIds" => "123,124"
    ...> }
    iex> BambooHR.TimeTracking.get_timesheet_entries(client, params)
    {:ok, %{
      "entries" => [
        %{
          "id" => "1",
          "employeeId" => "123",
          "date" => "2024-01-15",
          "hours" => 8.0
        }
      ]
    }}

# `store_clock_entries`

```elixir
@spec store_clock_entries(BambooHR.Client.t(), [map()]) :: BambooHR.Client.response()
```

Stores timesheet clock entries for employees.

## Parameters

  * `client` - Client configuration created with `BambooHR.Client.new/1`
  * `entries` - List of clock entry maps containing employee ID, date, start and end times

## Examples

    iex> entries = [
    ...>   %{
    ...>     "employeeId" => "123",
    ...>     "date" => "2024-01-15",
    ...>     "start" => "09:00:00",
    ...>     "end" => "17:00:00"
    ...>   }
    ...> ]
    iex> BambooHR.TimeTracking.store_clock_entries(client, entries)
    {:ok, %{"message" => "Entries stored successfully"}}

---

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