TimePunch TimeEntry Service
This service contains methods in order to work with the time-entries of TimePunch.
AssignTimeEntriesToCustomer
With this method, you can assign multiple time entries to a new customer.
void AssignTimeEntriesToCustomer(
out TpFault fault,
TpAuthentication authentication,
Guid[] timeEntryIds,
Guid customerId);
Needed Permission | timeEntries@restrictedEdit | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntryIds | Array of ids of the time entries that shall be amended. | |
customerId | New customer Id that is used to update the time entries. |
AssignTimeEntriesToProjects
With this method, you can assign multiple time entries to a new project.
void AssignTimeEntriesToProjects(
out TpFault fault,
TpAuthentication authentication,
Guid[] timeEntryIds,
Guid projectId,
Guid taskId);
Needed Permission | timeEntries@restrictedEdit | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntryIds | Array of ids of the time entries that shall be amended. | |
projectId | New project Id that is used to update the time entries. | |
taskId | New task Id that is used to update the time entries. |
BatchFilterUpdate
This method updates all public and private filters in TimePunch.
TpFault BatchFilterUpdate(
TpAuthentication authentication,
List<TimeEntrySearchDto> privateFilters,
List<TimeEntrySearchDto> publicFilters);
Needed Permission | timeEntryFilter@manage | |
---|---|---|
Name | Modifier | Description |
authentication | User authentication | |
privateFilters | Collection of private filters | |
publicFilters | Collection of public filters | |
Return value | Fault object if an exception occurs |
CheckTimeEntryOverlapping
This method checks whether the given time entry would override existing time entries in the database. Thus an unintended override of time entries can be prevented.
bool CheckTimeEntryOverlapping(
out TpFault fault,
TpAuthentication authentication,
TimeEntryDto entryToCheckOverlapping);
Needed Permission | timeEntries@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
entryToCheckOverlapping | Time Entry that shall be checked against the existing time entries in the database. | |
Return value | Returns true, if the given time entry would harm existing time entries. |
CopyTimeEntries
This method copies a list of time entries and reinstates them on the passed date.
void CopyTimeEntries(
out TpFault fault,
TpAuthentication authentication,
List<TimeEntrySaveDto> entriesToCopy,
DateTime insertAt);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
entriesToCopy | List of time entries to copy | |
insertAt | Date from that the time entries shall be inserted. |
CreateBreakTimeDummy
This method creates a break time entry. A break time entry is always required if there is a period of time between the last time entry and the following time entry.
TimeEntryDto CreateBreakTimeDummy(
out TpFault fault,
TpAuthentication authentication,
DateTime startBreak,
DateTime endBreak);
Needed Permission | timeEntries@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
startBreak | Start time of the dummy break entry | |
endBreak | End time of the dummy break entry. | |
Return value | The created time entry |
CreateNewTimeEntry
This method creates a new time-entry and returns it. The time-entry won’t be saved. Only after calling the save method it is available in the TimePunch profile.
TimeEntryDto CreateNewTimeEntry(
out TpFault fault,
TpAuthentication authentication,
DateTime date);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
DateTime | Date that shall be used for creating the new time entry. | |
Return value | The created time entry |
DeleteTimeEntries
This method deletes the given time entries from the TimePunch profile. It’s important to know, that only time-entries of the authenticated TimePunch profile are allowed to be deleted.
void DeleteTimeEntries(
out TpFault fault,
TpAuthentication authentication,
Guid[] timeEntryIds);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntryIds | Collection of time entry Ids that shall be deleted. |
DeleteTimeEntriesInRange
This method deletes all time entries in the specified period for the selected employees.
void DeleteTimeEntriesInRange(
out TpFault fault,
TpAuthentication authentication,
DateTime startDate,
DateTime endDate,
Guid[] userIds);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
DateTime | startDate | Start date to search for time entries |
DateTime | endDate | End date to search for time entries |
Guid[] | userIds | List of user ids that is used by the search |
DeleteTimeEntryFilter
This method deletes a time entry filter.
TpFault DeleteTimeEntryFilter(
TpAuthentication authentication,
Guid filterId);
Needed Permission | timeEntryFilter@manage timeEntryFilter@managePublic | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
filterId | Id of the filter that shall be deleted | |
Return value | Fault object if an exception occurs |
ImportTimeEntries
This method imports the transferred time entries. The import takes into account not the IDs but the start and end times, as well as the project and activity names.
void ImportTimeEntries(
out TpFault fault,
TpAuthentication authentication,
List<TimeEntryDto> rows);
Needed Permission | timeEntries@restrictedEdit commonTasks@manage projects@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
rows | Collection of time entries to import |
LoadTimeEntries
This method should be used, if the time entry ids are known, in order to load the time entries.
List<TimeEntryDto> LoadTimeEntries(
out TpFault fault,
TpAuthentication authentication,
Guid[] timeEntryIds);
Needed Permission | timeEntries@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntryIds | Array of ids of the time entries that shall be loaded. | |
Return value | Returns the loaded time entries |
LoadTimeEntryFilter
This method loads a time entry filter with the corresponding ID.
TimeEntrySearchDto LoadTimeEntryFilter(
out TpFault fault,
TpAuthentication authentication,
Guid timeEntrySearchId);
Needed Permission | timeEntryFilter@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntrySearchId | Id of the time entry filter | |
Return value | Returns the loaded time entry filter |
MarkTimeEntries
This method marks the transferred time entries with the corresponding marker in TimePunch.
void MarkTimeEntries(
out TpFault fault,
TpAuthentication authentication,
List<Guid> selectedIds,
TimeEntryMarkAs markAs)
Needed Permission | timeEntries@restrictedEdit | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
selectedIds | List of time entry ids to mark | |
markAs | Marker that shall be set for the time entries Paid = 1 Important = 2 Onsite = 4 |
SaveTimeEntryFilter
This method saves a time entry filter in the database. The mapping is not carried out using the ID, but the name of the report filter.
TimeEntrySearchDto SaveTimeEntryFilter(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySearchDto timeEntryFilter);
Needed Permission | timeEntryFilter@manage timeEntryFilter@managePublic | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntryFilter | Time Entry Filter so save | |
Return value | The stored time entry filter |
SearchTimeEntries
This method searches for time-entries with the given filter. The permission of the authenticated user will be considered. Only time entries of the user profiles that the user is allowed to access will be returned.
List<TimeEntryDto> SearchTimeEntries(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySearchDto search);
Needed Permission | timeEntries@access / core@switchIdentity | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
search | The filter that is used to search the time entries | |
Return value | Collection with the found time entries |
SearchTimeEntryFilters
This method uses the search filters criteria to find time entry filters in the database. A list of all the time entry filters found is then returned.
List<TimeEntrySearchDto> SearchTimeEntryFilters(
out TpFault fault,
TpAuthentication authentication,
TimeEntryFilterSearchDto searchFilterCriteria);
Needed Permission | timeEntryFilter@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
searchFilterCriteria | Searchfilter criteria | |
Return value | Collection containing the found time entry search objects |
SplitTimeEntry
This method splits an existing time entry into several time entries.
void SplitTimeEntry(
out TpFault fault,
TpAuthentication authentication,
Guid timeEntryId,
List<TimeEntrySaveDto> timeEntries,
bool closeActiveTimeEntry);
Needed Permission | timeEntries@restrictedEdit | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
Guid | timeEntryId | ID of the time entry that shall be splitted. That can also be an ID of an active time entry. |
TimeEntrySaveDto[] | timeEntries | List of time entries that shall replace the time entry specified by it's ID |
bool | closeActiveTimeEntry | If the time entry Id specifies an active entry, this flag indicates whether to close the time recording or not |
UnmarkTimeEntries
This method removes the markers on the transferred time entries.
void UnmarkTimeEntries(
out TpFault fault,
TpAuthentication authentication,
List<Guid> selectedIds,
TimeEntryMarkAs markAs);
Needed Permission | timeEntries@restrictedEdit | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
selectedIds | List of time entry ids to mark | |
markAs | Marker that shall be removed from the time entries Paid = 1 Important = 2 Onsite = 4 |
UpdateTimeEntryFilter
This method updates an existing time entry filter. To call the update method, the time entry filter to be updated should already exist.
TimeEntrySearchDto UpdateTimeEntryFilter(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySearchDto filter);
Needed Permission | timeEntryFilter@manage timeEntryFilter@managePublic | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
filter | Time Entry Filter so save | |
Return value | The stored time entry filter |
ValidateAndSaveBreakReplacement
This method was specially developed to be used by employees without special rights. It is used so that existing breaks, that is, the time between two time entries, can be assigned with a project by an employee without special rights.
TimeEntrySaveResultDto ValidateAndSaveBreakReplacement(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry);
Needed Permission | timeEntries@restrictedEdit | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntry | Time entry that shall be stored in the database. The time entry must fit into a break time. | |
Return value | Returns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries |
ValidateAndSaveRestrictedTimeEntry
This method is used to amend a time entry. Because the method needs less permission, one can only change the description, the project and the task of the time-entry.
TimeEntrySaveResultDto ValidateAndSaveRestrictedTimeEntry(
out TpFault fault,
TpAuthentication authentication,
TimeEntryRestrictedSaveDto timeEntry);
Needed Permission | timeEntries@restrictedEdit | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntry | Time entry that shall be stored in the database. | |
Return value | Returns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) |
ValidateAndSaveTimeEntry
This method takes a time entry, validates it and saves it in the database.
TimeEntrySaveResultDto ValidateAndSaveTimeEntry(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntry | Time entry that shall be stored in the database. | |
Return value | Returns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) |
ValidateAndSaveTimeEntrySeries
This method is used to create a time entry series, e.g. in order to create holiday entries. For that it’s necessary to define the start and end date. The concrete times are taken from the working times model of the user.
TimeEntrySaveResultDto ValidateAndSaveTimeEntrySeries(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySeriesDto timeEntrySeries);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntrySeries | Time entry series that shall be stored in the database. | |
Return value | Returns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries |
ValidateAndSaveTimeEntrySeriesMultipleUsers
This method is used to create a time entry series, e.g. in order to create holiday entries. For that it’s necessary to define the start and end date. The concrete times are taken from the working times model of the user.
TimeEntrySaveResultDto ValidateAndSaveTimeEntrySeriesMultipleUsers(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySeriesDto timeEntrySeries,
Guid[] userIds);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntrySeries | Time entry series that shall be stored in the database. | |
Guid[] | Array of user ids for whom the time entry series shall be created | |
Return value | Returns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries |
ValidateAndSaveTimeEntryCopies
Using this method copies of time entries can be created, e.g. to create an entry that occurs on several day in a row. Maybe the staff member takes part on a weekly trainee.
TimeEntrySaveResultDto ValidateAndSaveTimeEntryCopies(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntry | Time entry copy that shall be stored in the database. | |
Return value | Returns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries |
ValidateAndSaveTimeEntryCopiesMultipleUsers
Using this method copies of time entries can be created, e.g. to create an entry that occurs on several day in a row. Maybe the staff member takes part on a weekly trainee.
TimeEntrySaveResultDto ValidateAndSaveTimeEntryCopiesMultipleUsers(
out TpFault fault,
TpAuthentication authentication,
TimeEntrySaveDto timeEntry,
Guid[] userIds);
Needed Permission | timeEntries@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntry | Time entry copy that shall be stored in the database. | |
Guid[] | Array of user ids for whom the time entry copies shall be created | |
Return value | Returns the result of storing the time entry (Ok, BreakEnforced, EmptyBreakEntry) and the stored time entries |