NewcastleRSE / rse-admin-strapi

0 stars 0 forks source link

Check staff members time allocation to projects #23

Closed reeceawalsh closed 1 year ago

reeceawalsh commented 1 year ago

Feature

Staff members can often have a 50:50 allocation between two projects and it's important to be able to check that each staff member is splitting their time 50:50. This could be a request that is sent and shows each team members project allocations over the past month or it could be a request that is sent with a user id that shows just that users project allocations.

Information

Currently sending the following request:

GET: http://localhost:8080/api/timesheets/61f7a65dbf1bbd124fd0b291?populate=* Headers: Content-Type: application/json

Will return user 61f7a65dbf1bbd124fd0b291's timesheet allocation for the past 30 days as input on Clockify.

Output

"_id": "64959aea1969df2f5d87cb97", "description": "", "userId": "61f7a65dbf1bbd124fd0b291", "timeInterval": { "start": "2023-06-21T09:00:00+01:00", "end": "2023-06-21T13:00:00+01:00", "duration": 14400 }, "billable": true, "projectId": "61f4055d93fa916b4e9161f9", "taskId": null, "tagIds": null, "approvalRequestId": null, "isLocked": false, "amount": 19444, "rate": 4861, "userName": "Kate Court", "userEmail": "kate.court@ncl.ac.uk", "taskName": null, "projectName": "RSE Team", "projectColor": "#9C27B0", "clientName": "Mark Turner", "clientId": "61f405435bc60c } }

Notes

This information is good, but it contains a lot of meetings, teaching, training etc. and doesn't distinguish between these and projects. We need to create someway of filtering through and only looking at the projects the user has.

Mark has already ensured a clockifyID field is attached to all projects stored on Strapi, and I've tested that one of the ID's matched to the timesheet ids we have.

The ID - 631350e5aee6390995ca0ae4 in one of the timesheet entries belongs to Richard Howeys project for - Statistical and Computational Genetics Group. Which is also the clockifyID for a project of the same name in the Projects collection.

It's important to note that this ID is found in the 'children' array in the timesheets output that is attached to the meeting.

The simplest method of retrieving each staff members time allocation on the project would be to:

reeceawalsh commented 1 year ago

Something really visual would be nice. Have a project bar that would be split by colour and then be able to see by month how much work they are doing on each project. Need to look to pull the categories in through the API. Becky has setup a volunteering category to test with.

reeceawalsh commented 1 year ago

Created something nice and visual that displays a staff members breakdown of tasks (volunteering, meeting, annual leave etc) then displays their projects (including RSE (internal)) and then just their projects without the RSE. Each one has a breakdown in percentages of time allocation that month.

Screenshot 2023-07-03 at 16 16 29

![Uploading Screenshot 2023-07-

Screenshot 2023-07-03 at 16 16 49

03 at 16.16.51.png…]()

Screenshot 2023-07-03 at 16 16 47