codescalers / CSHR

CRM project mainly for the HR department to manage the employees.
Apache License 2.0
1 stars 1 forks source link

vacation balance while there are pending vacations #434

Open Nayer-Sobhy opened 4 months ago

Nayer-Sobhy commented 4 months ago

When the user applies for a vacation and it is still pending, the system does not remove/ block them from the balance. So if the user applied for another vacation or the admin checked the balance, it will show the balance without deducting the applied and not yet approved vacation. So can the system detect the pending vacation and block it from the balance till it's approved so it gets deducted or rejected then it's added again to the balance

Mahmoud-Emad commented 4 months ago

To resolve this issue, we should include a field called blocked in the balance object response. This field will indicate the blocked balance, providing the admin with the actual status of the user's balance. Additionally, we should implement a check on this field when users apply for a new vacation to ensure they address any pending requests first.