Hello
I have a vehicle control application, in this application there is the process of allocating vehicle, this process assigns a vehicle to a registered driver. In the challenge, the application has undergone changes and must now keep a record of all allocations made, so a new method will be needed to make a vehicle available that is no longer allocated, even if the allocation record remains. An "Available" or "Allocated" vehicle status will be requiredI'm not sure how to perform these operations
@Jesaias Abimael I am not fully understood your requirement. but I will try,
In your case, you want to set the status of the vehicle Allocated OR Available. for that you can apply boolean logic while allocating to the driver you can set it to False and vice versa.
If possible, attached OML here OR provide some more details, about where you are facing a problem
Thanks
Shriyash
Thanks! Your comment helped me a lot
Hey Jesaias
It looks you are facing issue when you have to keep history of Driver - Vehicle assignments though I'm presuming you were able to manage it when requirement was not to keep that history.
With this in mind, I would like to suggest that you should not change anything from what you build earlier. Just create one additional table named as "AllocationLog" with the attribute to add DriverID, VehicleID, AllocationDate, ReleaseDate and what others you want.
Whenever the Vehicle get assigned and released from driver, you will need to update this table additionally and the previous flow of Vehicle Availability will not change.
Please feel free to ask in case you still have doubts
Thanks! Your answer was very clear!
You're welcome. Please mark the solution. So, others may also refer it