We recommend that you implement these advanced schedule enforcement tactics to ensure the best possible enforcement:
Checking the scheduled shift role
Since you have already completed role mapping & employee mapping, your integration should be able to determine whether the role that an employee is trying to clock in for through your system is indeed the role that the shift is scheduled for.
For example, consider an employee who is assigned to both, Server and Host roles in your system. If they specify that they are trying to clock in as a Server, but the scheduled shift returned in the response from 7shifts states that the scheduled shift is for the Host role, you may want to avoid the employee from clocking in.
You will need to look at the role.id field in the response to find which role the scheduled shift is for.
Preventing late clock-ins
You may also want to allow the admin/manager in your system to decide whether to prevent late clock-ins or not, and define a window within which to allow late clock-ins for.
In order to enforce this, you will need to know the time that the shift is scheduled to start. You can use the shift.id from the response and then make a request to our /shifts endpoint as follows to find out when the shift was actually scheduled to start:
If an admin/manager has enabled the ‘Prevent late clock-ins’ feature in your system & defined a time window for the same, and once you have determined the start time of the shift, you can then combine all that info to determine whether to allow the user to clock in or not.