Background script: Handle terminated users
fabriziovigevani opened this issue · comments
Fabrizio Vigevani commented
Currently the background script fetches employees data on every update event (e.g add employee accrued salary, change employee salary, etc). There is the problem where if users are terminated and do their last payday, the employee record is deleted from the contract.
This means we shouldn't rely on contract calls for fetching employees data but to use the logged data from events to perform state updates.