Class

TimeEntries

TimeEntries(client)

Class corresponding to Aworks TimeEntries Endpoints
Constructor

# new TimeEntries(client)

Endpoint constructor
Parameters:
Name Type Description
client Client
See:
  • [TimeEntries in Awork API Docs](https://openapi.awork.com/#/TimeEntries)

View Source endpoints/TimeEntries.js, line 9

Classes

TimeEntries

Methods

# async create(timeEntry) → {Promise.<TimeEntry>}

Creates a new time entry. Depending on the time entry, the calling users has to have several permissions to create the time entry. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs permissions on: 'project-planning-data' if it is a project task.
Parameters:
Name Type Description
timeEntry TimeEntryCreateModel The model to create a time entry.

View Source endpoints/TimeEntries.js, line 72

Promise.<TimeEntry>

# async delete(timeEntryId) → {Promise.<void>}

Deletes the time entry with the specified id. Depending on the time entry, the calling users has to have several permissions to delete the time entry. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs permissions on: 'project-planning-data' if it is a project task. If the time entry is billed, Admin permissions are required.
Parameters:
Name Type Description
timeEntryId String The id of the time entry.

View Source endpoints/TimeEntries.js, line 99

Promise.<void>

# async deleteTimeEntries(timeEntry) → {Promise.<void>}

Deletes the time entries with the specified ids. Depending on the time entry, the calling users has to have several permissions to delete the time entries. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs permissions on: 'project-planning-data' if it is a project task. If the time entry is billed, Admin permissions are required.
Parameters:
Name Type Description
timeEntry Array.<String> The ids of the time entries, which should be deleted.

View Source endpoints/TimeEntries.js, line 108

Promise.<void>

# async get(timeEntryId) → {Promise.<TimeEntry>}

Returns the time entry with the specified id. Depending on the time entry, the calling users has to have several permissions to get the time entry. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs permissions on: 'project-planning-data' if it is a project task.
Parameters:
Name Type Description
timeEntryId String The id of the time entry.

View Source endpoints/TimeEntries.js, line 24

Promise.<TimeEntry>

# async lastTimeEntries(optionsopt) → {Promise.<Array.<TimeEntry>>}

Returns the last time entry of each user. The last time entry of each user is always the last one that was started. Time entires which are started in the future are ignored. If a time entry does not have a start time, 12.00 am is automatically assumed as the start time for comparison with other time entries from the same day.
Parameters:
Name Type Attributes Description
options ListOptions <optional>
Pagination and filtering options

View Source endpoints/TimeEntries.js, line 168

Promise.<Array.<TimeEntry>>

# async list(options) → {Promise.<Array.<TimeEntry>>}

Returns all time entries. Depending on the time entry, the calling users has to have several permissions to get the time entry. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs permissions on: 'project-planning-data' if it is a project task.
Parameters:
Name Type Description
options

View Source endpoints/TimeEntries.js, line 35

Promise.<Array.<TimeEntry>>

# async setBillable(timeEntry) → {Promise.<void>}

Sets the time entries with the specified ids to billable. Depending on the time entry, the calling users has to have several permissions to edit the time entries. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs 'write' permissions on: 'project-timetracking' if it is a project task.
Parameters:
Name Type Description
timeEntry Array.<String> The ids of the time entries, which should be set to billable.

View Source endpoints/TimeEntries.js, line 144

Promise.<void>

# async setBilled(timeEntry) → {Promise.<void>}

Sets the time entries with the specified ids to billed. Depending on the time entry, the calling users has to have several permissions to edit the time entries. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs permissions on: 'project-planning-data' if it is a project task. If the time entry is billed, the permissions can be ignored because there is no change.
Parameters:
Name Type Description
timeEntry Array.<String> The ids of the time entries, which should be set to billed.

View Source endpoints/TimeEntries.js, line 117

Promise.<void>

# async setTypeOfWork(timeEntry) → {Promise.<void>}

Sets the type of work of the specified timeentries. Depending on the time entry, the calling users has to have several permissions to edit the time entries. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs permissions on: 'project-planning-data' if it is a project task.
Parameters:
Name Type Description
timeEntry SetTypeOfWorkModel The model of ids of time entries.

View Source endpoints/TimeEntries.js, line 159

Promise.<void>

# async setUnbillable(timeEntry) → {Promise.<void>}

Sets the time entries with the specified ids to unbillable. Already billed time entries cannot be set to unbillable -> Badrequest Depending on the time entry, the calling users has to have several permissions to edit the time entries. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs write permissions on: 'project-timetracking' if it is a project task.
Parameters:
Name Type Description
timeEntry Array.<String> The ids of the time entries, which should be set to unbillable.

View Source endpoints/TimeEntries.js, line 135

Promise.<void>

# async setUnbilled(timeEntry) → {Promise.<void>}

Sets the time entries with the specified ids to unbilled. For setting already billed time entries to unbilled, the user needs to have admin permissions.
Parameters:
Name Type Description
timeEntry Array.<String> The ids of the time entries, which should be set to unbilled.

View Source endpoints/TimeEntries.js, line 126

Promise.<void>

# async update(timeEntryId, timeEntry) → {Promise.<TimeEntry>}

Updates the time entry with the specified id. Depending on the time entry, the calling users has to have several permissions to update the time entry. No permissions are required if the calling user is owner of this time entry. If the calling user is not the creator of the time entry and the time entry is connected to a project, 'write' permissions on the 'project-timetracking' feature are necessary. If the time entry is connected to a task, the user needs to be assignee of this task or the user needs permissions on: 'project-planning-data' if it is a project task.
Parameters:
Name Type Description
timeEntryId String The id of the time entry.
timeEntry TimeEntryUpdateModel The model to update the time entry with the specified id.

View Source endpoints/TimeEntries.js, line 88

Promise.<TimeEntry>