1- every organization will list the areas that they are covering (enable/disable) - area boundaries
2- Organization drivers needs to be linked to the list of areas that they cover (multiple)
3- When an organization received an order from any channel (API, CSV bulk upload, UI) we will match the pick-up point and the delivery point if they are within the company coverage list or not.
4- If any of them (pickup, delivery) are not in the coverage then we will save the order and inform the raiser that your order is not within the coverage areas and make the status as "canceled".
5- If both are in the coverage area then accept the order normally and assign it to the driver automatically on the below basis, keeping in mind the auto assigning can be disabled or enabled, the organization will decide if they want this or the dispatcher will take care of assigning process manually.
6- Always we will assign one of the drivers that are assigned to cover the area.
7- Based on the pickup location we will fairly distribute the orders on the drivers by turn.
8- Based on the closest driver (current location) to the pickup location.
9- If the selected driver to pick-up is not covering the delivery location then we will put the closest warehouse location to the pick-up location as the transit point and will mark the delivery as in transit when it reaches the warehouse.
10- We will again repeat the above process till the final destination.
11- Organisation admin can configure the automatic assigning are based on what on points 7 or 8.
12- Based on a condition like a driver must be on duty like online or not, of both 7,8 above points
13- Make sure to assign to a driver that is (enabled).