Appearance
Time Reporting (Time Sheet)
Breaking Change
The from_time and to_time fields require a proper datetime format. The previous version allowed from_time and to_time to be in HH:mm format.The previous from_time and to_time format is not good for data processing and computation.
What if the user wants to create a timesheet that spans multiple days? or it spans at midnight? (e.g. 23:00 - 01:00).
This is why we don't need to accept from_time and to_time as a time string.
Create Time Sheet
Available on: NEXT This endpoint deprecates
/timereportingendpoint on the previous version.
http
POST /v2/time-reportingRequest Body:
Array of time reporting objects.
| Name | Type | Description |
|---|---|---|
| description | string | plaintext or in HTML format obtained from Quill editor |
| from_time | DateTime | DateTime ISO 8601 format |
| to_time | DateTime | DateTime in ISO 8601 format |
| date | string | Date in ISO 8601 format or in YYYY-MM-dd format |
| project_id | string | number | Required. ID of the Project |
| member_id | string | number | Optional. Only Admin role can set member_id |
| task_id | string | number | Required. ID of the Task |
| requirement_id | string | number | Optional |
| todo_id | string | number | Optional |
List Time Reporting/Timesheet
Available on: NEXT
Retrieves the time reporting data.
http
GET /v2/time-reporting/Query Parameters:
| Name | Type | Description |
|---|---|---|
submitted | boolean | Filter the Time Sheet that has been submitted. Remove the query parameter to get all Time Sheet. Setting value to false will return Time Sheet that has not been submitted. |
after | string | Date in YYYY-MM-DD format. Filter Time Sheet after the given date. (Inclusive) |
before | string | Date in YYYY-MM-DD format. Filter Time Sheet before the given date. (Inclusive) |
date | string | Date in YYYY-MM-DD format. Filter Time Sheet by specific date. |
user_node_id | string | The ID (Node ID) of User. Only applicable for admin to return TimeSheet of a given user. |
order_by | string | Field to order by. Default date. No other options supported. |
Get TimeReport by ID
Retrieves the time reporting data by id.
http
GET /v2/time-reporting/:idQuery Parameters:
| Name | Type | Description |
|---|---|---|
| dottie | boolean | Transform object dot notation to nested object |
| id | string | Time Report NodeId |
Update a Time Report
Available on: NEXT
Update a time report.
http
PATCH /v2/time-reporting/:node_idThe endpoint ignores the following fields to be updated:
id | node_id | user_id |
user_node_id | updatedAt | createdAt |
is_checked | total_hours | task_id |
member_id | project_id | is_deleted |
URL Parameters:
| Name | Type | Description |
|---|---|---|
| node_id | string | Time Report NodeId |
Request Body:
| Name | Type | Description |
|---|---|---|
description | string | plaintext |
from_time | string | Time in HH:mm format |
to_time | string | Time in HH:mm format |
date | string | Date in ISO 8601 format or in YYYY-MM-dd format |
project_node_id | string | The Node ID of the Project |
task_node_id | string | The Node ID of the Task |
member_node_id | string | Only Admin role can change member_node_id. This is the Node ID of a User |
Delete a Time Report
Deletes a time report by id.
- A Time Report can only be deleted by an Admin or by the User who created the Time Report.
- When a Time Report has been submitted in Progress Report, it cannot be deleted.
http
DELETE /v2/time-reporting/:node_idURL Parameters:
| Name | Type | Description |
|---|---|---|
| node_id | string | Time Report NodeId |
Example Response
json
{
"id": 108,
"node_id": "pxg6eKTuSwBrVLz2",
"project_id": 18,
"member_id": 2,
"user_id": 2,
"task_id": 23,
"project_node_id": "77YaPOIgU3PHTUg8",
"member_node_id": "0058485f-84d6-4a3e-8720-4057569f8c60",
"user_node_id": "0058485f-84d6-4a3e-8720-4057569f8c60",
"task_node_id": "h6caAIfvMbJUgTsw",
"date": "2024-10-23T16:00:00.000Z",
"createdAt": "2024-10-24T05:59:49.000Z",
"updatedAt": "2024-10-29T07:52:48.000Z",
"description": "asdadas",
"from_time": "12:37",
"to_time": "15:37",
"total_hours": 3,
"task": {
"id": 23,
"task_id": 0,
"task_name": "asd2",
"start_date": null,
"end_date": null,
"description": "",
"task_no": "12",
"node_id": "h6caAIfvMbJUgTsw"
},
"project": {
"id": 18,
"project_name": "bwew",
"description": "asdadas",
"node_id": "77YaPOIgU3PHTUg8"
},
"user": {
"id": 2,
"email": "c62ror3jtx7z7xnq@ethereal.email",
"avatar": "",
"node_id": "0058485f-84d6-4a3e-8720-4057569f8c60",
"full_name": "User Generator",
"first_name": "User",
"last_name": "Generator",
"employee_no": "2"
},
"member": {
"id": 2,
"email": "c62ror3jtx7z7xnq@ethereal.email",
"avatar": "",
"node_id": "0058485f-84d6-4a3e-8720-4057569f8c60",
"full_name": "User Generator",
"first_name": "User",
"last_name": "Generator",
"employee_no": "2"
}
}json
// When a Time Report is not existing or already deleted.
{
"error": {
"message": "Time Sheet not found",
"code": "ENTITY_NOT_FOUND",
"status": 404,
"data": {}
}
}