A four-step asset transfer workflow in Laravel, with a rejection status per step
When a laptop moves from one employee to another, three people want to know: the location manager who owns the stock, the employee who hands it over, and the employee who receives it. Auditors want to know later. In Osol, an asset and custody management system for companies in Saudi Arabia, each transfer runs through a fixed approval chain. This post shows the model. The chain A transfer request…
In Osol, a Saudi-based asset and custody management system, transferring ownership of an item like a laptop involves a four-step approval process. The first step is the location manager who owns the asset granting permission for the move. The second step requires the current holder of the item to confirm the handover using a one-time code, ensuring it's a legitimate request.
The third step involves the new holder confirming receipt of the item through a second one-time code. Finally, the oversight department provides the final check before the transfer is completed.
Each step in this workflow is defined by a role, such as old_owner, and the system identifies the actual user when the request is created. If the transfer request isn't completed within 24 hours, an automatic reminder is sent. If it remains incomplete after 72 hours, the system automatically rejects the request. The transfer record stores only the final outcome, which is represented by an enum with various status codes.
The approval chain allows for easy changes without adding new enum values. For example, adding an extra finance approval step wouldn't require creating new enum values. When a transfer is rejected, the system maps the rejected step to a specific status and updates the transfer record with the rejection reason and closure date. Completion of the final step moves ownership in the same database transaction, updating the asset's ownership information and moving the ownership history record accordingly.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.