NewcastleRSE / rse-admin-strapi

0 stars 0 forks source link

Want to be able to see how utilised the staff is over the course of the year #20

Open reeceawalsh opened 1 year ago

reeceawalsh commented 1 year ago

Feature

Visually it would work like a project raising thermometer bar with the length of the bar being the maximum amount of days that can be charged out (capacity = team member quantity * 220) and usage being the amount of days that have been charged to projects.

Can work out how many days have been charged so far in the year and then compute that to annual usage to get a percentage of current utilisation. There would be a filled up bar which equates to the amount of days charged and then a dotted line that represents the target for the end of the year. It would also keep track of where the usage should be to reach the utilisation target via a greyed out bar which would only appear if usage was behind target.

Notes:

Mock Request

GET: http://localhost:8080/api/annualProgress?populate=* Headers: Key: Content-Type | Value: application/json

Sample Input

utilisation: 0.8

Sample Output

data: { id: 1, year: 2023, annualCapacity: 2200, (the full length of the thermometer) daysBooked: 100, (the filled in block starting from the bottom) targetDaysBooked: 96, (the greyed out block which wouldn't show as it's below the days booked) targetAnnualDays: 1760, (using a 80% utilisation) onTarget: true, ( }

TargetDaysBooked

The targetDaysBooked is the amount of days that should have been booked so far to reach the target days. This needs to be dynamic as each year has different valid working days.

Each valid working day can be multiplied by the amount of team members to get the maximum value that day could have given the team. If there are 10 team members and 220 valid working days then annualCapacity would be 2200. We can then work out how many working days have occurred so far in the year by counting all days that are not bank holidays, weekends or the Christmas break. If 120 possible working days have occurred (12 actual working days 10 team members), then the target amount of working days to have been worked for this period would be 120 0.8 = 96 days. If 100 working days have occurred, that would be over the target.

Further Features

Sending a month as a parameter and receiving the same information but for a specified month. We could add monthlyCapacity and other fields.